@@ -16,6 +16,9 @@ class SizePicker extends StatefulWidget {
1616
1717 @override
1818 State <SizePicker > createState () => _SizePickerState ();
19+
20+ static const double smallLength = 25 ;
21+ static const double largeLength = 150 ;
1922}
2023
2124/// Returns a string representation of [num] that:
@@ -75,9 +78,6 @@ class _SizeSlider extends StatelessWidget {
7578 final Axis axis;
7679 final void Function (void Function ()) setState;
7780
78- static const double _smallLength = 25 ;
79- static const double _largeLength = 150 ;
80-
8181 /// [percent] is a value between 0 and 1
8282 /// where 0 is the start of the slider and 1 is the end.
8383 ///
@@ -97,21 +97,25 @@ class _SizeSlider extends StatelessWidget {
9797 final colorScheme = Theme .of (context).colorScheme;
9898 return GestureDetector (
9999 onHorizontalDragStart: axis == Axis .horizontal
100- ? (details) => onDrag (details.localPosition.dx / _largeLength)
100+ ? (details) =>
101+ onDrag (details.localPosition.dx / SizePicker .largeLength)
101102 : null ,
102103 onHorizontalDragUpdate: axis == Axis .horizontal
103- ? (details) => onDrag (details.localPosition.dx / _largeLength)
104+ ? (details) =>
105+ onDrag (details.localPosition.dx / SizePicker .largeLength)
104106 : null ,
105107 onVerticalDragStart: axis == Axis .vertical
106- ? (details) => onDrag (details.localPosition.dy / _largeLength)
108+ ? (details) =>
109+ onDrag (details.localPosition.dy / SizePicker .largeLength)
107110 : null ,
108111 onVerticalDragUpdate: axis == Axis .vertical
109- ? (details) => onDrag (details.localPosition.dy / _largeLength)
112+ ? (details) =>
113+ onDrag (details.localPosition.dy / SizePicker .largeLength)
110114 : null ,
111115 child: RotatedBox (
112116 quarterTurns: axis == Axis .horizontal ? 0 : 1 ,
113117 child: CustomPaint (
114- size: const Size (_largeLength, _smallLength ),
118+ size: const Size (SizePicker .largeLength, SizePicker .smallLength ),
115119 painter: _SizeSliderPainter (
116120 axis: axis,
117121 minSize: pen.sizeMin,
0 commit comments