Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
7d950864
Unverified
Commit
7d950864
authored
Jun 14, 2023
by
Qun Cheng
Committed by
GitHub
Jun 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update golden tests for material (#128839)
parent
ed3d4630
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
64 additions
and
37 deletions
+64
-37
snack_bar.dart
packages/flutter/lib/src/material/snack_bar.dart
+6
-5
dropdown_menu_test.dart
packages/flutter/test/material/dropdown_menu_test.dart
+1
-1
icon_button_test.dart
packages/flutter/test/material/icon_button_test.dart
+1
-1
ink_sparkle_test.dart
packages/flutter/test/material/ink_sparkle_test.dart
+1
-0
input_decorator_test.dart
packages/flutter/test/material/input_decorator_test.dart
+2
-0
material_test.dart
packages/flutter/test/material/material_test.dart
+2
-0
page_test.dart
packages/flutter/test/material/page_test.dart
+1
-0
progress_indicator_test.dart
packages/flutter/test/material/progress_indicator_test.dart
+12
-6
radio_list_tile_test.dart
packages/flutter/test/material/radio_list_tile_test.dart
+1
-1
snack_bar_test.dart
packages/flutter/test/material/snack_bar_test.dart
+25
-16
text_field_test.dart
packages/flutter/test/material/text_field_test.dart
+12
-7
No files found.
packages/flutter/lib/src/material/snack_bar.dart
View file @
7d950864
...
...
@@ -842,11 +842,12 @@ class _SnackbarDefaultsM2 extends SnackBarThemeData {
@override
TextStyle
?
get
contentTextStyle
=>
ThemeData
(
brightness:
_theme
.
brightness
==
Brightness
.
light
?
Brightness
.
dark
:
Brightness
.
light
)
.
textTheme
.
titleMedium
;
useMaterial3:
_theme
.
useMaterial3
,
brightness:
_theme
.
brightness
==
Brightness
.
light
?
Brightness
.
dark
:
Brightness
.
light
)
.
textTheme
.
titleMedium
;
@override
SnackBarBehavior
get
behavior
=>
SnackBarBehavior
.
fixed
;
...
...
packages/flutter/test/material/dropdown_menu_test.dart
View file @
7d950864
...
...
@@ -112,7 +112,7 @@ void main() {
testWidgets
(
'The width of the text field should always be the same as the menu view'
,
(
WidgetTester
tester
)
async
{
final
ThemeData
themeData
=
ThemeData
();
final
ThemeData
themeData
=
ThemeData
(
useMaterial3:
false
);
final
bool
useMaterial3
=
themeData
.
useMaterial3
;
await
tester
.
pumpWidget
(
MaterialApp
(
...
...
packages/flutter/test/material/icon_button_test.dart
View file @
7d950864
...
...
@@ -789,7 +789,7 @@ void main() {
await
tester
.
pumpWidget
(
wrap
(
useMaterial3:
theme
.
useMaterial3
,
useMaterial3:
false
,
child:
Column
(
children:
<
Widget
>[
IconButton
(
...
...
packages/flutter/test/material/ink_sparkle_test.dart
View file @
7d950864
...
...
@@ -116,6 +116,7 @@ Future<void> _runTest(WidgetTester tester, String positionName, double distanceF
final
Key
buttonKey
=
UniqueKey
();
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
false
),
home:
Scaffold
(
body:
Center
(
child:
RepaintBoundary
(
...
...
packages/flutter/test/material/input_decorator_test.dart
View file @
7d950864
...
...
@@ -4488,6 +4488,7 @@ void main() {
// This is a regression test for https://github.com/flutter/flutter/issues/82321
Widget
buildFrame
(
TextDirection
textDirection
)
{
return
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
false
),
home:
Scaffold
(
body:
Container
(
padding:
const
EdgeInsets
.
all
(
16.0
),
...
...
@@ -4536,6 +4537,7 @@ void main() {
Widget
buildFrame
(
TextDirection
textDirection
)
{
return
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
false
),
home:
Scaffold
(
body:
Container
(
padding:
const
EdgeInsets
.
all
(
16.0
),
...
...
packages/flutter/test/material/material_test.dart
View file @
7d950864
...
...
@@ -924,6 +924,7 @@ void main() {
final
Key
painterKey
=
UniqueKey
();
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
false
),
home:
Scaffold
(
body:
RepaintBoundary
(
key:
painterKey
,
...
...
@@ -962,6 +963,7 @@ void main() {
final
Key
painterKey
=
UniqueKey
();
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
false
),
home:
Scaffold
(
body:
RepaintBoundary
(
key:
painterKey
,
...
...
packages/flutter/test/material/page_test.dart
View file @
7d950864
...
...
@@ -252,6 +252,7 @@ void main() {
RepaintBoundary
(
key:
key
,
child:
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
false
),
onGenerateRoute:
(
RouteSettings
settings
)
{
return
MaterialPageRoute
<
void
>(
builder:
(
BuildContext
context
)
{
...
...
packages/flutter/test/material/progress_indicator_test.dart
View file @
7d950864
...
...
@@ -723,7 +723,10 @@ void main() {
final
AnimationSheetBuilder
animationSheet
=
AnimationSheetBuilder
(
frameSize:
const
Size
(
50
,
50
));
await
tester
.
pumpFrames
(
animationSheet
.
record
(
const
_RefreshProgressIndicatorGolden
(),
Theme
(
data:
ThemeData
(
useMaterial3:
false
),
child:
const
_RefreshProgressIndicatorGolden
()
),
),
const
Duration
(
seconds:
3
));
await
expectLater
(
...
...
@@ -1001,11 +1004,14 @@ void main() {
final
AnimationSheetBuilder
animationSheet
=
AnimationSheetBuilder
(
frameSize:
const
Size
(
40
,
40
));
await
tester
.
pumpFrames
(
animationSheet
.
record
(
const
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Padding
(
padding:
EdgeInsets
.
all
(
4
),
child:
CircularProgressIndicator
(),
Theme
(
data:
ThemeData
(
useMaterial3:
false
),
child:
const
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Padding
(
padding:
EdgeInsets
.
all
(
4
),
child:
CircularProgressIndicator
(),
),
),
),
),
const
Duration
(
seconds:
2
));
...
...
packages/flutter/test/material/radio_list_tile_test.dart
View file @
7d950864
...
...
@@ -1101,7 +1101,7 @@ void main() {
return
null
;
}
final
ThemeData
theme
=
ThemeData
();
final
ThemeData
theme
=
ThemeData
(
useMaterial3:
false
);
final
bool
material3
=
theme
.
useMaterial3
;
Widget
buildRadio
({
bool
active
=
false
,
bool
useOverlay
=
true
})
{
return
wrap
(
...
...
packages/flutter/test/material/snack_bar_test.dart
View file @
7d950864
...
...
@@ -2155,8 +2155,9 @@ void main() {
});
testWidgets
(
'SnackBars should be shown above the bottomSheet'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
Scaffold
(
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
false
),
home:
const
Scaffold
(
bottomSheet:
SizedBox
(
width:
200
,
height:
50
,
...
...
@@ -2238,6 +2239,7 @@ void main() {
testWidgets
(
'ScaffoldMessenger presents SnackBars to only the root Scaffold when Scaffolds are nested.'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
false
),
home:
Scaffold
(
body:
const
Scaffold
(),
floatingActionButton:
FloatingActionButton
(
onPressed:
()
{}),
...
...
@@ -2439,6 +2441,7 @@ void main() {
testWidgets
(
'Snackbar by default clips BackdropFilter'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/98205
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
false
),
home:
Scaffold
(
body:
const
Scaffold
(),
floatingActionButton:
FloatingActionButton
(
onPressed:
()
{}),
...
...
@@ -2469,8 +2472,9 @@ void main() {
});
testWidgets
(
'Floating snackbar can display optional icon'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
Scaffold
(
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
false
),
home:
const
Scaffold
(
bottomSheet:
SizedBox
(
width:
200
,
height:
50
,
...
...
@@ -2500,8 +2504,9 @@ void main() {
});
testWidgets
(
'Fixed width snackbar can display optional icon'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
Scaffold
(
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
false
),
home:
const
Scaffold
(
bottomSheet:
SizedBox
(
width:
200
,
height:
50
,
...
...
@@ -2526,8 +2531,9 @@ void main() {
});
testWidgets
(
'Fixed snackbar can display optional icon without action'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
Scaffold
(
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
false
),
home:
const
Scaffold
(
bottomSheet:
SizedBox
(
width:
200
,
height:
50
,
...
...
@@ -2554,8 +2560,9 @@ void main() {
testWidgets
(
'Floating width snackbar can display optional icon without action'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
Scaffold
(
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
false
),
home:
const
Scaffold
(
bottomSheet:
SizedBox
(
width:
200
,
height:
50
,
...
...
@@ -2580,8 +2587,9 @@ void main() {
});
testWidgets
(
'Floating multi-line snackbar with icon is aligned correctly'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
Scaffold
(
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
false
),
home:
const
Scaffold
(
bottomSheet:
SizedBox
(
width:
200
,
height:
50
,
...
...
@@ -2607,8 +2615,9 @@ void main() {
});
testWidgets
(
'Floating multi-line snackbar with icon and actionOverflowThreshold=1 is aligned correctly'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
Scaffold
(
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
false
),
home:
const
Scaffold
(
bottomSheet:
SizedBox
(
width:
200
,
height:
50
,
...
...
@@ -2627,10 +2636,10 @@ void main() {
behavior:
SnackBarBehavior
.
floating
,
actionOverflowThreshold:
1
,
));
await
tester
.
pumpAndSettle
();
// Have the SnackBar fully animate
out
.
await
tester
.
pumpAndSettle
();
// Have the SnackBar fully animate
in
.
await
expectLater
(
find
.
byType
(
MaterialApp
),
matchesGoldenFile
(
'snack_bar.goldenTest.multiLineWithIconWithZeroActionOverflowThreshold.png'
));
matchesGoldenFile
(
'snack_bar.goldenTest.multiLineWithIconWithZeroActionOverflowThreshold.png'
));
});
testWidgets
(
...
...
packages/flutter/test/material/text_field_test.dart
View file @
7d950864
...
...
@@ -918,13 +918,16 @@ void main() {
});
testWidgets
(
'Material cursor golden'
,
(
WidgetTester
tester
)
async
{
final
Widget
widget
=
overlay
(
child:
const
RepaintBoundary
(
key:
ValueKey
<
int
>(
1
),
child:
TextField
(
cursorColor:
Colors
.
blue
,
cursorWidth:
15
,
cursorRadius:
Radius
.
circular
(
3.0
),
final
Widget
widget
=
Theme
(
data:
ThemeData
(
useMaterial3:
false
),
child:
overlay
(
child:
const
RepaintBoundary
(
key:
ValueKey
<
int
>(
1
),
child:
TextField
(
cursorColor:
Colors
.
blue
,
cursorWidth:
15
,
cursorRadius:
Radius
.
circular
(
3.0
),
),
),
),
);
...
...
@@ -1095,6 +1098,7 @@ void main() {
);
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
false
),
home:
Material
(
child:
Center
(
child:
RepaintBoundary
(
...
...
@@ -1143,6 +1147,7 @@ void main() {
);
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
false
),
home:
Material
(
child:
Center
(
child:
RepaintBoundary
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment