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
7d1842bf
Unverified
Commit
7d1842bf
authored
Aug 12, 2020
by
Jason C.H
Committed by
GitHub
Aug 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate iOS13 style ActivityIndicator (#62741)
parent
6b2ef0df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
59 deletions
+18
-59
activity_indicator.dart
packages/flutter/lib/src/cupertino/activity_indicator.dart
+16
-4
activity_indicator_test.dart
packages/flutter/test/cupertino/activity_indicator_test.dart
+2
-55
No files found.
packages/flutter/lib/src/cupertino/activity_indicator.dart
View file @
7d1842bf
...
...
@@ -21,6 +21,10 @@ const Color _kActiveTickColor = CupertinoDynamicColor.withBrightness(
/// Define the iOS version style of [CupertinoActivityIndicator].
enum
CupertinoActivityIndicatorIOSVersionStyle
{
/// The style that is used in iOS13 and earlier (12 points).
@Deprecated
(
'Use iOS14 instead. '
'This feature was deprecated after v1.21.0-1.0.pre.'
)
iOS13
,
/// The style that was introduced in iOS14 (8 points).
...
...
@@ -40,7 +44,11 @@ class CupertinoActivityIndicator extends StatefulWidget {
Key
key
,
this
.
animating
=
true
,
this
.
radius
=
_kDefaultIndicatorRadius
,
this
.
iOSVersionStyle
=
CupertinoActivityIndicatorIOSVersionStyle
.
iOS13
,
@Deprecated
(
'Leave this field default to use latest style. '
'This feature was deprecated after v1.21.0-1.0.pre.'
)
this
.
iOSVersionStyle
=
CupertinoActivityIndicatorIOSVersionStyle
.
iOS14
,
})
:
assert
(
animating
!=
null
),
assert
(
radius
!=
null
),
assert
(
radius
>
0.0
),
...
...
@@ -57,7 +65,11 @@ class CupertinoActivityIndicator extends StatefulWidget {
Key
key
,
this
.
radius
=
_kDefaultIndicatorRadius
,
this
.
progress
=
1.0
,
this
.
iOSVersionStyle
=
CupertinoActivityIndicatorIOSVersionStyle
.
iOS13
,
@Deprecated
(
'Leave this field default to use latest style. '
'This feature was deprecated after v1.21.0-1.0.pre.'
)
this
.
iOSVersionStyle
=
CupertinoActivityIndicatorIOSVersionStyle
.
iOS14
,
})
:
assert
(
radius
!=
null
),
assert
(
radius
>
0.0
),
assert
(
progress
!=
null
),
...
...
@@ -86,8 +98,8 @@ class CupertinoActivityIndicator extends StatefulWidget {
/// The iOS version style of activity indicator.
///
/// Defaults to [CupertinoActivityIndicatorIOSVersionStyle.iOS1
3
].
// TODO(ctrysbita):
Change default style to iOS14 after official release, https://github.com/flutter/flutter/issues/60047
/// Defaults to [CupertinoActivityIndicatorIOSVersionStyle.iOS1
4
].
// TODO(ctrysbita):
Deprecate after official release, https://github.com/flutter/flutter/issues/62521
final
CupertinoActivityIndicatorIOSVersionStyle
iOSVersionStyle
;
@override
...
...
packages/flutter/test/cupertino/activity_indicator_test.dart
View file @
7d1842bf
...
...
@@ -77,60 +77,6 @@ void main() {
);
});
testWidgets
(
'Activity indicator with iOS14 style'
,
(
WidgetTester
tester
)
async
{
final
Key
key
=
UniqueKey
();
await
tester
.
pumpWidget
(
Center
(
child:
MediaQuery
(
data:
const
MediaQueryData
(
platformBrightness:
Brightness
.
light
),
child:
RepaintBoundary
(
key:
key
,
child:
Container
(
color:
CupertinoColors
.
white
,
child:
const
CupertinoActivityIndicator
(
animating:
false
,
radius:
35
,
iOSVersionStyle:
CupertinoActivityIndicatorIOSVersionStyle
.
iOS14
,
),
),
),
),
),
);
await
expectLater
(
find
.
byKey
(
key
),
matchesGoldenFile
(
'activityIndicator.iOS14.paused.light.png'
),
);
await
tester
.
pumpWidget
(
Center
(
child:
MediaQuery
(
data:
const
MediaQueryData
(
platformBrightness:
Brightness
.
dark
),
child:
RepaintBoundary
(
key:
key
,
child:
Container
(
color:
CupertinoColors
.
black
,
child:
const
CupertinoActivityIndicator
(
animating:
false
,
radius:
35
,
iOSVersionStyle:
CupertinoActivityIndicatorIOSVersionStyle
.
iOS14
,
),
),
),
),
),
);
await
expectLater
(
find
.
byKey
(
key
),
matchesGoldenFile
(
'activityIndicator.iOS14.paused.dark.png'
),
);
});
testWidgets
(
'Activity indicator 0% in progress'
,
(
WidgetTester
tester
)
async
{
final
Key
key
=
UniqueKey
();
await
tester
.
pumpWidget
(
...
...
@@ -209,7 +155,8 @@ void main() {
// first tick was changed to be at 12 o'clock.
expect
(
find
.
byType
(
CupertinoActivityIndicator
),
paints
..
rrect
(
rrect:
const
RRect
.
fromLTRBXY
(-
10
,
-
50
,
10
,
-
100
,
10
,
10
)),
paints
..
rrect
(
rrect:
const
RRect
.
fromLTRBXY
(-
10
,
-
100
/
3
,
10
,
-
100
,
10
,
10
)),
);
});
}
...
...
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