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
492e311c
Unverified
Commit
492e311c
authored
Jan 29, 2018
by
amirh
Committed by
GitHub
Jan 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a manual test app for animated icons (#14272)
parent
0c010283
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
90 additions
and
0 deletions
+90
-0
animated_icons.dart
dev/manual_tests/lib/animated_icons.dart
+90
-0
No files found.
dev/manual_tests/lib/animated_icons.dart
0 → 100644
View file @
492e311c
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/material.dart'
;
class
AnimatedIconsTestApp
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
new
MaterialApp
(
title:
'Animated Icons Test'
,
home:
const
Scaffold
(
body:
const
IconsList
(),
),
);
}
}
class
IconsList
extends
StatelessWidget
{
const
IconsList
();
@override
Widget
build
(
BuildContext
context
)
{
return
new
ListView
(
children:
samples
.
map
((
IconSample
s
)
=>
new
IconSampleRow
(
s
)).
toList
(),
);
}
}
class
IconSampleRow
extends
StatefulWidget
{
const
IconSampleRow
(
this
.
sample
);
final
IconSample
sample
;
@override
State
createState
()
=>
new
IconSampleRowState
();
}
class
IconSampleRowState
extends
State
<
IconSampleRow
>
with
SingleTickerProviderStateMixin
{
AnimationController
progress
;
@override
Widget
build
(
BuildContext
context
)
{
return
new
ListTile
(
leading:
new
InkWell
(
onTap:
()
{
progress
.
forward
(
from:
0.0
);
},
child:
new
AnimatedIcon
(
icon:
widget
.
sample
.
icon
,
progress:
progress
,
color:
Colors
.
lightBlue
,
),
),
title:
new
Text
(
widget
.
sample
.
description
),
subtitle:
new
Slider
(
value:
progress
.
value
,
onChanged:
(
double
v
)
{
progress
.
animateTo
(
v
,
duration:
Duration
.
ZERO
);
},
),
);
}
@override
void
initState
()
{
super
.
initState
();
progress
=
new
AnimationController
(
vsync:
this
,
duration:
const
Duration
(
milliseconds:
300
));
progress
.
addListener
(
_handleChange
);
}
@override
void
dispose
()
{
progress
.
removeListener
(
_handleChange
);
super
.
dispose
();
}
void
_handleChange
()
{
setState
(()
{});
}
}
const
List
<
IconSample
>
samples
=
const
<
IconSample
>
[
const
IconSample
(
AnimatedIcons
.
arrow_menu
,
'arrow_menu'
),
const
IconSample
(
AnimatedIcons
.
menu_arrow
,
'menu_arrow'
),
];
class
IconSample
{
const
IconSample
(
this
.
icon
,
this
.
description
);
final
AnimatedIconData
icon
;
final
String
description
;
}
void
main
(
)
=>
runApp
(
new
AnimatedIconsTestApp
());
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