@@ -166,6 +166,34 @@ void main() {
166166 expect (checkbox2.value, false );
167167 expect (checkbox3.value, true );
168168 });
169+ testWidgets (
170+ 'Should not dirty when didChange receives a list matching initial contents' ,
171+ (WidgetTester tester) async {
172+ const fieldName = 'cbg1' ;
173+ final testWidget = FormBuilderCheckboxGroup <int >(
174+ name: fieldName,
175+ options: const [
176+ FormBuilderFieldOption (key: ValueKey ('1' ), value: 1 ),
177+ FormBuilderFieldOption (key: ValueKey ('2' ), value: 2 ),
178+ FormBuilderFieldOption (key: ValueKey ('3' ), value: 3 ),
179+ ],
180+ );
181+ await tester.pumpWidget (
182+ buildTestableFieldWidget (
183+ testWidget,
184+ initialValue: const {fieldName: [1 , 3 ]},
185+ ),
186+ );
187+
188+ final state = formKey.currentState? .fields[fieldName];
189+ expect (state? .isDirty, false );
190+
191+ formFieldDidChange (fieldName, [1 , 3 ]);
192+ await tester.pumpAndSettle ();
193+
194+ expect (state? .isDirty, false );
195+ },
196+ );
169197 testWidgets ('When press tab, field will be focused' , (
170198 WidgetTester tester,
171199 ) async {
0 commit comments