Skip to content

Commit 26c3307

Browse files
committed
Dartfix: prefer_single_quotes
1 parent 24a5672 commit 26c3307

12 files changed

+45
-43
lines changed

lib/src/fields/form_builder_color_picker.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ class _FormBuilderColorPickerState extends State<FormBuilderColorPicker> {
284284
},
285285
);
286286
default:
287-
throw "Unknown ColorPickerType";
287+
throw 'Unknown ColorPickerType';
288288
}
289289
}),
290290
),

lib/src/fields/form_builder_country_picker.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class FormBuilderCountryPicker extends StatefulWidget {
3434
FormBuilderCountryPicker({
3535
Key key,
3636
@required this.attribute,
37-
this.defaultSelectedCountryIsoCode = "US",
37+
this.defaultSelectedCountryIsoCode = 'US',
3838
this.initialValue,
3939
this.validators = const [],
4040
this.readOnly = false,
@@ -194,7 +194,7 @@ class _FormBuilderCountryPickerState extends State<FormBuilderCountryPicker> {
194194
child: ListTile(
195195
contentPadding: EdgeInsets.zero,
196196
leading: CountryPickerUtils.getDefaultFlagImage(country),
197-
title: Text("${country.name}"),
197+
title: Text(country.name),
198198
// visualDensity: VisualDensity.compact, //TODO: Re-enable after Flutter 1.17
199199
),
200200
);

lib/src/fields/form_builder_date_range_picker.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,11 @@ class FormBuilderDateRangePickerState
271271

272272
_valueToText() {
273273
if (value.isEmpty) {
274-
return "";
274+
return '';
275275
} else if (value.length == 1) {
276-
return "${format(value[0])}";
276+
return '${format(value[0])}';
277277
}
278-
return "${format(value[0])} - ${format(value[1])}";
278+
return '${format(value[0])} - ${format(value[1])}';
279279
}
280280

281281
_setCurrentValue(val) {

lib/src/fields/form_builder_date_time_picker.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class _FormBuilderDateTimePickerState extends State<FormBuilderDateTimePicker> {
218218
final _dateTimeFormats = {
219219
InputType.both: DateFormat("EEEE, MMMM d, yyyy 'at' h:mma"),
220220
InputType.date: DateFormat('yyyy-MM-dd'),
221-
InputType.time: DateFormat("HH:mm"),
221+
InputType.time: DateFormat('HH:mm'),
222222
};
223223

224224
@override
@@ -344,7 +344,7 @@ class _FormBuilderDateTimePickerState extends State<FormBuilderDateTimePicker> {
344344
}
345345
break;
346346
default:
347-
throw "Unexcepted input type ${widget.inputType}";
347+
throw 'Unexcepted input type ${widget.inputType}';
348348
break;
349349
}
350350
newValue = newValue ?? currentValue;

lib/src/fields/form_builder_dropdown.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class _FormBuilderDropdownState extends State<FormBuilderDropdown> {
123123
.firstWhere((val) => val.value == field.value,
124124
orElse: () => null)
125125
?.child ??
126-
Text("${field.value.toString()}"))
126+
Text(field.value.toString()))
127127
: widget.disabledHint,
128128
elevation: widget.elevation,
129129
iconSize: widget.iconSize,

lib/src/fields/form_builder_phone_field.dart

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class FormBuilderPhoneField extends StatefulWidget {
107107
this.titlePadding,
108108
this.dialogTitle,
109109
this.isSearchable,
110-
this.defaultSelectedCountryIsoCode = "US",
110+
this.defaultSelectedCountryIsoCode = 'US',
111111
this.priorityListByIsoCode,
112112
this.countryFilterByIsoCode,
113113
this.dialogTextStyle,
@@ -126,7 +126,8 @@ class FormBuilderPhoneFieldState extends State<FormBuilderPhoneField> {
126126
bool _readOnly = false;
127127
TextEditingController _effectiveController = TextEditingController();
128128
FocusNode _focusNode;
129-
FocusNode get _effectiveFocusNode => widget.focusNode ?? (_focusNode ?? FocusNode());
129+
FocusNode get _effectiveFocusNode =>
130+
widget.focusNode ?? (_focusNode ?? FocusNode());
130131
FormBuilderState _formState;
131132
final GlobalKey<FormFieldState> _fieldKey = GlobalKey<FormFieldState>();
132133
String _initialValue;
@@ -172,7 +173,7 @@ class FormBuilderPhoneFieldState extends State<FormBuilderPhoneField> {
172173
_effectiveController.text = parseResult['national_number'];
173174
}
174175
} catch (error) {
175-
_effectiveController.text = _initialValue.replaceFirst("+", "");
176+
_effectiveController.text = _initialValue.replaceFirst('+', '');
176177
}
177178
}
178179
}
@@ -209,7 +210,8 @@ class FormBuilderPhoneFieldState extends State<FormBuilderPhoneField> {
209210
return TextField(
210211
enabled: !_readOnly,
211212
style: widget.style,
212-
focusNode: _readOnly ? AlwaysDisabledFocusNode() : _effectiveFocusNode,
213+
focusNode:
214+
_readOnly ? AlwaysDisabledFocusNode() : _effectiveFocusNode,
213215
decoration: widget.decoration.copyWith(
214216
enabled: !_readOnly,
215217
errorText: field.errorText,
@@ -271,7 +273,7 @@ class FormBuilderPhoneFieldState extends State<FormBuilderPhoneField> {
271273
Icon(Icons.arrow_drop_down),
272274
CountryPickerUtils.getDefaultFlagImage(_selectedDialogCountry),
273275
Text(
274-
"+${_selectedDialogCountry.phoneCode} ",
276+
'+${_selectedDialogCountry.phoneCode} ',
275277
style: widget.style ?? Theme.of(context).textTheme.subtitle1,
276278
),
277279
],
@@ -357,9 +359,9 @@ class FormBuilderPhoneFieldState extends State<FormBuilderPhoneField> {
357359
child: ListTile(
358360
contentPadding: EdgeInsets.zero,
359361
leading: CountryPickerUtils.getDefaultFlagImage(country),
360-
title: Text("${country.name}"),
362+
title: Text(country.name),
361363
// visualDensity: VisualDensity.compact, //TODO: Re-enable after Flutter 1.17
362-
trailing: Text("+${country.phoneCode}"),
364+
trailing: Text('+${country.phoneCode}'),
363365
),
364366
);
365367
}

lib/src/fields/form_builder_range_slider.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ class _FormBuilderRangeSliderState extends State<FormBuilderRangeSlider> {
126126
Row(
127127
mainAxisAlignment: MainAxisAlignment.spaceBetween,
128128
children: <Widget>[
129-
Text("${widget.min}"),
130-
Text("${field.value.start} - ${field.value.end}"),
131-
Text("${widget.max}"),
129+
Text('${widget.min}'),
130+
Text('${field.value.start} - ${field.value.end}'),
131+
Text('${widget.max}'),
132132
],
133133
),
134134
],

lib/src/fields/form_builder_segmented_control.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class _FormBuilderSegmentedControlState
123123
// ignore: deprecated_member_use_from_same_package
124124
child: widget.textStyle != null
125125
? Text(
126-
"${option.label ?? option.value}",
126+
'${option.label ?? option.value}',
127127
// ignore: deprecated_member_use_from_same_package
128128
style: widget.textStyle,
129129
)

lib/src/fields/form_builder_signature_pad.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ class FormBuilderSignaturePad extends StatefulWidget {
1616
final ValueChanged onChanged;
1717
final FormFieldSetter onSaved;
1818

19-
@Deprecated("Set points within SignatureController")
19+
@Deprecated('Set points within SignatureController')
2020
final List<Point> points;
2121
final double width;
2222
final double height;
2323
final Color backgroundColor;
24-
@Deprecated("Set penColor within SignatureController")
24+
@Deprecated('Set penColor within SignatureController')
2525
final Color penColor;
26-
@Deprecated("Set penStrokeWidth within SignatureController")
26+
@Deprecated('Set penStrokeWidth within SignatureController')
2727
final double penStrokeWidth;
2828
final String clearButtonText;
2929
final SignatureController controller;
@@ -37,7 +37,7 @@ class FormBuilderSignaturePad extends StatefulWidget {
3737
this.backgroundColor = Colors.white,
3838
this.penColor = Colors.black,
3939
this.penStrokeWidth = 3.0,
40-
this.clearButtonText = "Clear",
40+
this.clearButtonText = 'Clear',
4141
this.initialValue,
4242
this.points,
4343
this.width,

lib/src/fields/form_builder_slider.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class _FormBuilderSliderState extends State<FormBuilderSlider> {
6565
(_formState.initialValue.containsKey(widget.attribute)
6666
? _formState.initialValue[widget.attribute]
6767
: null);
68-
_numberFormat = widget.numberFormat ?? NumberFormat("##0.0");
68+
_numberFormat = widget.numberFormat ?? NumberFormat('##0.0');
6969
super.initState();
7070
}
7171

@@ -130,9 +130,9 @@ class _FormBuilderSliderState extends State<FormBuilderSlider> {
130130
Row(
131131
mainAxisAlignment: MainAxisAlignment.spaceBetween,
132132
children: <Widget>[
133-
Text("${_numberFormat.format(widget.min)}"),
134-
Text("${_numberFormat.format(field.value)}"),
135-
Text("${_numberFormat.format(widget.max)}"),
133+
Text(_numberFormat.format(widget.min)),
134+
Text(_numberFormat.format(field.value)),
135+
Text(_numberFormat.format(widget.max)),
136136
],
137137
),
138138
],

0 commit comments

Comments
 (0)