mirror of
https://github.com/Iconica-Development/flutter_image_picker.git
synced 2025-05-18 19:53:45 +02:00
layout improvements
This commit is contained in:
parent
fe9ca37185
commit
21c70fb6be
1 changed files with 16 additions and 4 deletions
|
@ -39,6 +39,8 @@ class _ImagePickerExampleHomePageState
|
||||||
extends State<ImagePickerExampleHomePage> {
|
extends State<ImagePickerExampleHomePage> {
|
||||||
Uint8List? image;
|
Uint8List? image;
|
||||||
ImagePicker imagePicker = ImagePicker();
|
ImagePicker imagePicker = ImagePicker();
|
||||||
|
double whiteSpace = 20;
|
||||||
|
double imageWidth = 300;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -53,17 +55,27 @@ class _ImagePickerExampleHomePageState
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Column(children: [
|
Column(children: [
|
||||||
if (image == null) ...[
|
if (image == null) ...[
|
||||||
Image.asset('assets/images/placeholder.png')
|
Image.asset(
|
||||||
|
'assets/images/placeholder.png',
|
||||||
|
width: imageWidth,
|
||||||
|
height: imageWidth,
|
||||||
|
)
|
||||||
] else ...[
|
] else ...[
|
||||||
Image.memory(image!)
|
Image.memory(
|
||||||
|
image!,
|
||||||
|
width: imageWidth,
|
||||||
|
height: imageWidth,
|
||||||
|
)
|
||||||
]
|
]
|
||||||
]),
|
]),
|
||||||
const SizedBox(height: 20),
|
SizedBox(height: whiteSpace),
|
||||||
const Text(
|
const Text(
|
||||||
'Pick an image or make a photo!',
|
'Pick an image or make a photo!',
|
||||||
),
|
),
|
||||||
|
SizedBox(height: whiteSpace / 2),
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: pickImage, child: const Text('Pick Image'))
|
onPressed: pickImage, child: const Text('Pick Image')),
|
||||||
|
SizedBox(height: whiteSpace),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue