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
6cc6e7e1
Commit
6cc6e7e1
authored
Feb 26, 2019
by
lsaudon
Committed by
Hans Muller
Feb 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add shapeBorder option on App Bar (#21834)
parent
ec00e974
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
app_bar.dart
packages/flutter/lib/src/material/app_bar.dart
+8
-0
app_bar_test.dart
packages/flutter/test/material/app_bar_test.dart
+29
-0
No files found.
packages/flutter/lib/src/material/app_bar.dart
View file @
6cc6e7e1
...
...
@@ -150,6 +150,7 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget {
this
.
flexibleSpace
,
this
.
bottom
,
this
.
elevation
,
this
.
shape
,
this
.
backgroundColor
,
this
.
brightness
,
this
.
iconTheme
,
...
...
@@ -286,6 +287,12 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget {
/// for app bars.
final
double
elevation
;
/// The material's shape as well its shadow.
///
/// A shadow is only displayed if the [elevation] is greater than
/// zero.
final
ShapeBorder
shape
;
/// The color to use for the app bar's material. Typically this should be set
/// along with [brightness], [iconTheme], [textTheme].
///
...
...
@@ -583,6 +590,7 @@ class _AppBarState extends State<AppBar> {
elevation:
widget
.
elevation
??
appBarTheme
.
elevation
??
_defaultElevation
,
shape:
widget
.
shape
,
child:
Semantics
(
explicitChildNodes:
true
,
child:
appBar
,
...
...
packages/flutter/test/material/app_bar_test.dart
View file @
6cc6e7e1
...
...
@@ -1485,4 +1485,33 @@ void main() {
await
gesture
.
up
();
await
tester
.
pump
();
});
testWidgets
(
'AppBar with shape'
,
(
WidgetTester
tester
)
async
{
const
RoundedRectangleBorder
roundedRectangleBorder
=
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
15.0
)));
await
tester
.
pumpWidget
(
MaterialApp
(
home:
AppBar
(
leading:
const
Text
(
'L'
),
title:
const
Text
(
'No Scaffold'
),
shape:
roundedRectangleBorder
,
actions:
const
<
Widget
>[
Text
(
'A1'
),
Text
(
'A2'
)],
),
),
);
final
Finder
appBarFinder
=
find
.
byType
(
AppBar
);
AppBar
getAppBarWidget
()
{
return
tester
.
widget
<
AppBar
>(
appBarFinder
);
}
expect
(
getAppBarWidget
().
shape
,
roundedRectangleBorder
);
final
Finder
materialFinder
=
find
.
byType
(
Material
);
Material
getMaterialWidget
()
{
return
tester
.
widget
<
Material
>(
materialFinder
);
}
expect
(
getMaterialWidget
().
shape
,
roundedRectangleBorder
);
});
}
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