zubairehman / flutter_boilerplate_project

A boilerplate project created in flutter using MobX and Provider.
http://zubairehman.surge.sh/
MIT License
2.26k stars 908 forks source link

Build_runner compile error #61

Closed Jojoooo1 closed 4 years ago

Jojoooo1 commented 4 years ago

Hi,

Firstly thanks a lot for your boilerplate really nice setup!

I recently came across this error with new version of mobx would you advise any solution ?

`Failed to precompile build_runner:build_runner: ../../../Android/flutter/.pub-cache/hosted/pub.dartlang.org/dart_style-1.2.3/lib/src/source_visitor.dart:1051:25: Error: Type 'ForEachStatement' not found. visitForEachStatement(ForEachStatement node) { ^^^^^^^^^^^^^^^^ ../../../Android/flutter/.pub-cache/hosted/pub.dartlang.org/dart_style-1.2.3/lib/src/source_visitor.dart:1605:19: Error: Type 'MapLiteral' not found. visitMapLiteral(MapLiteral node) { ^^^^^^^^^^ ../../../Android/flutter/.pub-cache/hosted/pub.dartlang.org/dart_style-1.2.3/lib/src/source_visitor.dart:1837:19: Error: Type 'SetLiteral' not found. visitSetLiteral(SetLiteral node) { ^^^^^^^^^^ ../../../Android/flutter/.pub-cache/hosted/pub.dartlang.org/dart_style-1.2.3/lib/src/source_visitor.dart:506:23: Error: 'MapLiteral' isn't a type. if (expression is MapLiteral) return false; ^^^^^^^^^^ ../../../Android/flutter/.pub-cache/hosted/pub.dartlang.org/dart_style-1.2.3/lib/src/source_visitor.dart:1051:25: Error: 'ForEachStatement' isn't a type. visitForEachStatement(ForEachStatement node) { ^^^^^^^^^^^^^^^^ ../../../Android/flutter/.pub-cache/hosted/pub.dartlang.org/dart_style-1.2.3/lib/src/source_visitor.dart:1218:14: Error: The getter 'initialization' isn't defined for the class 'ForStatement'.

Jojoooo1 commented 4 years ago

Solved bumping inject.dart and changing var parsedLibrary = element.library.session.getParsedLibraryByElement(element.library); in context.dart