Unverified Commit e11a2213 authored by Yu's avatar Yu Committed by GitHub

[Refactor] Fix style in example (#126191)

Replaces #125616

I just fixed "IMAGES" to "images" in examples/image_list.
Currently, "PREFER uses the lower case of the constant name ".
parent bbe6ed2d
......@@ -119,7 +119,7 @@ Future<void> main() async {
runApp(MyApp(port));
}
const int IMAGES = 50;
const int images = 50;
@immutable
class MyApp extends StatelessWidget {
......@@ -159,7 +159,7 @@ class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
Widget createImage(final int index, final Completer<bool> completer) {
return Image.network(
'https://localhost:${widget.port}/${_counter * IMAGES + index}',
'https://localhost:${widget.port}/${_counter * images + index}',
frameBuilder: (
BuildContext context,
Widget child,
......@@ -177,14 +177,14 @@ class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
@override
Widget build(BuildContext context) {
final List<AnimationController> controllers = <AnimationController>[
for (int i = 0; i < IMAGES; i++)
for (int i = 0; i < images; i++)
AnimationController(
duration: const Duration(milliseconds: 3600),
vsync: this,
)..repeat(),
];
final List<Completer<bool>> completers = <Completer<bool>>[
for (int i = 0; i < IMAGES; i++)
for (int i = 0; i < images; i++)
Completer<bool>(),
];
final List<Future<bool>> futures = completers.map(
......@@ -204,7 +204,7 @@ class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Row(children: createImageList(IMAGES, completers, controllers)),
Row(children: createImageList(images, completers, controllers)),
const Text(
'You have pushed the button this many times:',
),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment