Skip to content

Commit 011fb04

Browse files
committed
rating analyze and format done
1 parent 5d8817f commit 011fb04

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ class _MyHomePageState extends State<MyHomePage>
249249
),
250250

251251
SizedBox(
252-
height: 20.0,
252+
height: 20,
253253
child: Text('selected rating ${_rating.toStringAsFixed(1)}'),
254254
),
255255

lib/components/rating/gf_rating.dart

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ class _GFRatingState extends State<GFRating> {
117117
}
118118
},
119119
onHorizontalDragUpdate: (dragDetails) {
120-
RenderBox box = context.findRenderObject();
121-
var _pos = box.globalToLocal(dragDetails.globalPosition);
122-
var i = _pos.dx / widget.itemSize;
120+
final RenderBox box = context.findRenderObject();
121+
final _pos = box.globalToLocal(dragDetails.globalPosition);
122+
final i = _pos.dx / widget.itemSize;
123123
var newRating = widget.allowHalfRating ? i : i.round().toDouble();
124124
if (newRating > widget.itemCount) {
125125
newRating = widget.itemCount.toDouble();
@@ -144,12 +144,14 @@ class _GFRatingState extends State<GFRating> {
144144
child: TextFormField(
145145
controller: widget.ratingController,
146146
keyboardType: TextInputType.number,
147-
decoration: widget.inputDecorations == null ? InputDecoration(
148-
border: const OutlineInputBorder(),
149-
hintText: 'Enter rating',
150-
labelText: 'Enter rating',
151-
suffixIcon: widget.suffixIcon,
152-
) : widget.inputDecorations,
147+
decoration: widget.inputDecorations == null
148+
? InputDecoration(
149+
border: const OutlineInputBorder(),
150+
hintText: 'Enter rating',
151+
labelText: 'Enter rating',
152+
suffixIcon: widget.suffixIcon,
153+
)
154+
: widget.inputDecorations,
153155
),
154156
),
155157
Material(

0 commit comments

Comments
 (0)