Skip to content

Commit f9ff834

Browse files
authored
Add more tests for dart fixes (flutter#90291)
1 parent 30f0944 commit f9ff834

File tree

12 files changed

+268
-6
lines changed

12 files changed

+268
-6
lines changed

packages/flutter/test_fixes/cupertino.dart

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ void main() {
1212
Object object;
1313

1414
// Change made in https://github.com/flutter/flutter/pull/41859
15-
const CupertinoTextThemeData themeData = CupertinoTextThemeData(brightness: Brightness.dark);
15+
CupertinoTextThemeData themeData = CupertinoTextThemeData(brightness: Brightness.dark);
1616
themeData.copyWith(brightness: Brightness.light);
17+
themeData = CupertinoTextThemeData(error: '');
18+
themeData.copyWith(error: '');
1719

1820
// Changes made in https://github.com/flutter/flutter/pull/44189
1921
const Element element = Element(myWidget);
@@ -47,98 +49,127 @@ void main() {
4749
// Changes made in https://github.com/flutter/flutter/pull/66305
4850
const Stack stack = Stack(overflow: Overflow.visible);
4951
const Stack stack = Stack(overflow: Overflow.clip);
52+
const Stack stack = Stack(error: '');
5053
final behavior = stack.overflow;
5154

5255
// Changes made in https://github.com/flutter/flutter/pull/61648
5356
const Form form = Form(autovalidate: true);
5457
const Form form = Form(autovalidate: false);
58+
const Form form = Form(error: '');
5559
final autoMode = form.autovalidate;
5660

5761
// Changes made in https://github.com/flutter/flutter/pull/61648
5862
const FormField formField = FormField(autovalidate: true);
5963
const FormField formField = FormField(autovalidate: false);
64+
const FormField formField = FormField(error: '');
6065
final autoMode = formField.autovalidate;
6166

6267
// Changes made in https://github.com/flutter/flutter/pull/68736
6368
MediaQuery.of(context, nullOk: true);
6469
MediaQuery.of(context, nullOk: false);
70+
MediaQuery.of(error: '');
6571

6672
// Changes made in https://github.com/flutter/flutter/pull/70726
6773
Navigator.of(context, nullOk: true);
6874
Navigator.of(context, nullOk: false);
75+
Navigator.of(error: '');
6976

7077
// Changes made in https://github.com/flutter/flutter/pull/68910
7178
Router.of(context, nullOk: true);
7279
Router.of(context, nullOk: false);
80+
Router.of(error: '');
7381

7482
// Changes made in https://github.com/flutter/flutter/pull/68911
7583
Localizations.localeOf(context, nullOk: true);
7684
Localizations.localeOf(context, nullOk: false);
85+
Localizations.localeOf(error: '');
7786

7887
// Changes made in https://github.com/flutter/flutter/pull/68917
7988
FocusTraversalOrder.of(context, nullOk: true);
8089
FocusTraversalOrder.of(context, nullOk: false);
90+
FocusTraversalOrder.of(error: '');
91+
FocusTraversalGroup.of(error: '');
8192
FocusTraversalGroup.of(context, nullOk: true);
8293
FocusTraversalGroup.of(context, nullOk: false);
8394
Focus.of(context, nullOk: true);
8495
Focus.of(context, nullOk: false);
96+
Focus.of(error: '');
8597

8698
// Changes made in https://github.com/flutter/flutter/pull/68921
8799
Shortcuts.of(context, nullOk: true);
88100
Shortcuts.of(context, nullOk: false);
101+
Shortcuts.of(error: '');
102+
Actions.find(error: '');
89103
Actions.find(context, nullOk: true);
90104
Actions.find(context, nullOk: false);
91105
Actions.handler(context, nullOk: true);
92106
Actions.handler(context, nullOk: false);
107+
Actions.handler(error: '');
108+
Actions.invoke(error: '');
93109
Actions.invoke(context, nullOk: true);
94110
Actions.invoke(context, nullOk: false);
95111

96112
// Changes made in https://github.com/flutter/flutter/pull/68925
97113
AnimatedList.of(context, nullOk: true);
98114
AnimatedList.of(context, nullOk: false);
115+
AnimatedList.of(error: '');
116+
SliverAnimatedList.of(error: '');
99117
SliverAnimatedList.of(context, nullOk: true);
100118
SliverAnimatedList.of(context, nullOk: false);
101119

102120
// Changes made in https://github.com/flutter/flutter/pull/68905
103121
CupertinoDynamicColor.resolve(Color(0), context, nullOk: true);
104122
CupertinoDynamicColor.resolve(Color(0), context, nullOk: false);
123+
CupertinoDynamicColor.resolve(error: '');
124+
CupertinoDynamicColor.resolveFrom(error: '');
105125
CupertinoDynamicColor.resolveFrom(context, nullOk: true);
106126
CupertinoDynamicColor.resolveFrom(context, nullOk: false);
107127
CupertinoUserInterfaceLevel.of(context, nullOk: true);
108128
CupertinoUserInterfaceLevel.of(context, nullOk: false);
129+
CupertinoUserInterfaceLevel.of(error: '');
109130

110131
// Changes made in https://github.com/flutter/flutter/pull/68736
111132
CupertinoTheme.brightnessOf(context, nullOk: true);
112133
CupertinoTheme.brightnessOf(context, nullOk: false);
134+
CupertinoTheme.brightnessOf(error: '');
113135

114136
// Changes made in https://github.com/flutter/flutter/pull/68905
115137
CupertinoThemeData.resolveFrom(context, nullOk: true);
116138
CupertinoThemeData.resolveFrom(context, nullOk: false);
139+
CupertinoThemeData.resolveFrom(error: '');
140+
NoDefaultCupertinoThemeData.resolveFrom(error: '');
117141
NoDefaultCupertinoThemeData.resolveFrom(context, nullOk: true);
118142
NoDefaultCupertinoThemeData.resolveFrom(context, nullOk: false);
119143
CupertinoTextThemeData.resolveFrom(context, nullOk: true);
120144
CupertinoTextThemeData.resolveFrom(context, nullOk: false);
145+
CupertinoTextThemeData.resolveFrom(error: '');
121146

122147
// Changes made in https://github.com/flutter/flutter/pull/72043
123148
CupertinoTextField(maxLengthEnforced: true);
124149
CupertinoTextField(maxLengthEnforced: false);
150+
CupertinoTextField(error: '');
151+
CupertinoTextField.borderless(error: '');
125152
CupertinoTextField.borderless(maxLengthEnforced: true);
126153
CupertinoTextField.borderless(maxLengthEnforced: false);
127154
final CupertinoTextField textField;
128155
textField.maxLengthEnforced;
129156

130157
// Changes made in https://github.com/flutter/flutter/pull/59127
131158
const BottomNavigationBarItem bottomNavigationBarItem = BottomNavigationBarItem(title: myTitle);
159+
const BottomNavigationBarItem bottomNavigationBarItem = BottomNavigationBarItem();
160+
const BottomNavigationBarItem bottomNavigationBarItem = BottomNavigationBarItem(error: '');
132161
bottomNavigationBarItem.title;
133162

134163
// Changes made in https://github.com/flutter/flutter/pull/79160
135164
Draggable draggable = Draggable();
165+
draggable = Draggable(error: '');
136166
draggable = Draggable(dragAnchor: DragAnchor.child);
137167
draggable = Draggable(dragAnchor: DragAnchor.pointer);
138168
draggable.dragAnchor;
139169

140170
// Changes made in https://github.com/flutter/flutter/pull/79160
141171
LongPressDraggable longPressDraggable = LongPressDraggable();
172+
longPressDraggable = LongPressDraggable(error: '');
142173
longPressDraggable = LongPressDraggable(dragAnchor: DragAnchor.child);
143174
longPressDraggable = LongPressDraggable(dragAnchor: DragAnchor.pointer);
144175
longPressDraggable.dragAnchor;
@@ -173,16 +204,20 @@ void main() {
173204
ListWheelScrollView listWheelScrollView = ListWheelScrollView();
174205
listWheelScrollView = ListWheelScrollView(clipToSize: true);
175206
listWheelScrollView = ListWheelScrollView(clipToSize: false);
207+
listWheelScrollView = ListWheelScrollView(error: '');
176208
listWheelScrollView = ListWheelScrollView.useDelegate();
177209
listWheelScrollView = ListWheelScrollView.useDelegate(clipToSize: true);
178210
listWheelScrollView = ListWheelScrollView.useDelegate(clipToSize: false);
211+
listWheelScrollView = ListWheelScrollView.useDelegate(error: '');
179212
listWheelScrollView.clipToSize;
180213
ListWheelViewport listWheelViewport = ListWheelViewport();
181214
listWheelViewport = ListWheelViewport(clipToSize: true);
182215
listWheelViewport = ListWheelViewport(clipToSize: false);
216+
listWheelViewport = ListWheelViewport(error: '');
183217
listWheelViewport.clipToSize;
184218

185219
// Changes made in https://github.com/flutter/flutter/pull/87839
186-
final OverscrollIndicatorNotification notification = OverscrollIndicatorNotification(leading: true);
220+
OverscrollIndicatorNotification notification = OverscrollIndicatorNotification(leading: true);
221+
notification = OverscrollIndicatorNotification(error: '');
187222
notification.disallowGlow();
188223
}

packages/flutter/test_fixes/cupertino.dart.expect

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ void main() {
1212
Object object;
1313

1414
// Change made in https://github.com/flutter/flutter/pull/41859
15-
const CupertinoTextThemeData themeData = CupertinoTextThemeData();
15+
CupertinoTextThemeData themeData = CupertinoTextThemeData();
1616
themeData.copyWith();
17+
themeData = CupertinoTextThemeData(error: '');
18+
themeData.copyWith(error: '');
1719

1820
// Changes made in https://github.com/flutter/flutter/pull/44189
1921
const Element element = Element(myWidget);
@@ -47,98 +49,127 @@ void main() {
4749
// Changes made in https://github.com/flutter/flutter/pull/66305
4850
const Stack stack = Stack(clipBehavior: Clip.none);
4951
const Stack stack = Stack(clipBehavior: Clip.hardEdge);
52+
const Stack stack = Stack(error: '');
5053
final behavior = stack.clipBehavior;
5154

5255
// Changes made in https://github.com/flutter/flutter/pull/61648
5356
const Form form = Form(autovalidateMode: AutovalidateMode.always);
5457
const Form form = Form(autovalidateMode: AutovalidateMode.disabled);
58+
const Form form = Form(error: '');
5559
final autoMode = form.autovalidateMode;
5660

5761
// Changes made in https://github.com/flutter/flutter/pull/61648
5862
const FormField formField = FormField(autovalidateMode: AutovalidateMode.always);
5963
const FormField formField = FormField(autovalidateMode: AutovalidateMode.disabled);
64+
const FormField formField = FormField(error: '');
6065
final autoMode = formField.autovalidateMode;
6166

6267
// Changes made in https://github.com/flutter/flutter/pull/68736
6368
MediaQuery.maybeOf(context);
6469
MediaQuery.of(context);
70+
MediaQuery.of(error: '');
6571

6672
// Changes made in https://github.com/flutter/flutter/pull/70726
6773
Navigator.maybeOf(context);
6874
Navigator.of(context);
75+
Navigator.of(error: '');
6976

7077
// Changes made in https://github.com/flutter/flutter/pull/68910
7178
Router.maybeOf(context);
7279
Router.of(context);
80+
Router.of(error: '');
7381

7482
// Changes made in https://github.com/flutter/flutter/pull/68911
7583
Localizations.maybeLocaleOf(context);
7684
Localizations.localeOf(context);
85+
Localizations.localeOf(error: '');
7786

7887
// Changes made in https://github.com/flutter/flutter/pull/68917
7988
FocusTraversalOrder.maybeOf(context);
8089
FocusTraversalOrder.of(context);
90+
FocusTraversalOrder.of(error: '');
91+
FocusTraversalGroup.of(error: '');
8192
FocusTraversalGroup.maybeOf(context);
8293
FocusTraversalGroup.of(context);
8394
Focus.maybeOf(context);
8495
Focus.of(context);
96+
Focus.of(error: '');
8597

8698
// Changes made in https://github.com/flutter/flutter/pull/68921
8799
Shortcuts.maybeOf(context);
88100
Shortcuts.of(context);
101+
Shortcuts.of(error: '');
102+
Actions.find(error: '');
89103
Actions.maybeFind(context);
90104
Actions.find(context);
91105
Actions.handler(context);
92106
Actions.handler(context);
107+
Actions.handler(error: '');
108+
Actions.invoke(error: '');
93109
Actions.maybeInvoke(context);
94110
Actions.invoke(context);
95111

96112
// Changes made in https://github.com/flutter/flutter/pull/68925
97113
AnimatedList.maybeOf(context);
98114
AnimatedList.of(context);
115+
AnimatedList.of(error: '');
116+
SliverAnimatedList.of(error: '');
99117
SliverAnimatedList.maybeOf(context);
100118
SliverAnimatedList.of(context);
101119

102120
// Changes made in https://github.com/flutter/flutter/pull/68905
103121
CupertinoDynamicColor.maybeResolve(Color(0), context);
104122
CupertinoDynamicColor.resolve(Color(0), context);
123+
CupertinoDynamicColor.resolve(error: '');
124+
CupertinoDynamicColor.resolveFrom(error: '');
105125
CupertinoDynamicColor.resolveFrom(context);
106126
CupertinoDynamicColor.resolveFrom(context);
107127
CupertinoUserInterfaceLevel.maybeOf(context);
108128
CupertinoUserInterfaceLevel.of(context);
129+
CupertinoUserInterfaceLevel.of(error: '');
109130

110131
// Changes made in https://github.com/flutter/flutter/pull/68736
111132
CupertinoTheme.maybeBrightnessOf(context);
112133
CupertinoTheme.brightnessOf(context);
134+
CupertinoTheme.brightnessOf(error: '');
113135

114136
// Changes made in https://github.com/flutter/flutter/pull/68905
115137
CupertinoThemeData.resolveFrom(context);
116138
CupertinoThemeData.resolveFrom(context);
139+
CupertinoThemeData.resolveFrom(error: '');
140+
NoDefaultCupertinoThemeData.resolveFrom(error: '');
117141
NoDefaultCupertinoThemeData.resolveFrom(context);
118142
NoDefaultCupertinoThemeData.resolveFrom(context);
119143
CupertinoTextThemeData.resolveFrom(context);
120144
CupertinoTextThemeData.resolveFrom(context);
145+
CupertinoTextThemeData.resolveFrom(error: '');
121146

122147
// Changes made in https://github.com/flutter/flutter/pull/72043
123148
CupertinoTextField(maxLengthEnforcement: MaxLengthEnforcement.enforce);
124149
CupertinoTextField(maxLengthEnforcement: MaxLengthEnforcement.none);
150+
CupertinoTextField(error: '');
151+
CupertinoTextField.borderless(error: '');
125152
CupertinoTextField.borderless(maxLengthEnforcement: MaxLengthEnforcement.enforce);
126153
CupertinoTextField.borderless(maxLengthEnforcement: MaxLengthEnforcement.none);
127154
final CupertinoTextField textField;
128155
textField.maxLengthEnforcement;
129156

130157
// Changes made in https://github.com/flutter/flutter/pull/59127
131158
const BottomNavigationBarItem bottomNavigationBarItem = BottomNavigationBarItem(label: myTitle);
159+
const BottomNavigationBarItem bottomNavigationBarItem = BottomNavigationBarItem();
160+
const BottomNavigationBarItem bottomNavigationBarItem = BottomNavigationBarItem(error: '');
132161
bottomNavigationBarItem.label;
133162

134163
// Changes made in https://github.com/flutter/flutter/pull/79160
135164
Draggable draggable = Draggable();
165+
draggable = Draggable(error: '');
136166
draggable = Draggable(dragAnchorStrategy: childDragAnchorStrategy);
137167
draggable = Draggable(dragAnchorStrategy: pointerDragAnchorStrategy);
138168
draggable.dragAnchorStrategy;
139169

140170
// Changes made in https://github.com/flutter/flutter/pull/79160
141171
LongPressDraggable longPressDraggable = LongPressDraggable();
172+
longPressDraggable = LongPressDraggable(error: '');
142173
longPressDraggable = LongPressDraggable(dragAnchorStrategy: childDragAnchorStrategy);
143174
longPressDraggable = LongPressDraggable(dragAnchorStrategy: pointerDragAnchorStrategy);
144175
longPressDraggable.dragAnchorStrategy;
@@ -173,16 +204,20 @@ void main() {
173204
ListWheelScrollView listWheelScrollView = ListWheelScrollView();
174205
listWheelScrollView = ListWheelScrollView(clipBehavior: Clip.hardEdge);
175206
listWheelScrollView = ListWheelScrollView(clipBehavior: Clip.none);
207+
listWheelScrollView = ListWheelScrollView(error: '');
176208
listWheelScrollView = ListWheelScrollView.useDelegate();
177209
listWheelScrollView = ListWheelScrollView.useDelegate(clipBehavior: Clip.hardEdge);
178210
listWheelScrollView = ListWheelScrollView.useDelegate(clipBehavior: Clip.none);
211+
listWheelScrollView = ListWheelScrollView.useDelegate(error: '');
179212
listWheelScrollView.clipBehavior;
180213
ListWheelViewport listWheelViewport = ListWheelViewport();
181214
listWheelViewport = ListWheelViewport(clipBehavior: Clip.hardEdge);
182215
listWheelViewport = ListWheelViewport(clipBehavior: Clip.none);
216+
listWheelViewport = ListWheelViewport(error: '');
183217
listWheelViewport.clipBehavior;
184218

185219
// Changes made in https://github.com/flutter/flutter/pull/87839
186-
final OverscrollIndicatorNotification notification = OverscrollIndicatorNotification(leading: true);
220+
OverscrollIndicatorNotification notification = OverscrollIndicatorNotification(leading: true);
221+
notification = OverscrollIndicatorNotification(error: '');
187222
notification.disallowIndicator();
188223
}

packages/flutter/test_fixes/gestures.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,40 +14,58 @@ void main() {
1414
// Changes made in https://github.com/flutter/flutter/pull/66043
1515
VelocityTracker tracker = VelocityTracker();
1616
tracker = VelocityTracker(PointerDeviceKind.mouse);
17+
tracker = VelocityTracker(error: '');
1718

1819
// Changes made in https://github.com/flutter/flutter/pull/81858
1920
DragGestureRecognizer();
2021
DragGestureRecognizer(kind: PointerDeviceKind.touch);
22+
DragGestureRecognizer(error: '');
2123
VerticalDragGestureRecognizer();
2224
VerticalDragGestureRecognizer(kind: PointerDeviceKind.touch);
25+
VerticalDragGestureRecognizer(error: '');
2326
HorizontalDragGestureRecognizer();
2427
HorizontalDragGestureRecognizer(kind: PointerDeviceKind.touch);
28+
HorizontalDragGestureRecognizer(error: '');
2529
GestureRecognizer();
2630
GestureRecognizer(kind: PointerDeviceKind.touch);
31+
GestureRecognizer(error: '');
2732
OneSequenceGestureRecognizer();
2833
OneSequenceGestureRecognizer(kind: PointerDeviceKind.touch);
34+
OneSequenceGestureRecognizer(error: '');
2935
PrimaryPointerGestureRecognizer();
3036
PrimaryPointerGestureRecognizer(kind: PointerDeviceKind.touch);
37+
PrimaryPointerGestureRecognizer(error: '');
3138
EagerGestureRecognizer();
3239
EagerGestureRecognizer(kind: PointerDeviceKind.touch);
40+
EagerGestureRecognizer(error: '');
3341
ForcePressGestureRecognizer();
3442
ForcePressGestureRecognizer(kind: PointerDeviceKind.touch);
43+
ForcePressGestureRecognizer(error: '');
3544
LongPressGestureRecognizer();
3645
LongPressGestureRecognizer(kind: PointerDeviceKind.touch);
46+
LongPressGestureRecognizer(error: '');
3747
MultiDragGestureRecognizer();
3848
MultiDragGestureRecognizer(kind: PointerDeviceKind.touch);
49+
MultiDragGestureRecognizer(error: '');
3950
ImmediateMultiDragGestureRecognizer();
4051
ImmediateMultiDragGestureRecognizer(kind: PointerDeviceKind.touch);
52+
ImmediateMultiDragGestureRecognizer(error: '');
4153
HorizontalMultiDragGestureRecognizer();
4254
HorizontalMultiDragGestureRecognizer(kind: PointerDeviceKind.touch);
55+
HorizontalMultiDragGestureRecognizer(error: '');
4356
VerticalMultiDragGestureRecognizer();
4457
VerticalMultiDragGestureRecognizer(kind: PointerDeviceKind.touch);
58+
VerticalMultiDragGestureRecognizer(error: '');
4559
DelayedMultiDragGestureRecognizer();
4660
DelayedMultiDragGestureRecognizer(kind: PointerDeviceKind.touch);
61+
DelayedMultiDragGestureRecognizer(error: '');
4762
DoubleTapGestureRecognizer();
4863
DoubleTapGestureRecognizer(kind: PointerDeviceKind.touch);
64+
DoubleTapGestureRecognizer(error: '');
4965
MultiTapGestureRecognizer();
5066
MultiTapGestureRecognizer(kind: PointerDeviceKind.touch);
67+
MultiTapGestureRecognizer(error: '');
5168
ScaleGestureRecognizer();
5269
ScaleGestureRecognizer(kind: PointerDeviceKind.touch);
70+
ScaleGestureRecognizer(error: '');
5371
}

0 commit comments

Comments
 (0)