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
7e33cd5e
Unverified
Commit
7e33cd5e
authored
Aug 22, 2022
by
Qun Cheng
Committed by
GitHub
Aug 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed leading button size on app bar (#110043)
parent
d79a3d7a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
app_bar.dart
packages/flutter/lib/src/material/app_bar.dart
+10
-5
app_bar_test.dart
packages/flutter/test/material/app_bar_test.dart
+6
-4
No files found.
packages/flutter/lib/src/material/app_bar.dart
View file @
7e33cd5e
...
@@ -998,11 +998,16 @@ class _AppBarState extends State<AppBar> {
...
@@ -998,11 +998,16 @@ class _AppBarState extends State<AppBar> {
}
}
}
}
if
(
leading
!=
null
)
{
if
(
leading
!=
null
)
{
leading
=
Container
(
leading
=
theme
.
useMaterial3
alignment:
Alignment
.
center
,
?
Container
(
constraints:
BoxConstraints
.
tightFor
(
width:
widget
.
leadingWidth
??
_kLeadingWidth
),
alignment:
Alignment
.
center
,
child:
leading
,
constraints:
BoxConstraints
.
tightFor
(
width:
widget
.
leadingWidth
??
_kLeadingWidth
),
);
child:
leading
,
)
:
ConstrainedBox
(
constraints:
BoxConstraints
.
tightFor
(
width:
widget
.
leadingWidth
??
_kLeadingWidth
),
child:
leading
,
);
}
}
Widget
?
title
=
widget
.
title
;
Widget
?
title
=
widget
.
title
;
...
...
packages/flutter/test/material/app_bar_test.dart
View file @
7e33cd5e
...
@@ -694,9 +694,11 @@ void main() {
...
@@ -694,9 +694,11 @@ void main() {
});
});
testWidgets
(
'leading button extends to edge and is square'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'leading button extends to edge and is square'
,
(
WidgetTester
tester
)
async
{
final
ThemeData
themeData
=
ThemeData
(
platform:
TargetPlatform
.
android
);
final
bool
material3
=
themeData
.
useMaterial3
;
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
MaterialApp
(
MaterialApp
(
theme:
ThemeData
(
platform:
TargetPlatform
.
android
)
,
theme:
themeData
,
home:
Scaffold
(
home:
Scaffold
(
appBar:
AppBar
(
appBar:
AppBar
(
title:
const
Text
(
'X'
),
title:
const
Text
(
'X'
),
...
@@ -706,9 +708,9 @@ void main() {
...
@@ -706,9 +708,9 @@ void main() {
),
),
);
);
final
Finder
hamburger
=
find
.
byT
ooltip
(
'Open navigation menu'
);
final
Finder
hamburger
=
find
.
byT
ype
(
IconButton
);
expect
(
tester
.
getTopLeft
(
hamburger
),
const
Offset
(
4.0
,
4.0
)
);
expect
(
tester
.
getTopLeft
(
hamburger
),
material3
?
const
Offset
(
4.0
,
4.0
)
:
Offset
.
zero
);
expect
(
tester
.
getSize
(
hamburger
),
const
Size
(
48.0
,
48
.0
));
expect
(
tester
.
getSize
(
hamburger
),
material3
?
const
Size
(
48.0
,
48.0
)
:
const
Size
(
56.0
,
56
.0
));
});
});
testWidgets
(
'test action is 4dp from edge and 48dp min'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'test action is 4dp from edge and 48dp min'
,
(
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