Hi.
I'm having the same problem of #133, the model.g.dart it is not generating.
Using the sample code:
import 'package:freezed_annotation/freezed_annotation.dart';
part 'model.freezed.dart';
part 'model.g.dart';
@freezed
abstract class Model with _$Model {
factory Model.first(String a) = First;
factory Model.second(int b, bool c) = Second;
factory Model.fromJson(Map<String, dynamic> json) => _$ModelFromJson(json);
}
All packages are updated to the latest version:
dependencies:
flutter:
sdk: flutter
freezed_annotation: ^0.7.1
json_annotation: ^3.0.1
dev_dependencies:
flutter_test:
sdk: flutter
build_runner: ^1.9.0
freezed: ^0.10.7
json_serializable: ^3.3.0
@pblinux Delete pubspec.lock file then run 'flutter pub get' and then run again build_runner.
Thank you @malcolmpl, that was weird but solved it.
@pblinux Delete pubspec.lock file then run 'flutter pub get' and then run again build_runner.
Solved my issue, too!
Didn't work for me and I am about to lose my mind馃槂
Most helpful comment
@pblinux Delete pubspec.lock file then run 'flutter pub get' and then run again build_runner.