Closed andrelrf1 closed 10 months ago
Same issue here, on our case, it puts "InvalidType" instead of "AppLifecycleState" or "Size".
Same issue here, with type AppLocalizations
from the package I10n import 'package:flutter_gen/gen_l10n/app_localizations.dart';
@andrelrf1 @ulisseshen @Heatclift
This is not a bug in mobx, but depending on your code, build_runner may not work. In my experience, I've had no problems using the libraries mentioned above. I can't help you without reproducible source code.
See below to help you resolve the issue.
https://github.com/dart-lang/build/blob/master/build_config/README.md#adjusting-builder-ordering https://github.com/dart-lang/build/issues/2701 https://github.com/trevorwang/retrofit.dart/issues/578
For anyone coming across this issue who does not get the - relatively sparse - docs about adjusting the build order, add this to your build.yaml file:
global_options:
json_serializable:json_serializable:
runs_before:
- mobx_codegen:mobx_generator
Replace the reference to json_serialization with the package and builder you are using.
@ulisseshen https://github.com/FlutterGen/flutter_gen/blob/main/packages/runner/build.yaml
global_options:
flutter_gen_runner:
runs_before:
- mobx_codegen:mobx_generator
Thanks guys, this really worked! Sorry for the delay in responding.
I think we should make a guide for this on the website...can you please make a short PR for this ? 💯
I started to make a desktop flutter application that needs to access data from a sqlite database with drift, but while doing state management with mobx I realized that the type generated by drift was never recognized by mobx, where instead of the correct type was placed InvalidType. This can be fixed manually, just by replacing the type in the generated file, but as the application grows it is becoming unfeasible to make these changes, because every time we run build_runner the automatically generated files are updated and all changes made manually are lost. Is there any solution to this?