awesome_image_selector 0.0.4 awesome_image_selector: ^0.0.4 copied to clipboard
A package to help you select, view, and edit an image with an easy workflow.
import 'package:awesome_image_selector/awesome_image_selector.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: ImageSelectorDemo(),
);
}
}
class ImageSelectorDemo extends StatefulWidget {
@override
_ImageSelectorDemoState createState() => _ImageSelectorDemoState();
}
class _ImageSelectorDemoState extends State<ImageSelectorDemo> {
XFile? selectedImage;
void onImageChanged(XFile file) {
setState(() {
selectedImage = file;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Image Selector Demo'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
AwesomeImageSelector(
onImageChanged: onImageChanged,
initialImage: null,
selectText: "SELECT IMAGE",
changeText: "CHANGE IMAGE",
),
],
),
),
);
}
}