File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ import 'package:flutter/cupertino.dart' ;
1
2
import 'package:flutter/material.dart' ;
2
3
import 'package:flutter_form_builder/flutter_form_builder.dart' ;
3
4
@@ -153,6 +154,36 @@ class MyHomePage extends StatelessWidget {
153
154
labelText: 'Pick Photos (only from gallery)' ),
154
155
availableImageSources: const [ImageSourceOption .gallery],
155
156
),
157
+ FormBuilderImagePicker (
158
+ decoration: const InputDecoration (
159
+ labelText: 'Pick Photos (with custom view)' ),
160
+ name: "CupertinoActionSheet" ,
161
+ optionsBuilder: (cameraPicker, galleryPicker) =>
162
+ CupertinoActionSheet (
163
+ title: const Text ('Image' ),
164
+ message: const Text ('Pick an image from given options' ),
165
+ actions: [
166
+ CupertinoActionSheetAction (
167
+ isDefaultAction: true ,
168
+ onPressed: () {
169
+ cameraPicker ();
170
+ },
171
+ child: const Text ('Camera' ),
172
+ ),
173
+ CupertinoActionSheetAction (
174
+ isDefaultAction: true ,
175
+ onPressed: () {
176
+ galleryPicker ();
177
+ },
178
+ child: const Text ('Gallery' ),
179
+ )
180
+ ],
181
+ ),
182
+ onTap: (child) => showCupertinoModalPopup (
183
+ context: context,
184
+ builder: (context) => child,
185
+ ),
186
+ ),
156
187
ElevatedButton (
157
188
child: const Text ('Submit' ),
158
189
onPressed: () {
You can’t perform that action at this time.
0 commit comments