Skip to content

Commit 68de5d1

Browse files
committed
Allow user to set iconColor for ImagePicker due to issue with dark mode. Closes #268
1 parent f5a128b commit 68de5d1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/src/fields/form_builder_image_picker.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ class FormBuilderImagePicker extends StatefulWidget {
1212
final InputDecoration decoration;
1313
final ValueTransformer valueTransformer;
1414
final ValueChanged onChanged;
15+
final FormFieldSetter onSaved;
1516

1617
final double imageWidth;
1718
final double imageHeight;
1819
final EdgeInsets imageMargin;
19-
final FormFieldSetter onSaved;
20+
final Color iconColor;
2021

2122
const FormBuilderImagePicker({
2223
Key key,
@@ -32,6 +33,7 @@ class FormBuilderImagePicker extends StatefulWidget {
3233
this.readOnly = false,
3334
this.onSaved,
3435
this.decoration = const InputDecoration(),
36+
this.iconColor,
3537
}) : super(key: key);
3638

3739
@override
@@ -131,10 +133,10 @@ class _FormBuilderImagePickerState extends State<FormBuilderImagePicker> {
131133
child: Icon(Icons.camera_enhance,
132134
color: _readOnly
133135
? Theme.of(context).disabledColor
134-
: Theme.of(context).primaryColor),
136+
: widget.iconColor ?? Theme.of(context).primaryColor),
135137
color: (_readOnly
136138
? Theme.of(context).disabledColor
137-
: Theme.of(context).primaryColor)
139+
: widget.iconColor ?? Theme.of(context).primaryColor)
138140
.withAlpha(50)),
139141
onTap: _readOnly
140142
? null

0 commit comments

Comments
 (0)