@@ -39,10 +39,14 @@ void main() {
3939 ),
4040 );
4141
42+ // Write an input resulting in a null value after transformation
43+ formFieldDidChange (testWidgetName, 'a' );
44+ expect (formInstantValue (testWidgetName), isNull);
45+
4246 // Write an input and test the transformer
4347 formFieldDidChange (testWidgetName, '1' );
44- expect (int , formInstantValue (testWidgetName).runtimeType);
45- expect (1 , formInstantValue (testWidgetName));
48+ expect (formInstantValue (testWidgetName).runtimeType, int );
49+ expect (formInstantValue (testWidgetName), 1 );
4650
4751 // Remove the dynamic field from the widget tree
4852 final _DynamicFormFieldsState dynamicFieldState =
@@ -54,17 +58,17 @@ void main() {
5458
5559 // With the field unregistered, the form does not have its transformer
5660 // but it still has its value, now recovered as type String
57- expect (String , formInstantValue (testWidgetName).runtimeType);
58- expect ('1' , formInstantValue (testWidgetName));
61+ expect (formInstantValue (testWidgetName).runtimeType, String );
62+ expect (formInstantValue (testWidgetName), '1' );
5963
6064 // Show and recreate the field's state
6165 dynamicFieldState.show = true ;
6266 await tester.pump ();
6367
6468 // The transformer is registered again and with the internal value that
6569 // was kept, it's expected an int of value 1
66- expect (int , formInstantValue (testWidgetName).runtimeType);
67- expect (1 , formInstantValue (testWidgetName));
70+ expect (formInstantValue (testWidgetName).runtimeType, int );
71+ expect (formInstantValue (testWidgetName), 1 );
6872 },
6973 );
7074
@@ -102,8 +106,8 @@ void main() {
102106
103107 // With the field unregistered, the form does not have its transformer,
104108 // and since the value was cleared, neither its value
105- expect (Null , formInstantValue (testWidgetName).runtimeType);
106- expect (null , formInstantValue (testWidgetName));
109+ expect (formInstantValue (testWidgetName).runtimeType, Null );
110+ expect (formInstantValue (testWidgetName), isNull );
107111
108112 // Show and recreate the field's state
109113 dynamicFieldState.show = true ;
@@ -112,8 +116,8 @@ void main() {
112116 // A new input is needed to get another value
113117 formFieldDidChange (testWidgetName, '2' );
114118 await tester.pump ();
115- expect (int , formInstantValue (testWidgetName).runtimeType);
116- expect (2 , formInstantValue (testWidgetName));
119+ expect (formInstantValue (testWidgetName).runtimeType, int );
120+ expect (formInstantValue (testWidgetName), 2 );
117121 },
118122 );
119123 });
0 commit comments