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:
@@ -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'),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user