Skip to content

Commit 5f0b835

Browse files
Merge pull request #32 from grundid/max_files_decoration
move maxFiles display into counterText of InputDecorator
2 parents 8909efe + 722c562 commit 5f0b835

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/src/form_builder_file_picker.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,15 @@ class FormBuilderFilePicker extends FormBuilderField<List<PlatformFile>> {
105105
final state = field as _FormBuilderFilePickerState;
106106

107107
return InputDecorator(
108-
decoration: state.decoration,
108+
decoration: state.decoration.copyWith(
109+
counterText: maxFiles != null
110+
? '${state._files.length} / $maxFiles'
111+
: null),
109112
child: Column(
110113
children: <Widget>[
111114
Row(
112115
mainAxisAlignment: MainAxisAlignment.spaceBetween,
113116
children: <Widget>[
114-
if (maxFiles != null)
115-
Text('${state._files.length} / $maxFiles'),
116117
InkWell(
117118
onTap: state.enabled &&
118119
(null == state._remainingItemCount ||

0 commit comments

Comments
 (0)