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
1ca84e60
Unverified
Commit
1ca84e60
authored
May 21, 2021
by
Abhishek Ghaskata
Committed by
GitHub
May 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor layers example (#83070)
parent
cce5e3aa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
28 deletions
+15
-28
isolate.dart
examples/layers/services/isolate.dart
+8
-15
spinning_square.dart
examples/layers/widgets/spinning_square.dart
+7
-13
No files found.
examples/layers/services/isolate.dart
View file @
1ca84e60
...
@@ -210,21 +210,14 @@ class IsolateExampleState extends State<StatefulWidget> with SingleTickerProvide
...
@@ -210,21 +210,14 @@ class IsolateExampleState extends State<StatefulWidget> with SingleTickerProvide
String
_label
=
'Start'
;
String
_label
=
'Start'
;
String
_result
=
' '
;
String
_result
=
' '
;
double
_progress
=
0.0
;
double
_progress
=
0.0
;
late
AnimationController
_animation
;
late
final
AnimationController
_animation
=
AnimationController
(
late
CalculationManager
_calculationManager
;
@override
void
initState
()
{
super
.
initState
();
_animation
=
AnimationController
(
duration:
const
Duration
(
milliseconds:
3600
),
duration:
const
Duration
(
milliseconds:
3600
),
vsync:
this
,
vsync:
this
,
)..
repeat
();
)..
repeat
();
_calculationManager
=
CalculationManager
(
late
final
CalculationManager
_calculationManager
=
CalculationManager
(
onProgressListener:
_handleProgressUpdate
,
onProgressListener:
_handleProgressUpdate
,
onResultListener:
_handleResult
,
onResultListener:
_handleResult
,
);
);
}
@override
@override
void
dispose
()
{
void
dispose
()
{
...
...
examples/layers/widgets/spinning_square.dart
View file @
1ca84e60
...
@@ -12,19 +12,13 @@ class SpinningSquare extends StatefulWidget {
...
@@ -12,19 +12,13 @@ class SpinningSquare extends StatefulWidget {
}
}
class
_SpinningSquareState
extends
State
<
SpinningSquare
>
with
SingleTickerProviderStateMixin
{
class
_SpinningSquareState
extends
State
<
SpinningSquare
>
with
SingleTickerProviderStateMixin
{
late
AnimationController
_animation
;
@override
void
initState
()
{
super
.
initState
();
// We use 3600 milliseconds instead of 1800 milliseconds because 0.0 -> 1.0
// We use 3600 milliseconds instead of 1800 milliseconds because 0.0 -> 1.0
// represents an entire turn of the square whereas in the other examples
// represents an entire turn of the square whereas in the other examples
// we used 0.0 -> math.pi, which is only half a turn.
// we used 0.0 -> math.pi, which is only half a turn.
_animation
=
AnimationController
(
late
final
AnimationController
_animation
=
AnimationController
(
duration:
const
Duration
(
milliseconds:
3600
),
duration:
const
Duration
(
milliseconds:
3600
),
vsync:
this
,
vsync:
this
,
)..
repeat
();
)..
repeat
();
}
@override
@override
void
dispose
()
{
void
dispose
()
{
...
...
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