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
645c3231
Commit
645c3231
authored
Dec 10, 2019
by
Sebastian Döll
Committed by
Darren Austin
Dec 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set modal bottom sheet barrier color (#45067)
parent
5469804c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
bottom_sheet.dart
packages/flutter/lib/src/material/bottom_sheet.dart
+5
-1
bottom_sheet_test.dart
packages/flutter/test/material/bottom_sheet_test.dart
+5
-0
No files found.
packages/flutter/lib/src/material/bottom_sheet.dart
View file @
645c3231
...
@@ -344,6 +344,7 @@ class _ModalBottomSheetRoute<T> extends PopupRoute<T> {
...
@@ -344,6 +344,7 @@ class _ModalBottomSheetRoute<T> extends PopupRoute<T> {
this
.
elevation
,
this
.
elevation
,
this
.
shape
,
this
.
shape
,
this
.
clipBehavior
,
this
.
clipBehavior
,
this
.
modalBarrierColor
,
this
.
isDismissible
=
true
,
this
.
isDismissible
=
true
,
@required
this
.
isScrollControlled
,
@required
this
.
isScrollControlled
,
RouteSettings
settings
,
RouteSettings
settings
,
...
@@ -358,6 +359,7 @@ class _ModalBottomSheetRoute<T> extends PopupRoute<T> {
...
@@ -358,6 +359,7 @@ class _ModalBottomSheetRoute<T> extends PopupRoute<T> {
final
double
elevation
;
final
double
elevation
;
final
ShapeBorder
shape
;
final
ShapeBorder
shape
;
final
Clip
clipBehavior
;
final
Clip
clipBehavior
;
final
Color
modalBarrierColor
;
final
bool
isDismissible
;
final
bool
isDismissible
;
@override
@override
...
@@ -370,7 +372,7 @@ class _ModalBottomSheetRoute<T> extends PopupRoute<T> {
...
@@ -370,7 +372,7 @@ class _ModalBottomSheetRoute<T> extends PopupRoute<T> {
final
String
barrierLabel
;
final
String
barrierLabel
;
@override
@override
Color
get
barrierColor
=>
Colors
.
black54
;
Color
get
barrierColor
=>
modalBarrierColor
??
Colors
.
black54
;
AnimationController
_animationController
;
AnimationController
_animationController
;
...
@@ -501,6 +503,7 @@ Future<T> showModalBottomSheet<T>({
...
@@ -501,6 +503,7 @@ Future<T> showModalBottomSheet<T>({
double
elevation
,
double
elevation
,
ShapeBorder
shape
,
ShapeBorder
shape
,
Clip
clipBehavior
,
Clip
clipBehavior
,
Color
barrierColor
,
bool
isScrollControlled
=
false
,
bool
isScrollControlled
=
false
,
bool
useRootNavigator
=
false
,
bool
useRootNavigator
=
false
,
bool
isDismissible
=
true
,
bool
isDismissible
=
true
,
...
@@ -523,6 +526,7 @@ Future<T> showModalBottomSheet<T>({
...
@@ -523,6 +526,7 @@ Future<T> showModalBottomSheet<T>({
shape:
shape
,
shape:
shape
,
clipBehavior:
clipBehavior
,
clipBehavior:
clipBehavior
,
isDismissible:
isDismissible
,
isDismissible:
isDismissible
,
modalBarrierColor:
barrierColor
));
));
}
}
...
...
packages/flutter/test/material/bottom_sheet_test.dart
View file @
645c3231
...
@@ -342,6 +342,7 @@ void main() {
...
@@ -342,6 +342,7 @@ void main() {
const
double
elevation
=
9.0
;
const
double
elevation
=
9.0
;
final
ShapeBorder
shape
=
BeveledRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
12
));
final
ShapeBorder
shape
=
BeveledRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
12
));
const
Clip
clipBehavior
=
Clip
.
antiAlias
;
const
Clip
clipBehavior
=
Clip
.
antiAlias
;
const
Color
barrierColor
=
Colors
.
red
;
await
tester
.
pumpWidget
(
MaterialApp
(
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Scaffold
(
home:
Scaffold
(
...
@@ -353,6 +354,7 @@ void main() {
...
@@ -353,6 +354,7 @@ void main() {
showModalBottomSheet
<
void
>(
showModalBottomSheet
<
void
>(
context:
scaffoldKey
.
currentContext
,
context:
scaffoldKey
.
currentContext
,
backgroundColor:
color
,
backgroundColor:
color
,
barrierColor:
barrierColor
,
elevation:
elevation
,
elevation:
elevation
,
shape:
shape
,
shape:
shape
,
clipBehavior:
clipBehavior
,
clipBehavior:
clipBehavior
,
...
@@ -371,6 +373,9 @@ void main() {
...
@@ -371,6 +373,9 @@ void main() {
expect
(
bottomSheet
.
elevation
,
elevation
);
expect
(
bottomSheet
.
elevation
,
elevation
);
expect
(
bottomSheet
.
shape
,
shape
);
expect
(
bottomSheet
.
shape
,
shape
);
expect
(
bottomSheet
.
clipBehavior
,
clipBehavior
);
expect
(
bottomSheet
.
clipBehavior
,
clipBehavior
);
final
ModalBarrier
modalBarrier
=
tester
.
widget
(
find
.
byType
(
ModalBarrier
).
last
);
expect
(
modalBarrier
.
color
,
barrierColor
);
});
});
testWidgets
(
'modal BottomSheet with scrollController has semantics'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'modal BottomSheet with scrollController has semantics'
,
(
WidgetTester
tester
)
async
{
...
...
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