Mobx.dart: toString() generates warning

Created on 17 May 2020  路  4Comments  路  Source: mobxjs/mobx.dart

With new toString() feature, I'm getting a warning:
"Avoid using braces in interpolation when not needed." warning. Here's how the generated toString() looks:
@override
String toString() {
return '''
extraToastInfo: ${extraToastInfo}
''';
}

Occurs on all my Store classes, thus it adds 80+ warnings to Problems window, which makes it difficult to spot other kind of warnings.

Please either fix the code generation or provide us a way to disable toString globally.
Thanks!

enhancement

Most helpful comment

If someone wants to remove this warning in the meanwhile, you can disable it editing the analysis_options.yaml and excluding all generated code.

analyzer:
  exclude: [lib/**/*.g.dart]

All 4 comments

Same here!

If someone wants to remove this warning in the meanwhile, you can disable it editing the analysis_options.yaml and excluding all generated code.

analyzer:
  exclude: [lib/**/*.g.dart]

@neokree even adding an empty analysis_options.yaml removes brace warnings!

This has been fixed in a PR (#518). Will be published this week.

Was this page helpful?
0 / 5 - 0 ratings