File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ class ImageSourceBottomSheet extends StatefulWidget {
21
21
final CameraDevice preferredCameraDevice;
22
22
23
23
/// Callback when an image is selected.
24
- final void Function (XFile )? onImageSelected;
24
+ final void Function (XFile ) onImageSelected;
25
25
26
26
final Widget ? cameraIcon;
27
27
final Widget ? galleryIcon;
@@ -35,14 +35,13 @@ class ImageSourceBottomSheet extends StatefulWidget {
35
35
this .maxWidth,
36
36
this .imageQuality,
37
37
this .preferredCameraDevice = CameraDevice .rear,
38
- this .onImageSelected,
38
+ required this .onImageSelected,
39
39
this .cameraIcon,
40
40
this .galleryIcon,
41
41
this .cameraLabel,
42
42
this .galleryLabel,
43
43
this .bottomSheetPadding,
44
- }) : assert (null != onImageSelected),
45
- super (key: key);
44
+ }) : super (key: key);
46
45
47
46
@override
48
47
_ImageSourceBottomSheetState createState () => _ImageSourceBottomSheetState ();
@@ -64,7 +63,7 @@ class _ImageSourceBottomSheetState extends State<ImageSourceBottomSheet> {
64
63
);
65
64
_isPickingImage = false ;
66
65
if (pickedFile != null ) {
67
- widget.onImageSelected? . call (pickedFile);
66
+ widget.onImageSelected (pickedFile);
68
67
}
69
68
}
70
69
You can’t perform that action at this time.
0 commit comments