Skip to content

Commit 4fdc522

Browse files
committed
Fix formatting issues
1 parent f135200 commit 4fdc522

File tree

2 files changed

+104
-107
lines changed

2 files changed

+104
-107
lines changed

lib/src/fields/form_builder_choice_chips.dart

Lines changed: 47 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -292,55 +292,54 @@ class FormBuilderChoiceChip<T> extends FormBuilderField<T> {
292292
super.onChanged,
293293
super.valueTransformer,
294294
super.onReset,
295-
}) : super(
296-
builder: (FormFieldState<T?> field) {
297-
final state = field as _FormBuilderChoiceChipState<T>;
295+
}) : super(builder: (FormFieldState<T?> field) {
296+
final state = field as _FormBuilderChoiceChipState<T>;
298297

299-
return InputDecorator(
300-
decoration: state.decoration,
301-
child: Wrap(
302-
direction: direction,
303-
alignment: alignment,
304-
crossAxisAlignment: crossAxisAlignment,
305-
runAlignment: runAlignment,
306-
runSpacing: runSpacing,
307-
spacing: spacing,
308-
textDirection: textDirection,
309-
verticalDirection: verticalDirection,
310-
children: <Widget>[
311-
for (FormBuilderChipOption<T> option in options)
312-
ChoiceChip(
313-
label: option,
314-
shape: shape,
315-
selected: field.value == option.value,
316-
onSelected: state.enabled
317-
? (selected) {
318-
final choice = selected ? option.value : null;
319-
if (shouldRequestFocus) {
320-
state.requestFocus();
321-
}
322-
state.didChange(choice);
323-
}
324-
: null,
325-
avatar: option.avatar,
326-
selectedColor: selectedColor,
327-
disabledColor: disabledColor,
328-
backgroundColor: backgroundColor,
329-
shadowColor: shadowColor,
330-
selectedShadowColor: selectedShadowColor,
331-
elevation: elevation,
332-
pressElevation: pressElevation,
333-
materialTapTargetSize: materialTapTargetSize,
334-
labelStyle: labelStyle,
335-
labelPadding: labelPadding,
336-
padding: padding,
337-
visualDensity: visualDensity,
338-
avatarBorder: avatarBorder,
339-
),
340-
],
341-
),
342-
);
343-
});
298+
return InputDecorator(
299+
decoration: state.decoration,
300+
child: Wrap(
301+
direction: direction,
302+
alignment: alignment,
303+
crossAxisAlignment: crossAxisAlignment,
304+
runAlignment: runAlignment,
305+
runSpacing: runSpacing,
306+
spacing: spacing,
307+
textDirection: textDirection,
308+
verticalDirection: verticalDirection,
309+
children: <Widget>[
310+
for (FormBuilderChipOption<T> option in options)
311+
ChoiceChip(
312+
label: option,
313+
shape: shape,
314+
selected: field.value == option.value,
315+
onSelected: state.enabled
316+
? (selected) {
317+
final choice = selected ? option.value : null;
318+
if (shouldRequestFocus) {
319+
state.requestFocus();
320+
}
321+
state.didChange(choice);
322+
}
323+
: null,
324+
avatar: option.avatar,
325+
selectedColor: selectedColor,
326+
disabledColor: disabledColor,
327+
backgroundColor: backgroundColor,
328+
shadowColor: shadowColor,
329+
selectedShadowColor: selectedShadowColor,
330+
elevation: elevation,
331+
pressElevation: pressElevation,
332+
materialTapTargetSize: materialTapTargetSize,
333+
labelStyle: labelStyle,
334+
labelPadding: labelPadding,
335+
padding: padding,
336+
visualDensity: visualDensity,
337+
avatarBorder: avatarBorder,
338+
),
339+
],
340+
),
341+
);
342+
});
344343

345344
@override
346345
FormBuilderFieldState<FormBuilderChoiceChip<T>, T> createState() =>

lib/src/fields/form_builder_range_slider.dart

Lines changed: 57 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -133,68 +133,66 @@ class FormBuilderRangeSlider extends FormBuilderField<RangeValues> {
133133
this.maxTextStyle,
134134
this.numberFormat,
135135
this.shouldRequestFocus = false,
136-
}) : super(
137-
builder: (FormFieldState<RangeValues?> field) {
138-
final state = field as _FormBuilderRangeSliderState;
139-
final effectiveNumberFormat =
140-
numberFormat ?? NumberFormat.compact();
136+
}) : super(builder: (FormFieldState<RangeValues?> field) {
137+
final state = field as _FormBuilderRangeSliderState;
138+
final effectiveNumberFormat = numberFormat ?? NumberFormat.compact();
141139

142-
return InputDecorator(
143-
decoration: state.decoration,
144-
child: Container(
145-
padding: const EdgeInsets.only(top: 10.0),
146-
child: Column(
147-
crossAxisAlignment: CrossAxisAlignment.start,
148-
children: [
149-
RangeSlider(
150-
values: field.value ?? RangeValues(min, min),
151-
min: min,
152-
max: max,
153-
divisions: divisions,
154-
activeColor: activeColor,
155-
inactiveColor: inactiveColor,
156-
onChangeEnd: onChangeEnd,
157-
onChangeStart: onChangeStart,
158-
labels: labels,
159-
semanticFormatterCallback: semanticFormatterCallback,
160-
onChanged: state.enabled
161-
? (values) {
162-
if (shouldRequestFocus) {
163-
state.requestFocus();
164-
}
165-
field.didChange(values);
166-
}
167-
: null,
168-
),
169-
Row(
170-
children: <Widget>[
171-
if (displayValues != DisplayValues.none &&
172-
displayValues != DisplayValues.current)
173-
Text(
174-
effectiveNumberFormat.format(min),
175-
style: minTextStyle ?? textStyle,
176-
),
177-
const Spacer(),
178-
if (displayValues != DisplayValues.none &&
179-
displayValues != DisplayValues.minMax)
180-
Text(
181-
'${effectiveNumberFormat.format(field.value!.start)} - ${effectiveNumberFormat.format(field.value!.end)}',
182-
style: textStyle,
183-
),
184-
const Spacer(),
185-
if (displayValues != DisplayValues.none &&
186-
displayValues != DisplayValues.current)
187-
Text(
188-
effectiveNumberFormat.format(max),
189-
style: maxTextStyle ?? textStyle,
190-
),
191-
],
192-
),
140+
return InputDecorator(
141+
decoration: state.decoration,
142+
child: Container(
143+
padding: const EdgeInsets.only(top: 10.0),
144+
child: Column(
145+
crossAxisAlignment: CrossAxisAlignment.start,
146+
children: [
147+
RangeSlider(
148+
values: field.value ?? RangeValues(min, min),
149+
min: min,
150+
max: max,
151+
divisions: divisions,
152+
activeColor: activeColor,
153+
inactiveColor: inactiveColor,
154+
onChangeEnd: onChangeEnd,
155+
onChangeStart: onChangeStart,
156+
labels: labels,
157+
semanticFormatterCallback: semanticFormatterCallback,
158+
onChanged: state.enabled
159+
? (values) {
160+
if (shouldRequestFocus) {
161+
state.requestFocus();
162+
}
163+
field.didChange(values);
164+
}
165+
: null,
166+
),
167+
Row(
168+
children: <Widget>[
169+
if (displayValues != DisplayValues.none &&
170+
displayValues != DisplayValues.current)
171+
Text(
172+
effectiveNumberFormat.format(min),
173+
style: minTextStyle ?? textStyle,
174+
),
175+
const Spacer(),
176+
if (displayValues != DisplayValues.none &&
177+
displayValues != DisplayValues.minMax)
178+
Text(
179+
'${effectiveNumberFormat.format(field.value!.start)} - ${effectiveNumberFormat.format(field.value!.end)}',
180+
style: textStyle,
181+
),
182+
const Spacer(),
183+
if (displayValues != DisplayValues.none &&
184+
displayValues != DisplayValues.current)
185+
Text(
186+
effectiveNumberFormat.format(max),
187+
style: maxTextStyle ?? textStyle,
188+
),
193189
],
194190
),
195-
),
196-
);
197-
});
191+
],
192+
),
193+
),
194+
);
195+
});
198196

199197
@override
200198
FormBuilderFieldState<FormBuilderRangeSlider, RangeValues> createState() =>

0 commit comments

Comments
 (0)