Skip to content

Commit d351ec4

Browse files
committed
Added bottomSheetPadding option for ImagePicker. Closes #366, #339, 340
1 parent a886f78 commit d351ec4

File tree

5 files changed

+23
-18
lines changed

5 files changed

+23
-18
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## [3.11.5] - 17-Jul-2020
2+
* Included more `showDatePicker` function options
3+
* Fixed bug where `onChanged` not triggered by ImagePicker. Closes #366
4+
* Deprecate `underline` for Dropdown. Ignored
5+
* Added more options for DropdownButton. Closes #153, #337
6+
* Type `FormBuilderDropdown` class. Closes #360
7+
* Included options to set camera and gallery icons and label. Closes #340
8+
* Added `bottomSheetPadding` option for ImagePicker. Closes #339
9+
110
## [3.11.4] - 08-Jul-2020
211
* Added text styles options to Slider
312
* Re-implement number formatting on Slider field

example/lib/main.dart

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,6 @@ class MyHomePageState extends State<MyHomePage> {
282282
attribute: 'gender',
283283
decoration: const InputDecoration(
284284
labelText: 'Gender',
285-
border: UnderlineInputBorder(
286-
borderSide: BorderSide(
287-
color: Colors.green,
288-
width: 20,
289-
),
290-
),
291285
),
292286
// initialValue: 'Male',
293287
hint: Text('Select Gender'),
@@ -298,6 +292,8 @@ class MyHomePageState extends State<MyHomePage> {
298292
child: Text('$gender'),
299293
))
300294
.toList(),
295+
// isExpanded: false,
296+
allowClear: true,
301297
),
302298
SizedBox(height: 15),
303299
FormBuilderTypeAhead(
@@ -461,6 +457,7 @@ class MyHomePageState extends State<MyHomePage> {
461457
return null;
462458
}
463459
],
460+
onChanged: _onChanged,
464461
),
465462
SizedBox(height: 15),
466463
FormBuilderCountryPicker(
@@ -516,12 +513,8 @@ class MyHomePageState extends State<MyHomePage> {
516513
decoration: const InputDecoration(labelText: 'Radio Group'),
517514
onChanged: _onChanged,
518515
options: [
519-
FormBuilderFieldOption(
520-
value: 'Male',
521-
),
522-
FormBuilderFieldOption(
523-
value: 'Female',
524-
),
516+
FormBuilderFieldOption(value: 'Male'),
517+
FormBuilderFieldOption(value: 'Female'),
525518
],
526519
),
527520
SizedBox(height: 15),
@@ -582,9 +575,7 @@ class MyHomePageState extends State<MyHomePage> {
582575
},
583576
),
584577
),
585-
SizedBox(
586-
width: 20,
587-
),
578+
SizedBox(width: 20),
588579
Expanded(
589580
child: MaterialButton(
590581
color: Theme.of(context).accentColor,

lib/src/fields/form_builder_image_picker.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class FormBuilderImagePicker extends StatefulWidget {
4343
final Widget galleryIcon;
4444
final Widget cameraLabel;
4545
final Widget galleryLabel;
46+
final EdgeInsets bottomSheetPadding;
4647

4748
const FormBuilderImagePicker({
4849
Key key,
@@ -68,6 +69,7 @@ class FormBuilderImagePicker extends StatefulWidget {
6869
this.galleryIcon = const Icon(Icons.image),
6970
this.cameraLabel = const Text('Camera'),
7071
this.galleryLabel = const Text('Gallery'),
72+
this.bottomSheetPadding = const EdgeInsets.all(0),
7173
}) : super(key: key);
7274

7375
@override
@@ -131,7 +133,7 @@ class _FormBuilderImagePickerState extends State<FormBuilderImagePicker> {
131133
},
132134
builder: (field) {
133135
var theme = Theme.of(context);
134-
136+
135137
return InputDecorator(
136138
decoration: widget.decoration.copyWith(
137139
enabled: !_readOnly,
@@ -217,6 +219,7 @@ class _FormBuilderImagePickerState extends State<FormBuilderImagePicker> {
217219
widget.onChanged?.call(field.value);
218220
Navigator.of(context).pop();
219221
},
222+
bottomSheetPadding: widget.bottomSheetPadding,
220223
);
221224
},
222225
);

lib/src/widgets/image_source_sheet.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class ImageSourceBottomSheet extends StatelessWidget {
3737
final Widget galleryIcon;
3838
final Widget cameraLabel;
3939
final Widget galleryLabel;
40+
final EdgeInsets bottomSheetPadding;
4041

4142
ImageSourceBottomSheet({
4243
Key key,
@@ -50,6 +51,7 @@ class ImageSourceBottomSheet extends StatelessWidget {
5051
this.galleryIcon,
5152
this.cameraLabel,
5253
this.galleryLabel,
54+
this.bottomSheetPadding,
5355
}) : assert(null != onImage || null != onImageSelected),
5456
super(key: key);
5557

@@ -83,7 +85,7 @@ class ImageSourceBottomSheet extends StatelessWidget {
8385
@override
8486
Widget build(BuildContext context) {
8587
return Container(
86-
padding: EdgeInsets.only(bottom: 20),
88+
padding: bottomSheetPadding,
8789
child: Wrap(
8890
children: <Widget>[
8991
ListTile(

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_form_builder
22
description: Package to build Material Form with fields like TextField, DropDown, Switches etc. with ability to create custom FormFields and composability and reuse validation functions.
3-
version: 3.11.4
3+
version: 3.11.5
44
homepage: https://github.com/danvick/flutter_form_builder
55

66
environment:

0 commit comments

Comments
 (0)