@@ -498,6 +498,66 @@ void main() {
498498 expect (widthInput, findsNothing);
499499 expect (heightInput, findsNothing);
500500 });
501+
502+ testWidgets ('can filter for only set values' , (tester) async {
503+ // Load the property editor.
504+ await tester.pumpWidget (wrap (propertyEditor));
505+
506+ // Change the editable args.
507+ controller.initForTestsOnly (editableArgsResult: result1);
508+ await tester.pumpAndSettle ();
509+
510+ final titleInput = _findTextFormField ('String? title' );
511+ final widthInput = _findTextFormField ('double width' );
512+ final heightInput = _findTextFormField ('double? height' );
513+
514+ // Verify all inputs are visible.
515+ expect (_findNoPropertiesMessage, findsNothing);
516+ expect (titleInput, findsOneWidget);
517+ expect (widthInput, findsOneWidget);
518+ expect (heightInput, findsOneWidget);
519+
520+ // Filter for only set vaues.
521+ await _setFilter (
522+ 'Only include properties that are set in the code.' ,
523+ tester: tester,
524+ );
525+
526+ // Verify only the "title" and "width" properties are visible.
527+ expect (heightInput, findsNothing);
528+ expect (titleInput, findsOneWidget);
529+ expect (widthInput, findsOneWidget);
530+ });
531+
532+ testWidgets ('can filter for only default values' , (tester) async {
533+ // Load the property editor.
534+ await tester.pumpWidget (wrap (propertyEditor));
535+
536+ // Change the editable args.
537+ controller.initForTestsOnly (editableArgsResult: result1);
538+ await tester.pumpAndSettle ();
539+
540+ final titleInput = _findTextFormField ('String? title' );
541+ final widthInput = _findTextFormField ('double width' );
542+ final heightInput = _findTextFormField ('double? height' );
543+
544+ // Verify all inputs are visible.
545+ expect (_findNoPropertiesMessage, findsNothing);
546+ expect (titleInput, findsOneWidget);
547+ expect (widthInput, findsOneWidget);
548+ expect (heightInput, findsOneWidget);
549+
550+ // Filter for only default vaues.
551+ await _setFilter (
552+ 'Only include properties that match the default value.' ,
553+ tester: tester,
554+ );
555+
556+ // Verify only the "height" property is visible.
557+ expect (heightInput, findsOneWidget);
558+ expect (titleInput, findsNothing);
559+ expect (widthInput, findsNothing);
560+ });
501561 });
502562
503563 group ('editing arguments' , () {
@@ -925,6 +985,30 @@ final _findNoPropertiesMessage = find.text(
925985 'No widget properties at current cursor location.' ,
926986);
927987
988+ Future <void > _setFilter (
989+ String filterSettingText, {
990+ required WidgetTester tester,
991+ }) async {
992+ final filterButtonFinder = find.byType (DevToolsFilterButton );
993+ await tester.tap (filterButtonFinder);
994+ await tester.pumpAndSettle ();
995+
996+ final rowFinder = find.ancestor (
997+ of: find.textContaining (filterSettingText),
998+ matching: find.byType (Row ),
999+ );
1000+ final checkboxFinder = find.descendant (
1001+ of: rowFinder,
1002+ matching: find.byType (NotifierCheckbox ),
1003+ );
1004+ await tester.tap (checkboxFinder);
1005+ await tester.pumpAndSettle ();
1006+
1007+ final applyFilterButtonFinder = find.byType (DialogApplyButton );
1008+ await tester.tap (applyFilterButtonFinder);
1009+ await tester.pumpAndSettle ();
1010+ }
1011+
9281012Finder _findFilterField () => find.descendant (
9291013 of: find.byType (StandaloneFilterField <EditableProperty >),
9301014 matching: find.byType (TextField ),
0 commit comments