Skip to content

Commit 6db1bed

Browse files
committed
refactoring code to comply with null-safety
1 parent 6491eeb commit 6db1bed

File tree

16 files changed

+23
-61
lines changed

16 files changed

+23
-61
lines changed

lib/components/bottom_sheet/gf_bottom_sheet.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ class GFBottomSheet extends StatefulWidget {
66
GFBottomSheet({
77
Key key,
88
@required this.contentBody,
9+
@required this.controller,
910
this.stickyHeader,
1011
this.stickyFooter,
11-
this.controller,
1212
this.minContentHeight = 0,
1313
this.maxContentHeight = 300,
1414
this.elevation = 0.0,
@@ -19,6 +19,7 @@ class GFBottomSheet extends StatefulWidget {
1919
}) : assert(elevation >= 0.0),
2020
assert(minContentHeight >= 0.0),
2121
assert(contentBody != null),
22+
assert(controller != null),
2223
super(key: key) {
2324
controller.height = minContentHeight;
2425
controller.animationDuration = animationDuration;

lib/components/checkbox/gf_checkbox.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ class GFCheckbox extends StatefulWidget {
2222
this.customBgColor = GFColors.SUCCESS,
2323
this.autofocus = false,
2424
this.focusNode})
25-
: assert(value != null),
26-
assert(onChanged != null),
27-
assert(autofocus != null),
25+
: assert(autofocus != null),
26+
assert(value != null),
2827
super(key: key);
2928

3029
/// type of [GFCheckboxType] which is of four type is basic, square, circular and custom

lib/components/checkbox_list_tile/gf_checkbox_list_tile.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ class GFCheckboxListTile extends StatelessWidget {
3434
this.position = GFPosition.end,
3535
this.selected = false,
3636
this.autofocus = false,
37-
}) : assert(value != null),
38-
assert(onChanged != null),
39-
assert(selected != null),
37+
}) : assert(selected != null),
4038
assert(autofocus != null),
39+
assert(value != null),
4140
super(key: key);
4241

4342
///type of [String] used to pass text, alternative to title property and gets higher priority than title

lib/components/dropdown/gf_dropdown.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ class GFDropdown<T> extends StatefulWidget {
3232
this.border = const BorderSide(
3333
color: Colors.transparent, width: 1, style: BorderStyle.solid),
3434
this.dropdownButtonColor = GFColors.WHITE})
35-
: assert(onChanged != null),
36-
super(key: key);
35+
: super(key: key);
3736

3837
final DropdownButtonBuilder selectedItemBuilder;
3938
final List<DropdownMenuItem<T>> items;

lib/components/image/gf_image_overlay.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class GFImageOverlay extends StatelessWidget {
2222
this.border,
2323
this.shape = BoxShape.rectangle,
2424
}) : assert(shape != null),
25-
assert(image != null),
2625
super(key: key);
2726

2827
/// define image's [double] height

lib/components/radio/gf_radio.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ class GFRadio<T> extends StatefulWidget {
2828
this.autofocus = false,
2929
this.focusNode,
3030
this.toggleable = false})
31-
: assert(value != null),
32-
assert(groupValue != null),
33-
assert(onChanged != null),
34-
assert(autofocus != null),
31+
: assert(autofocus != null),
3532
assert(toggleable != null),
3633
super(key: key);
3734

lib/components/radio_list_tile/gf_radio_list_tile.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ class GFRadioListTile<T> extends StatelessWidget {
4242
this.selected = false,
4343
this.focusColor,
4444
this.hoverColor,
45-
}) : assert(value != null),
46-
assert(groupValue != null),
47-
assert(onChanged != null),
48-
assert(autofocus != null),
45+
}) : assert(autofocus != null),
4946
assert(toggleable != null),
5047
assert(enabled != null),
5148
assert(selected != null),

lib/components/rating/gf_rating.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class GFRating extends StatefulWidget {
2525
this.margin = const EdgeInsets.symmetric(vertical: 16),
2626
this.padding = const EdgeInsets.symmetric(horizontal: 16),
2727
}) : assert(value != null),
28-
assert(onChanged != null),
2928
super(key: key);
3029

3130
/// defines total number of rating items

lib/components/sticky_header/gf_sticky_header_builder.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ class GFStickyHeaderBuilder extends StatefulWidget {
1818
this.callback,
1919
this.stickyContentPosition = GFPosition.start,
2020
}) : assert(direction != null),
21+
assert(stickyContentBuilder != null),
22+
assert(content != null),
2123
super(key: key);
2224

2325
/// builder widget can be used to define [stickyContentBuilder].

lib/components/toggle/gf_toggle.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class GFToggle extends StatefulWidget {
3030
this.borderRadius,
3131
this.duration = const Duration(milliseconds: 400)})
3232
: assert(value != null),
33-
assert(onChanged != null),
3433
super(key: key);
3534

3635
///type [String] used to add custom text i.e, ON,ENABLE

0 commit comments

Comments
 (0)