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
f4dee5c6
Unverified
Commit
f4dee5c6
authored
Apr 28, 2021
by
Darren Austin
Committed by
GitHub
Apr 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed ProgressIndicatorTheme.wrap() to just return a new ProgressIndicatorTheme. (#81359)
parent
f6726b42
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
progress_indicator_theme.dart
...es/flutter/lib/src/material/progress_indicator_theme.dart
+1
-2
progress_indicator_test.dart
packages/flutter/test/material/progress_indicator_test.dart
+31
-0
No files found.
packages/flutter/lib/src/material/progress_indicator_theme.dart
View file @
f4dee5c6
...
...
@@ -177,8 +177,7 @@ class ProgressIndicatorTheme extends InheritedTheme {
@override
Widget
wrap
(
BuildContext
context
,
Widget
child
)
{
final
ProgressIndicatorTheme
?
ancestorTheme
=
context
.
findAncestorWidgetOfExactType
<
ProgressIndicatorTheme
>();
return
identical
(
this
,
ancestorTheme
)
?
child
:
ProgressIndicatorTheme
(
data:
data
,
child:
child
);
return
ProgressIndicatorTheme
(
data:
data
,
child:
child
);
}
@override
...
...
packages/flutter/test/material/progress_indicator_test.dart
View file @
f4dee5c6
...
...
@@ -826,4 +826,35 @@ void main() {
TargetPlatform
.
linux
,
}),
);
testWidgets
(
'ProgressIndicatorTheme.wrap() always creates a new ProgressIndicatorTheme'
,
(
WidgetTester
tester
)
async
{
late
BuildContext
builderContext
;
const
ProgressIndicatorThemeData
themeData
=
ProgressIndicatorThemeData
(
color:
Color
(
0xFFFF0000
),
linearTrackColor:
Color
(
0xFF00FF00
),
);
final
ProgressIndicatorTheme
progressTheme
=
ProgressIndicatorTheme
(
data:
themeData
,
child:
Builder
(
builder:
(
BuildContext
context
)
{
builderContext
=
context
;
return
const
LinearProgressIndicator
(
value:
0.5
);
}
),
);
await
tester
.
pumpWidget
(
MaterialApp
(
home:
progressTheme
,
));
final
Widget
wrappedTheme
=
progressTheme
.
wrap
(
builderContext
,
Container
());
// Make sure the returned widget is a new ProgressIndicatorTheme instance
// with the same theme data as the original.
expect
(
wrappedTheme
,
isNot
(
equals
(
progressTheme
)));
expect
(
wrappedTheme
,
isInstanceOf
<
ProgressIndicatorTheme
>());
expect
((
wrappedTheme
as
ProgressIndicatorTheme
).
data
,
themeData
);
});
}
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