I am using VS Code.
Supposedly there is a function called inspect() in dart that allows you to vardump an object.
my barebones example is as follows:
import 'dart:developer';
class User {
String name;
int age;
User(this.name, this.age);
}
void main() {
User newUser = User("Steve", 30);
inspect(newUser);
print('done');
}
I don't get any errors, but all I see in the Debug Console is "done"
On this page there is am image showing inspect() sample output (4th image from the top) in the Debug Console: Link
Is there something else I need to do to make this command work in VS Code?
If I debug the code from VS Code it works for me, although the Dart-Code extension isn't so fast to succeed before the program ending:

If the program doesn't end immediately - it works:
Future<void> main() async {
User newUser = User("Steve", 30);
inspect(newUser);
print('done');
await Future.delayed(Duration(seconds: 2));
print('done');
}

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With