Dart / Flutter error: 'toStringDeep' isn't defined for the class 'Logger'
When I get this error, I use "flutter clean" and it solves the problem.
I ran into a similar issue, for me It only happens with Android Studio's interface run/debug button. It was working fine with flutter run
command.
But clearing out the build files/cache fixed the issue.
1. Android Studio:
Menu Tool > Flutter > Flutter Clean
2. OR run the command on CLI:
flutter clean
3. Using shortcut
It doesn't have a default key shortcut to run flutter clean, but you can add one easily.
I added ⌘ + H hotkey for flutter clean
. You can define yours. Here is how:
- Open Preferences/Settings.
- Click on Keymap
- Search for flutter clean.
- Right click on
Flutter Clean
and selectAdd Keyboard shortcut
- Add the keyboard short cut you prefer. I added
Command + H
Now you can do it quicker.
alternatively, just remove the build folder.