Skip to content

Commit 72f099f

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 851db32 + 3be8176 commit 72f099f

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

lib/src/fields/form_builder_slider.dart

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ class FormBuilderSlider extends StatefulWidget {
2727
final FormFieldSetter onSaved;
2828
final DisplayValues displayValues;
2929

30+
final TextStyle minTextStyle;
31+
final TextStyle textStyle;
32+
final TextStyle maxTextStyle;
33+
3034
FormBuilderSlider({
3135
Key key,
3236
@required this.attribute,
@@ -48,6 +52,9 @@ class FormBuilderSlider extends StatefulWidget {
4852
this.numberFormat,
4953
this.onSaved,
5054
this.displayValues = DisplayValues.all,
55+
this.minTextStyle,
56+
this.textStyle = const TextStyle(),
57+
this.maxTextStyle,
5158
}) : super(key: key);
5259

5360
@override
@@ -135,15 +142,24 @@ class _FormBuilderSliderState extends State<FormBuilderSlider> {
135142
children: <Widget>[
136143
if (widget.displayValues != DisplayValues.none &&
137144
widget.displayValues != DisplayValues.current)
138-
Text('${widget.min}'),
145+
Text(
146+
'${_numberFormat.format(widget.min)}',
147+
style: widget.minTextStyle ?? widget.textStyle,
148+
),
139149
Spacer(),
140150
if (widget.displayValues != DisplayValues.none &&
141151
widget.displayValues != DisplayValues.minMax)
142-
Text('${field.value}'),
152+
Text(
153+
'${_numberFormat.format(field.value)}',
154+
style: widget.textStyle,
155+
),
143156
Spacer(),
144157
if (widget.displayValues != DisplayValues.none &&
145158
widget.displayValues != DisplayValues.current)
146-
Text('${widget.max}'),
159+
Text(
160+
'${_numberFormat.format(widget.max)}',
161+
style: widget.maxTextStyle ?? widget.textStyle,
162+
),
147163
],
148164
),
149165
],

0 commit comments

Comments
 (0)