Skip to content

Commit

Permalink
Code Formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham16g committed Jul 14, 2022
1 parent 8740dee commit 32cf33e
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 21 deletions.
1 change: 0 additions & 1 deletion example/lib/custom/custom_1.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class Custom1 extends StatefulWidget {
}

class _Custom1State extends State<Custom1> {

final controller = MultiImagePickerController(
maxImages: 12, allowedImageTypes: const ['jpg', 'jpeg', 'png']);

Expand Down
17 changes: 11 additions & 6 deletions example/lib/custom_examples.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import 'package:flutter/material.dart';

import 'custom/custom_1.dart';
Expand All @@ -11,11 +9,18 @@ class CustomExamples extends StatelessWidget {
Widget build(BuildContext context) {
return Column(
children: [
Text('Custom Examples:', style: TextStyle(fontWeight: FontWeight.w500, fontSize: 16),),
Text(
'Custom Examples:',
style: TextStyle(fontWeight: FontWeight.w500, fontSize: 16),
),
SizedBox(height: 10),
ElevatedButton(onPressed: (){
Navigator.push(context, MaterialPageRoute(builder: (context) => Custom1()));
}, child: Text('Custom 1'),),
ElevatedButton(
onPressed: () {
Navigator.push(
context, MaterialPageRoute(builder: (context) => Custom1()));
},
child: Text('Custom 1'),
),
],
);
}
Expand Down
4 changes: 0 additions & 4 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ 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',
Expand All @@ -22,7 +21,6 @@ class DemoPage extends StatefulWidget {
}

class _DemoPageState extends State<DemoPage> {

final controller = MultiImagePickerController(
maxImages: 10,
allowedImageTypes: ['png', 'jpg', 'jpeg'],
Expand All @@ -31,7 +29,6 @@ class _DemoPageState extends State<DemoPage> {
@override
Widget build(BuildContext context) {
return Scaffold(

body: Column(
children: [
MultiImagePickerView(
Expand All @@ -42,7 +39,6 @@ class _DemoPageState extends State<DemoPage> {
CustomExamples()
],
),

appBar: AppBar(
title: Text('Multi Image Picker View'),
actions: [
Expand Down
4 changes: 1 addition & 3 deletions lib/src/multi_image_picker_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ class MultiImagePickerController with ChangeNotifier {
MultiImagePickerController({
this.allowedImageTypes = const ['png', 'jpeg', 'jpg'],
this.maxImages = 10,
}){
}) {
print('init');
}


final List<ImageFile> _images = <ImageFile>[];
Iterable<ImageFile> get images => _images;
bool get hasNoImages => _images.isEmpty;
Expand Down Expand Up @@ -68,6 +67,5 @@ class MultiImagePickerController with ChangeNotifier {
print('dispose');
super.dispose();
print(_images);

}
}
12 changes: 9 additions & 3 deletions lib/src/multi_image_picker_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ class _MultiImagePickerViewState extends State<MultiImagePickerView> {
width: double.infinity,
height: double.infinity,
child: TextButton(
child: const Text('Add Images'),
child: const Text('Add Images',
style: TextStyle(
color: Colors.blue,
fontWeight: FontWeight.w500,
fontSize: 16)),
onPressed: () {
_pickImages();
},
Expand Down Expand Up @@ -124,7 +128,8 @@ class _MultiImagePickerViewState extends State<MultiImagePickerView> {
// });
// },
scrollController: scrollController,
dragChildBoxDecoration: widget.onDragBoxDecoration ?? BoxDecoration(
dragChildBoxDecoration: widget.onDragBoxDecoration ??
BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.1),
Expand Down Expand Up @@ -248,7 +253,8 @@ class _ItemView extends StatelessWidget {
shape: BoxShape.circle,
),
child: Image.asset(
'assets/close-48.png', package: 'multi_image_picker_view',
'assets/close-48.png',
package: 'multi_image_picker_view',
height: 20,
width: 20,
)),
Expand Down
5 changes: 1 addition & 4 deletions test/multi_image_picker_view_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@

void main() {

}
void main() {}

0 comments on commit 32cf33e

Please sign in to comment.