multi_image_picker_view 0.0.4 multi_image_picker_view: ^0.0.4 copied to clipboard
A complete widget which can easily pick multiple images from device and display them in UI. Also picked image can be re-ordered and removed easily.
import 'package:example/custom_examples.dart';
import 'package:flutter/material.dart';
import 'package:multi_image_picker_view/multi_image_picker_view.dart';
void main() {
runApp(MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Mutli Image Picker View Example',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const DemoPage(),
));
}
class DemoPage extends StatefulWidget {
const DemoPage({Key? key}) : super(key: key);
@override
State<DemoPage> createState() => _DemoPageState();
}
class _DemoPageState extends State<DemoPage> {
final controller = MultiImagePickerController(
maxImages: 10,
allowedImageTypes: ['png', 'jpg', 'jpeg'],
);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
MultiImagePickerView(
controller: controller,
padding: const EdgeInsets.all(10),
),
const SizedBox(height: 32),
CustomExamples()
],
),
appBar: AppBar(
title: Text('Multi Image Picker View'),
actions: [
IconButton(
icon: Icon(Icons.arrow_upward),
onPressed: () {
final images = controller.images;
// use these images
print(images);
},
),
],
),
);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}