File tree Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Original file line number Diff line number Diff line change 5
5
android : icon =" @mipmap/ic_launcher" >
6
6
<activity
7
7
android : name =" .MainActivity"
8
+ android : exported =" true"
8
9
android : launchMode =" singleTop"
9
10
android : theme =" @style/LaunchTheme"
10
11
android : configChanges =" orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
Original file line number Diff line number Diff line change @@ -129,6 +129,15 @@ class MyHomePage extends StatelessWidget {
129
129
],
130
130
),
131
131
const SizedBox (height: 15 ),
132
+ FormBuilderImagePicker (
133
+ name: 'fieldCustomization' ,
134
+ decoration: const InputDecoration (labelText: 'Pick Photos' ),
135
+ previewAutoSizeWidth: true ,
136
+ fit: BoxFit .cover,
137
+ backgroundColor: Colors .black54,
138
+ iconColor: Colors .white,
139
+ icon: Icons .ac_unit_rounded,
140
+ ),
132
141
ElevatedButton (
133
142
child: const Text ('Submit' ),
134
143
onPressed: () {
Original file line number Diff line number Diff line change @@ -42,8 +42,15 @@ class FormBuilderImagePicker extends FormBuilderField<List<dynamic>> {
42
42
/// placeholder widget displayed when picking a new image
43
43
final Widget ? placeholderWidget;
44
44
45
+ /// Field icon
46
+ final IconData ? icon;
47
+
48
+ /// Field icon color
45
49
final Color ? iconColor;
46
50
51
+ /// Field background color
52
+ final Color ? backgroundColor;
53
+
47
54
/// Optional maximum height of image; see [ImagePicker] .
48
55
final double ? maxHeight;
49
56
@@ -113,7 +120,9 @@ class FormBuilderImagePicker extends FormBuilderField<List<dynamic>> {
113
120
this .previewWidth = 130 ,
114
121
this .previewHeight = 130 ,
115
122
this .previewMargin,
123
+ this .icon,
116
124
this .iconColor,
125
+ this .backgroundColor,
117
126
this .maxHeight,
118
127
this .maxWidth,
119
128
this .imageQuality,
@@ -165,11 +174,11 @@ class FormBuilderImagePicker extends FormBuilderField<List<dynamic>> {
165
174
)
166
175
: Container (
167
176
color: (state.enabled
168
- ? iconColor ?? primaryColor
169
- : disabledColor )
170
- . withAlpha ( 50 ),
177
+ ? backgroundColor ??
178
+ primaryColor. withAlpha ( 50 )
179
+ : disabledColor ),
171
180
child: Icon (
172
- Icons .camera_enhance,
181
+ icon ?? Icons .camera_enhance,
173
182
color: state.enabled
174
183
? iconColor ?? primaryColor
175
184
: disabledColor,
You can’t perform that action at this time.
0 commit comments