mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
[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 ".
This commit is contained in:
parent
bbe6ed2dce
commit
e11a2213e2
@ -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:',
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user