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
4ae5252f
Unverified
Commit
4ae5252f
authored
Feb 15, 2023
by
Kate Lovett
Committed by
GitHub
Feb 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix license page crash (#120728)
parent
911b1378
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
1 deletion
+66
-1
about.dart
packages/flutter/lib/src/material/about.dart
+5
-1
about_test.dart
packages/flutter/test/material/about_test.dart
+61
-0
No files found.
packages/flutter/lib/src/material/about.dart
View file @
4ae5252f
...
@@ -889,7 +889,11 @@ class _PackageLicensePageState extends State<_PackageLicensePage> {
...
@@ -889,7 +889,11 @@ class _PackageLicensePageState extends State<_PackageLicensePage> {
// A Scrollbar is built-in below.
// A Scrollbar is built-in below.
behavior:
ScrollConfiguration
.
of
(
context
).
copyWith
(
scrollbars:
false
),
behavior:
ScrollConfiguration
.
of
(
context
).
copyWith
(
scrollbars:
false
),
child:
Scrollbar
(
child:
Scrollbar
(
child:
ListView
(
padding:
padding
,
children:
listWidgets
),
child:
ListView
(
primary:
true
,
padding:
padding
,
children:
listWidgets
,
),
),
),
),
),
),
),
...
...
packages/flutter/test/material/about_test.dart
View file @
4ae5252f
...
@@ -913,6 +913,67 @@ void main() {
...
@@ -913,6 +913,67 @@ void main() {
},
variant:
TargetPlatformVariant
.
all
());
},
variant:
TargetPlatformVariant
.
all
());
testWidgets
(
'ListView of license entries is primary'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/120710
LicenseRegistry
.
addLicense
(()
{
return
Stream
<
LicenseEntry
>.
fromIterable
(<
LicenseEntry
>[
LicenseEntryWithLineBreaks
(
<
String
>[
'AAA'
],
// Add enough content to scroll
List
<
String
>.
generate
(
500
,
(
int
index
)
=>
'BBBB'
).
join
(
'
\n
'
),
),
]);
});
await
tester
.
pumpWidget
(
MaterialApp
(
title:
'Flutter Code Sample'
,
home:
Scaffold
(
body:
Builder
(
builder:
(
BuildContext
context
)
=>
TextButton
(
child:
const
Text
(
'Show License Page'
),
onPressed:
()
{
showLicensePage
(
context:
context
);
},
),
),
),
)
);
await
tester
.
pumpAndSettle
();
expect
(
find
.
text
(
'Show License Page'
),
findsOneWidget
);
await
tester
.
tap
(
find
.
text
(
'Show License Page'
));
await
tester
.
pumpAndSettle
();
// Check for packages.
expect
(
find
.
text
(
'AAA'
),
findsOneWidget
);
// Check license is displayed after entering into license page for 'AAA'.
await
tester
.
tap
(
find
.
text
(
'AAA'
));
await
tester
.
pumpAndSettle
();
// The inherited ScrollBehavior should not apply Scrollbars since they are
// already built in to the widget.
switch
(
debugDefaultTargetPlatformOverride
)
{
case
TargetPlatform
.
android
:
case
TargetPlatform
.
fuchsia
:
case
TargetPlatform
.
linux
:
case
TargetPlatform
.
macOS
:
case
TargetPlatform
.
windows
:
expect
(
find
.
byType
(
CupertinoScrollbar
),
findsNothing
);
break
;
case
TargetPlatform
.
iOS
:
expect
(
find
.
byType
(
CupertinoScrollbar
),
findsOneWidget
);
break
;
case
null
:
break
;
}
expect
(
find
.
byType
(
Scrollbar
),
findsOneWidget
);
expect
(
find
.
byType
(
RawScrollbar
),
findsNothing
);
await
tester
.
drag
(
find
.
byType
(
ListView
),
const
Offset
(
0.0
,
20.0
));
await
tester
.
pumpAndSettle
();
// No exception triggered.
},
variant:
TargetPlatformVariant
.
all
());
testWidgets
(
'LicensePage padding'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'LicensePage padding'
,
(
WidgetTester
tester
)
async
{
const
FlutterLogo
logo
=
FlutterLogo
();
const
FlutterLogo
logo
=
FlutterLogo
();
...
...
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