Skip to content

Commit 4b5a655

Browse files
committed
add examples for pickers
1 parent a0a8323 commit 4b5a655

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

example/lib/main.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class MyApp extends StatelessWidget {
2626
class ApiImage {
2727
final String imageUrl;
2828
final String id;
29+
2930
ApiImage({
3031
required this.imageUrl,
3132
required this.id,
@@ -138,6 +139,20 @@ class MyHomePage extends StatelessWidget {
138139
iconColor: Colors.white,
139140
icon: Icons.ac_unit_rounded,
140141
),
142+
const SizedBox(height: 15),
143+
FormBuilderImagePicker(
144+
name: 'onlyCamera',
145+
decoration: const InputDecoration(
146+
labelText: 'Pick Photos (only from camera)'),
147+
availableImageSources: const [ImageSourceOption.camera],
148+
),
149+
const SizedBox(height: 15),
150+
FormBuilderImagePicker(
151+
name: 'onlyGallery',
152+
decoration: const InputDecoration(
153+
labelText: 'Pick Photos (only from gallery)'),
154+
availableImageSources: const [ImageSourceOption.gallery],
155+
),
141156
ElevatedButton(
142157
child: const Text('Submit'),
143158
onPressed: () {

0 commit comments

Comments
 (0)