Skip to content

Commit e5afc5a

Browse files
committed
Wrap bottom sheet content in SafeAreas
1 parent e14689b commit e5afc5a

File tree

4 files changed

+113
-90
lines changed

4 files changed

+113
-90
lines changed

flutter_quill_extensions/lib/src/toolbar/camera/select_camera_action.dart

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,33 @@ class SelectCameraActionDialog extends StatelessWidget {
1111
return SizedBox(
1212
height: 150,
1313
width: double.infinity,
14-
child: SingleChildScrollView(
15-
child: Column(
16-
children: [
17-
ListTile(
18-
title: Text(context.loc.photo),
19-
subtitle: Text(
20-
context.loc.takeAPhotoUsingYourCamera,
14+
child: SafeArea(
15+
top: false,
16+
left: false,
17+
right: false,
18+
child: SingleChildScrollView(
19+
child: Column(
20+
children: [
21+
ListTile(
22+
title: Text(context.loc.photo),
23+
subtitle: Text(
24+
context.loc.takeAPhotoUsingYourCamera,
25+
),
26+
leading: const Icon(Icons.photo_sharp),
27+
enabled: !isDesktopApp,
28+
onTap: () => Navigator.of(context).pop(CameraAction.image),
2129
),
22-
leading: const Icon(Icons.photo_sharp),
23-
enabled: !isDesktopApp,
24-
onTap: () => Navigator.of(context).pop(CameraAction.image),
25-
),
26-
ListTile(
27-
title: Text(context.loc.video),
28-
subtitle: Text(
29-
context.loc.recordAVideoUsingYourCamera,
30+
ListTile(
31+
title: Text(context.loc.video),
32+
subtitle: Text(
33+
context.loc.recordAVideoUsingYourCamera,
34+
),
35+
leading: const Icon(Icons.camera),
36+
enabled: !isDesktopApp,
37+
onTap: () => Navigator.of(context).pop(CameraAction.video),
3038
),
31-
leading: const Icon(Icons.camera),
32-
enabled: !isDesktopApp,
33-
onTap: () => Navigator.of(context).pop(CameraAction.video),
34-
),
35-
],
39+
],
40+
),
3641
),
3742
),
3843
);

flutter_quill_extensions/lib/src/toolbar/image/select_image_source.dart

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,40 @@ class SelectImageSourceDialog extends StatelessWidget {
1111
return Container(
1212
constraints: const BoxConstraints(minHeight: 200),
1313
width: double.infinity,
14-
child: SingleChildScrollView(
15-
child: Column(
16-
children: [
17-
ListTile(
18-
title: Text(context.loc.gallery),
19-
subtitle: Text(
20-
context.loc.pickAPhotoFromYourGallery,
14+
child: SafeArea(
15+
top: false,
16+
left: false,
17+
right: false,
18+
child: SingleChildScrollView(
19+
child: Column(
20+
children: [
21+
ListTile(
22+
title: Text(context.loc.gallery),
23+
subtitle: Text(
24+
context.loc.pickAPhotoFromYourGallery,
25+
),
26+
leading: const Icon(Icons.photo_sharp),
27+
onTap: () => Navigator.of(context).pop(InsertImageSource.gallery),
2128
),
22-
leading: const Icon(Icons.photo_sharp),
23-
onTap: () => Navigator.of(context).pop(InsertImageSource.gallery),
24-
),
25-
ListTile(
26-
title: Text(context.loc.camera),
27-
subtitle: Text(
28-
context.loc.takeAPhotoUsingYourCamera,
29+
ListTile(
30+
title: Text(context.loc.camera),
31+
subtitle: Text(
32+
context.loc.takeAPhotoUsingYourCamera,
33+
),
34+
leading: const Icon(Icons.camera),
35+
enabled: !isDesktopApp,
36+
onTap: () => Navigator.of(context).pop(InsertImageSource.camera),
2937
),
30-
leading: const Icon(Icons.camera),
31-
enabled: !isDesktopApp,
32-
onTap: () => Navigator.of(context).pop(InsertImageSource.camera),
33-
),
34-
ListTile(
35-
title: Text(context.loc.link),
36-
subtitle: Text(
37-
context.loc.pasteAPhotoUsingALink,
38+
ListTile(
39+
title: Text(context.loc.link),
40+
subtitle: Text(
41+
context.loc.pasteAPhotoUsingALink,
42+
),
43+
leading: const Icon(Icons.link),
44+
onTap: () => Navigator.of(context).pop(InsertImageSource.link),
3845
),
39-
leading: const Icon(Icons.link),
40-
onTap: () => Navigator.of(context).pop(InsertImageSource.link),
41-
),
42-
],
46+
],
47+
),
4348
),
4449
),
4550
);

flutter_quill_extensions/lib/src/toolbar/video/select_video_source.dart

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,38 @@ class SelectVideoSourceDialog extends StatelessWidget {
1111
return Container(
1212
constraints: const BoxConstraints(minHeight: 200),
1313
width: double.infinity,
14-
child: SingleChildScrollView(
15-
child: Column(
16-
children: [
17-
ListTile(
18-
title: Text(context.loc.gallery),
19-
subtitle: Text(
20-
context.loc.pickAVideoFromYourGallery,
14+
child: SafeArea(
15+
top: false,
16+
left: false,
17+
right: false,
18+
child: SingleChildScrollView(
19+
child: Column(
20+
children: [
21+
ListTile(
22+
title: Text(context.loc.gallery),
23+
subtitle: Text(
24+
context.loc.pickAVideoFromYourGallery,
25+
),
26+
leading: const Icon(Icons.photo_sharp),
27+
onTap: () => Navigator.of(context).pop(InsertVideoSource.gallery),
2128
),
22-
leading: const Icon(Icons.photo_sharp),
23-
onTap: () => Navigator.of(context).pop(InsertVideoSource.gallery),
24-
),
25-
ListTile(
26-
title: Text(context.loc.camera),
27-
subtitle: Text(context.loc.recordAVideoUsingYourCamera),
28-
leading: const Icon(Icons.camera),
29-
enabled: !isDesktopApp,
30-
onTap: () => Navigator.of(context).pop(InsertVideoSource.camera),
31-
),
32-
ListTile(
33-
title: Text(context.loc.link),
34-
subtitle: Text(
35-
context.loc.pasteAVideoUsingALink,
29+
ListTile(
30+
title: Text(context.loc.camera),
31+
subtitle: Text(context.loc.recordAVideoUsingYourCamera),
32+
leading: const Icon(Icons.camera),
33+
enabled: !isDesktopApp,
34+
onTap: () => Navigator.of(context).pop(InsertVideoSource.camera),
3635
),
37-
leading: const Icon(Icons.link),
38-
onTap: () => Navigator.of(context).pop(InsertVideoSource.link),
39-
),
40-
],
36+
ListTile(
37+
title: Text(context.loc.link),
38+
subtitle: Text(
39+
context.loc.pasteAVideoUsingALink,
40+
),
41+
leading: const Icon(Icons.link),
42+
onTap: () => Navigator.of(context).pop(InsertVideoSource.link),
43+
),
44+
],
45+
),
4146
),
4247
),
4348
);

lib/src/editor/widgets/link.dart

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -228,25 +228,33 @@ Future<LinkMenuAction> _showMaterialMenu(
228228
final result = await showModalBottomSheet<LinkMenuAction>(
229229
context: context,
230230
builder: (ctx) {
231-
return Column(
232-
mainAxisSize: MainAxisSize.min,
233-
children: [
234-
_MaterialAction(
235-
title: context.loc.open,
236-
icon: Icons.language_sharp,
237-
onPressed: () => Navigator.of(context).pop(LinkMenuAction.launch),
238-
),
239-
_MaterialAction(
240-
title: context.loc.copy,
241-
icon: Icons.copy_sharp,
242-
onPressed: () => Navigator.of(context).pop(LinkMenuAction.copy),
243-
),
244-
_MaterialAction(
245-
title: context.loc.remove,
246-
icon: Icons.link_off_sharp,
247-
onPressed: () => Navigator.of(context).pop(LinkMenuAction.remove),
248-
),
249-
],
231+
return SafeArea(
232+
top: false,
233+
left: false,
234+
right: false,
235+
child: Column(
236+
mainAxisSize: MainAxisSize.min,
237+
children: [
238+
_MaterialAction(
239+
title: context.loc.open,
240+
icon: Icons.language_sharp,
241+
onPressed: () =>
242+
Navigator.of(context).pop(LinkMenuAction.launch),
243+
),
244+
_MaterialAction(
245+
title: context.loc.copy,
246+
icon: Icons.copy_sharp,
247+
onPressed: () =>
248+
Navigator.of(context).pop(LinkMenuAction.copy),
249+
),
250+
_MaterialAction(
251+
title: context.loc.remove,
252+
icon: Icons.link_off_sharp,
253+
onPressed: () =>
254+
Navigator.of(context).pop(LinkMenuAction.remove),
255+
),
256+
],
257+
),
250258
);
251259
},
252260
);

0 commit comments

Comments
 (0)