1
0
mirror of https://github.com/flutter/samples.git synced 2026-05-23 07:29:07 +00:00

Flutter 3.29 beta (#2571)

This commit is contained in:
Eric Windmill
2025-02-12 18:08:01 -05:00
committed by GitHub
parent d62c784789
commit 719fd72c38
685 changed files with 76244 additions and 53721 deletions

View File

@@ -23,9 +23,7 @@ class _PlatformImageDemoState extends State<PlatformImageDemo> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Platform Image Demo'),
),
appBar: AppBar(title: const Text('Platform Image Demo')),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@@ -47,29 +45,25 @@ class _PlatformImageDemoState extends State<PlatformImageDemo> {
);
} else if (snapshot.connectionState ==
ConnectionState.done) {
return Image.memory(
snapshot.data!,
fit: BoxFit.fill,
);
return Image.memory(snapshot.data!, fit: BoxFit.fill);
}
return const CircularProgressIndicator();
},
),
),
),
const SizedBox(
height: 16,
),
const SizedBox(height: 16),
FilledButton(
onPressed: imageData != null
? null
: () {
setState(() {
imageData = PlatformImageFetcher.getImage();
});
},
onPressed:
imageData != null
? null
: () {
setState(() {
imageData = PlatformImageFetcher.getImage();
});
},
child: const Text('Get Image'),
)
),
],
),
),