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
c7814d69
Unverified
Commit
c7814d69
authored
Aug 10, 2019
by
Shi-Hao Hong
Committed by
GitHub
Aug 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add dense property to AboutListTile (#37882)
parent
821602ae
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
about.dart
packages/flutter/lib/src/material/about.dart
+12
-2
about_test.dart
packages/flutter/test/material/about_test.dart
+20
-0
No files found.
packages/flutter/lib/src/material/about.dart
View file @
c7814d69
...
...
@@ -48,6 +48,7 @@ class AboutListTile extends StatelessWidget {
this
.
applicationIcon
,
this
.
applicationLegalese
,
this
.
aboutBoxChildren
,
this
.
dense
,
})
:
super
(
key:
key
);
/// The icon to show for this drawer item.
...
...
@@ -106,14 +107,23 @@ class AboutListTile extends StatelessWidget {
/// Defaults to nothing.
final
List
<
Widget
>
aboutBoxChildren
;
/// Whether this list tile is part of a vertically dense list.
///
/// If this property is null, then its value is based on [ListTileTheme.dense].
///
/// Dense list tiles default to a smaller height.
final
bool
dense
;
@override
Widget
build
(
BuildContext
context
)
{
assert
(
debugCheckHasMaterial
(
context
));
assert
(
debugCheckHasMaterialLocalizations
(
context
));
return
ListTile
(
leading:
icon
,
title:
child
??
Text
(
MaterialLocalizations
.
of
(
context
).
aboutListTileTitle
(
applicationName
??
_defaultApplicationName
(
context
))),
title:
child
??
Text
(
MaterialLocalizations
.
of
(
context
).
aboutListTileTitle
(
applicationName
??
_defaultApplicationName
(
context
),
)),
dense:
dense
,
onTap:
()
{
showAboutDialog
(
context:
context
,
...
...
packages/flutter/test/material/about_test.dart
View file @
c7814d69
...
...
@@ -285,6 +285,26 @@ void main() {
);
expect
(
find
.
text
(
'flutter_tester'
),
findsOneWidget
);
});
testWidgets
(
'AboutListTile dense property is applied'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
Material
(
child:
Center
(
child:
AboutListTile
())),
));
Rect
tileRect
=
tester
.
getRect
(
find
.
byType
(
AboutListTile
));
expect
(
tileRect
.
height
,
56.0
);
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
Material
(
child:
Center
(
child:
AboutListTile
(
dense:
false
))),
));
tileRect
=
tester
.
getRect
(
find
.
byType
(
AboutListTile
));
expect
(
tileRect
.
height
,
56.0
);
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
Material
(
child:
Center
(
child:
AboutListTile
(
dense:
true
))),
));
tileRect
=
tester
.
getRect
(
find
.
byType
(
AboutListTile
));
expect
(
tileRect
.
height
,
48.0
);
});
}
class
FakeLicenseEntry
extends
LicenseEntry
{
...
...
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