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
0db47bdd
Unverified
Commit
0db47bdd
authored
Feb 11, 2023
by
Casey Hillers
Committed by
GitHub
Feb 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Fix BottomAppBar & BottomSheet M3 shadow (#119819)" (#120492)
This reverts commit
0a97ef85
.
parent
0346f4b1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
57 deletions
+6
-57
bottom_app_bar.dart
packages/flutter/lib/src/material/bottom_app_bar.dart
+1
-4
bottom_sheet.dart
packages/flutter/lib/src/material/bottom_sheet.dart
+1
-4
bottom_app_bar_test.dart
packages/flutter/test/material/bottom_app_bar_test.dart
+0
-21
bottom_app_bar_theme_test.dart
...ages/flutter/test/material/bottom_app_bar_theme_test.dart
+3
-3
bottom_sheet_test.dart
packages/flutter/test/material/bottom_sheet_test.dart
+1
-25
No files found.
packages/flutter/lib/src/material/bottom_app_bar.dart
View file @
0db47bdd
...
...
@@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart';
import
'package:flutter/widgets.dart'
;
import
'bottom_app_bar_theme.dart'
;
import
'colors.dart'
;
import
'elevation_overlay.dart'
;
import
'material.dart'
;
import
'scaffold.dart'
;
...
...
@@ -178,7 +177,6 @@ class _BottomAppBarState extends State<BottomAppBar> {
final
Color
color
=
widget
.
color
??
babTheme
.
color
??
defaults
.
color
!;
final
Color
surfaceTintColor
=
widget
.
surfaceTintColor
??
babTheme
.
surfaceTintColor
??
defaults
.
surfaceTintColor
!;
final
Color
effectiveColor
=
isMaterial3
?
color
:
ElevationOverlay
.
applyOverlay
(
context
,
color
,
elevation
);
final
Color
?
shadowColor
=
isMaterial3
?
Colors
.
transparent
:
null
;
final
Widget
child
=
Padding
(
padding:
widget
.
padding
??
babTheme
.
padding
??
(
isMaterial3
?
const
EdgeInsets
.
symmetric
(
vertical:
12.0
,
horizontal:
16.0
)
:
EdgeInsets
.
zero
),
...
...
@@ -189,16 +187,15 @@ class _BottomAppBarState extends State<BottomAppBar> {
height:
height
,
child:
PhysicalShape
(
clipper:
clipper
,
elevation:
elevation
,
color:
effectiveColor
,
clipBehavior:
widget
.
clipBehavior
,
elevation:
isMaterial3
?
0
:
elevation
,
child:
Material
(
key:
materialKey
,
type:
isMaterial3
?
MaterialType
.
canvas
:
MaterialType
.
transparency
,
elevation:
elevation
,
color:
isMaterial3
?
effectiveColor
:
null
,
surfaceTintColor:
surfaceTintColor
,
shadowColor:
shadowColor
,
child:
SafeArea
(
child:
child
),
),
),
...
...
packages/flutter/lib/src/material/bottom_sheet.dart
View file @
0db47bdd
...
...
@@ -270,16 +270,14 @@ class _BottomSheetState extends State<BottomSheet> {
@override
Widget
build
(
BuildContext
context
)
{
final
bool
useMaterial3
=
Theme
.
of
(
context
).
useMaterial3
;
final
BottomSheetThemeData
bottomSheetTheme
=
Theme
.
of
(
context
).
bottomSheetTheme
;
final
BottomSheetThemeData
defaults
=
useMaterial3
?
_BottomSheetDefaultsM3
(
context
)
:
const
BottomSheetThemeData
();
final
BottomSheetThemeData
defaults
=
Theme
.
of
(
context
).
useMaterial3
?
_BottomSheetDefaultsM3
(
context
)
:
const
BottomSheetThemeData
();
final
BoxConstraints
?
constraints
=
widget
.
constraints
??
bottomSheetTheme
.
constraints
;
final
Color
?
color
=
widget
.
backgroundColor
??
bottomSheetTheme
.
backgroundColor
??
defaults
.
backgroundColor
;
final
Color
?
surfaceTintColor
=
bottomSheetTheme
.
surfaceTintColor
??
defaults
.
surfaceTintColor
;
final
double
elevation
=
widget
.
elevation
??
bottomSheetTheme
.
elevation
??
defaults
.
elevation
??
0
;
final
ShapeBorder
?
shape
=
widget
.
shape
??
bottomSheetTheme
.
shape
??
defaults
.
shape
;
final
Clip
clipBehavior
=
widget
.
clipBehavior
??
bottomSheetTheme
.
clipBehavior
??
Clip
.
none
;
final
Color
?
shadowColor
=
useMaterial3
?
Colors
.
transparent
:
null
;
Widget
bottomSheet
=
Material
(
key:
_childKey
,
...
...
@@ -288,7 +286,6 @@ class _BottomSheetState extends State<BottomSheet> {
surfaceTintColor:
surfaceTintColor
,
shape:
shape
,
clipBehavior:
clipBehavior
,
shadowColor:
shadowColor
,
child:
NotificationListener
<
DraggableScrollableNotification
>(
onNotification:
extentChanged
,
child:
widget
.
builder
(
context
),
...
...
packages/flutter/test/material/bottom_app_bar_test.dart
View file @
0db47bdd
...
...
@@ -233,27 +233,6 @@ void main() {
expect
(
material
.
color
,
const
Color
(
0xff0000ff
));
});
testWidgets
(
'Shadow color is transparent in Material 3'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
true
,
),
home:
const
Scaffold
(
floatingActionButton:
FloatingActionButton
(
onPressed:
null
,
),
bottomNavigationBar:
BottomAppBar
(
color:
Color
(
0xff0000ff
),
),
),
)
);
final
Material
material
=
tester
.
widget
(
find
.
byType
(
Material
).
at
(
1
));
expect
(
material
.
shadowColor
,
Colors
.
transparent
);
/* no value in Material 2. */
});
testWidgets
(
'dark theme applies an elevation overlay color'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
...
...
packages/flutter/test/material/bottom_app_bar_theme_test.dart
View file @
0db47bdd
...
...
@@ -173,10 +173,10 @@ void main() {
home:
const
Scaffold
(
body:
BottomAppBar
()),
));
final
Material
material
=
tester
.
widget
(
find
.
byType
(
Material
).
at
(
1
)
);
final
PhysicalShape
widget
=
_getBabRenderObject
(
tester
);
expect
(
material
.
color
,
theme
.
colorScheme
.
surface
);
expect
(
material
.
elevation
,
equals
(
3.0
));
expect
(
widget
.
color
,
theme
.
colorScheme
.
surface
);
expect
(
widget
.
elevation
,
equals
(
3.0
));
});
testWidgets
(
'BAB theme overrides surfaceTintColor - M3'
,
(
WidgetTester
tester
)
async
{
...
...
packages/flutter/test/material/bottom_sheet_test.dart
View file @
0db47bdd
...
...
@@ -841,7 +841,7 @@ void main() {
expect
(
modalBarrier
.
color
,
barrierColor
);
});
testWidgets
(
'BottomSheet uses fallback values in ma
terial
3'
,
testWidgets
(
'BottomSheet uses fallback values in ma
retial
3'
,
(
WidgetTester
tester
)
async
{
const
Color
surfaceColor
=
Colors
.
pink
;
const
Color
surfaceTintColor
=
Colors
.
blue
;
...
...
@@ -880,30 +880,6 @@ void main() {
expect
(
material
.
shape
,
defaultShape
);
});
testWidgets
(
'BottomSheet has transparent shadow in material3'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
true
,
),
home:
Scaffold
(
body:
BottomSheet
(
onClosing:
()
{},
builder:
(
BuildContext
context
)
{
return
Container
();
},
),
),
));
final
Material
material
=
tester
.
widget
<
Material
>(
find
.
descendant
(
of:
find
.
byType
(
BottomSheet
),
matching:
find
.
byType
(
Material
),
),
);
expect
(
material
.
shadowColor
,
Colors
.
transparent
);
});
testWidgets
(
'modal BottomSheet with scrollController has semantics'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
final
GlobalKey
<
ScaffoldState
>
scaffoldKey
=
GlobalKey
<
ScaffoldState
>();
...
...
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