You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generated code for this has a lot of static analysis issues:
Dart analyze output
error login_form_model.gform.dart:284:43 • A value of type 'Map<String, dynamic>' can't be returned from the function 'domainErrors' because it has a return type of 'Map<String, Object>'. • return_of_invalid_type
error • login_form_model.gform.dart:286:45 • A value of type 'Map<String, dynamic>' can't be returned from the function
'usernameErrors' because it has a return type of 'Map<String, Object>'. • return_of_invalid_type
error • login_form_model.gform.dart:288:45 • A value of type 'Map<String, dynamic>' can't be returned from the function
'passwordErrors' because it has a return type of 'Map<String, Object>'. • return_of_invalid_type
error • login_form_model.gform.dart:290:47 • A value of type 'Map<String, dynamic>' can't be returned from the function 'rememberMeErrors' because it has a return type of 'Map<String, Object>'. • return_of_invalid_type
error • login_form_model.gform.dart:540:19 • The method 'updateInitial' isn't defined for the type 'FormModel'. Try correcting the name to the name of an existing method, or defining a method named 'updateInitial'. • undefined_method
Using reactive_forms_annotations: ^8.1.0-beta2 removes the undefined_method error atleast. But the type errors stay. I need to manually change the return type to Map<String, dynamic> for all fields
My model class
The generated code for this has a lot of static analysis issues:
Dart analyze output
error login_form_model.gform.dart:284:43 • A value of type 'Map<String, dynamic>' can't be returned from the function 'domainErrors' because it has a return type of 'Map<String, Object>'. • return_of_invalid_type
error • login_form_model.gform.dart:286:45 • A value of type 'Map<String, dynamic>' can't be returned from the function
'usernameErrors' because it has a return type of 'Map<String, Object>'. • return_of_invalid_type
error • login_form_model.gform.dart:288:45 • A value of type 'Map<String, dynamic>' can't be returned from the function
'passwordErrors' because it has a return type of 'Map<String, Object>'. • return_of_invalid_type
error • login_form_model.gform.dart:290:47 • A value of type 'Map<String, dynamic>' can't be returned from the function 'rememberMeErrors' because it has a return type of 'Map<String, Object>'. • return_of_invalid_type
error • login_form_model.gform.dart:540:19 • The method 'updateInitial' isn't defined for the type 'FormModel'. Try correcting the name to the name of an existing method, or defining a method named 'updateInitial'. • undefined_method
I cannot build my application anymore.
Flutter version
Flutter 3.38.5 • channel stable • https://github.com/flutter/flutter.git Framework • revision f6ff1529fd (4 weeks ago) • 2025-12-11 11:50:07 -0500 Engine • hash c108a94d7a8273e112339e6c6833daa06e723a54 (revision 1527ae0ec5) (24 days ago) • 2025-12-11 15:04:31.000Z Tools • Dart 3.10.4 • DevTools 2.51.1
Package version
Note
Using reactive_forms_annotations: ^8.1.0-beta2 removes the
undefined_methoderror atleast. But the type errors stay. I need to manually change the return type toMap<String, dynamic>for all fields