Skip to content

Commit f993302

Browse files
committed
Instead of AssetImage string for defaultImage, use ImageProvider.
Provides more options
1 parent 63ca84d commit f993302

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

example/lib/main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ class MyHomePageState extends State<MyHomePage> {
452452
decoration: const InputDecoration(
453453
labelText: 'Images',
454454
),
455+
defaultImage: NetworkImage('https://cohenwoodworking.com/wp-content/uploads/2016/09/image-placeholder-500x500.jpg'),
455456
maxImages: 3,
456457
iconColor: Colors.red,
457458
// readOnly: true,

lib/src/fields/form_builder_image_picker.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class FormBuilderImagePicker extends StatefulWidget {
3939
final CameraDevice preferredCameraDevice;
4040

4141
final int maxImages;
42-
final String defaultImage;
42+
final ImageProvider defaultImage;
4343
final Widget cameraIcon;
4444
final Widget galleryIcon;
4545
final Widget cameraLabel;
@@ -195,7 +195,7 @@ class _FormBuilderImagePickerState extends State<FormBuilderImagePicker> {
195195
Image(
196196
width: widget.imageWidth,
197197
height: widget.imageHeight,
198-
image: AssetImage(widget.defaultImage),
198+
image: widget.defaultImage,
199199
):Container(
200200
width: widget.imageWidth,
201201
height: widget.imageHeight,

0 commit comments

Comments
 (0)