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
e10df3c1
Unverified
Commit
e10df3c1
authored
Feb 01, 2020
by
Shi-Hao Hong
Committed by
GitHub
Feb 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Step 1.5 of 3: AboutDialog uses scrollable AlertDialog (#49913)
parent
8600d230
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
23 deletions
+70
-23
about.dart
packages/flutter/lib/src/material/about.dart
+22
-23
about_test.dart
packages/flutter/test/material/about_test.dart
+48
-0
No files found.
packages/flutter/lib/src/material/about.dart
View file @
e10df3c1
...
...
@@ -362,31 +362,29 @@ class AboutDialog extends StatelessWidget {
final
String
version
=
applicationVersion
??
_defaultApplicationVersion
(
context
);
final
Widget
icon
=
applicationIcon
??
_defaultApplicationIcon
(
context
);
return
AlertDialog
(
content:
SingleChildScrollView
(
child:
ListBody
(
children:
<
Widget
>[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
if
(
icon
!=
null
)
IconTheme
(
data:
Theme
.
of
(
context
).
iconTheme
,
child:
icon
),
Expanded
(
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
24.0
),
child:
ListBody
(
children:
<
Widget
>[
Text
(
name
,
style:
Theme
.
of
(
context
).
textTheme
.
headline5
),
Text
(
version
,
style:
Theme
.
of
(
context
).
textTheme
.
bodyText2
),
Container
(
height:
18.0
),
Text
(
applicationLegalese
??
''
,
style:
Theme
.
of
(
context
).
textTheme
.
caption
),
],
),
content:
ListBody
(
children:
<
Widget
>[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
if
(
icon
!=
null
)
IconTheme
(
data:
Theme
.
of
(
context
).
iconTheme
,
child:
icon
),
Expanded
(
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
24.0
),
child:
ListBody
(
children:
<
Widget
>[
Text
(
name
,
style:
Theme
.
of
(
context
).
textTheme
.
headline5
),
Text
(
version
,
style:
Theme
.
of
(
context
).
textTheme
.
bodyText2
),
Container
(
height:
18.0
),
Text
(
applicationLegalese
??
''
,
style:
Theme
.
of
(
context
).
textTheme
.
caption
),
],
),
),
]
,
)
,
...?
children
,
]
,
)
,
)
,
]
,
)
,
...?
children
,
]
,
),
actions:
<
Widget
>[
FlatButton
(
...
...
@@ -408,6 +406,7 @@ class AboutDialog extends StatelessWidget {
},
),
],
scrollable:
true
,
);
}
}
...
...
packages/flutter/test/material/about_test.dart
View file @
e10df3c1
...
...
@@ -469,6 +469,54 @@ void main() {
findsNothing
,
);
});
testWidgets
(
"AboutDialog's contents are scrollable"
,
(
WidgetTester
tester
)
async
{
final
Key
contentKey
=
UniqueKey
();
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Navigator
(
onGenerateRoute:
(
RouteSettings
settings
)
{
return
MaterialPageRoute
<
dynamic
>(
builder:
(
BuildContext
context
)
{
return
RaisedButton
(
onPressed:
()
{
showAboutDialog
(
context:
context
,
useRootNavigator:
false
,
applicationName:
'A'
,
children:
<
Widget
>[
Container
(
key:
contentKey
,
color:
Colors
.
orange
,
height:
500
,
),
],
);
},
child:
const
Text
(
'Show About Dialog'
),
);
},
);
},
),
));
await
tester
.
tap
(
find
.
text
(
'Show About Dialog'
));
await
tester
.
pumpAndSettle
();
// Try dragging by the [AboutDialog]'s title.
RenderBox
box
=
tester
.
renderObject
(
find
.
text
(
'A'
));
Offset
originalOffset
=
box
.
localToGlobal
(
Offset
.
zero
);
await
tester
.
drag
(
find
.
byKey
(
contentKey
),
const
Offset
(
0.0
,
-
20.0
));
expect
(
box
.
localToGlobal
(
Offset
.
zero
),
equals
(
originalOffset
.
translate
(
0.0
,
-
20.0
)));
// Try dragging by the additional children in contents.
box
=
tester
.
renderObject
(
find
.
byKey
(
contentKey
));
originalOffset
=
box
.
localToGlobal
(
Offset
.
zero
);
await
tester
.
drag
(
find
.
byKey
(
contentKey
),
const
Offset
(
0.0
,
-
20.0
));
expect
(
box
.
localToGlobal
(
Offset
.
zero
),
equals
(
originalOffset
.
translate
(
0.0
,
-
20.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