skip to Main Content

Flutter – Dart Freezed package: Missing toJson method in generated file causing InvalidType error

I followed the documentation's step by step to add Freezed to a class: import 'package:freezed_annotation/freezed_annotation.dart'; part 'autonomy_event.freezed.dart'; part 'autonomy_event.g.dart'; @freezed class AutonomyEvent with _$AutonomyEvent { const factory AutonomyEvent({ required int eventCode, required int timestamp, }) = _AutonomyEvent; factory AutonomyEvent.fromJson(Map<String, dynamic>…

VIEW QUESTION

Flutter isar with freezed throws Unsupported type error while build runner

While using isar with freezed, getting Unsupported type error for copyWith getter method while build runner. Here is the model class for which the build_runner is failing. import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:isar/isar.dart'; part 'api_response_model.freezed.dart'; part 'api_response_model.g.dart'; @collection @freezed class ApiResponseModel with…

VIEW QUESTION
Back To Top
Search