~emersion/goguma-dev

composer: Enclose modal sheet in SafeArea v1 APPLIED

Jean THOMAS: 1
 composer: Enclose modal sheet in SafeArea

 1 files changed, 37 insertions(+), 35 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/goguma-dev/patches/49919/mbox | git am -3
Learn more about email & git

[PATCH] composer: Enclose modal sheet in SafeArea Export this patch

Prevents usability issue on phones (eg. iPhone) where some
system UI elements are drawn over the app UI.
---
 lib/widget/composer.dart | 72 +++++++++++++++++++++-------------------
 1 file changed, 37 insertions(+), 35 deletions(-)

diff --git a/lib/widget/composer.dart b/lib/widget/composer.dart
index 2a26a5b..c173f27 100644
--- a/lib/widget/composer.dart
+++ b/lib/widget/composer.dart
@@ -646,42 +646,44 @@ class ComposerState extends State<Composer> {
				onPressed: () {
					showModalBottomSheet<void>(
						context: context,
						builder: (context) => Column(mainAxisSize: MainAxisSize.min, children: [
							if (_locationServiceAvailable) ListTile(
								title: Text('Share my location'),
								leading: Icon(Icons.my_location),
								onTap: () {
									Navigator.pop(context);
									_runAddMenuTask(_shareLocation);
								}
							),
							if (client.isupport.filehost != null) ListTile(
								title: Text('Share a picture'),
								leading: Icon(Icons.add_photo_alternate),
								onTap: () async {
									Navigator.pop(context);
									var file = await ImagePicker().pickImage(source: ImageSource.gallery);
									if (file != null) {
										_runAddMenuTask(() async {
											await _uploadFile(file);
										});
						builder: (context) => SafeArea(
							child: Column(mainAxisSize: MainAxisSize.min, children: [
								if (_locationServiceAvailable) ListTile(
									title: Text('Share my location'),
									leading: Icon(Icons.my_location),
									onTap: () {
										Navigator.pop(context);
										_runAddMenuTask(_shareLocation);
									}
								},
							),
							if (client.isupport.filehost != null) ListTile(
								title: Text('Share a file'),
								leading: Icon(Icons.upload_file),
								onTap: () async {
									Navigator.pop(context);
									var file = await openFile(confirmButtonText: 'Upload');
									if (file != null) {
										_runAddMenuTask(() async {
											await _uploadFile(file);
										});
									}
								},
							),
						]),
								),
								if (client.isupport.filehost != null) ListTile(
									title: Text('Share a picture'),
									leading: Icon(Icons.add_photo_alternate),
									onTap: () async {
										Navigator.pop(context);
										var file = await ImagePicker().pickImage(source: ImageSource.gallery);
										if (file != null) {
											_runAddMenuTask(() async {
												await _uploadFile(file);
											});
										}
									},
								),
								if (client.isupport.filehost != null) ListTile(
									title: Text('Share a file'),
									leading: Icon(Icons.upload_file),
									onTap: () async {
										Navigator.pop(context);
										var file = await openFile(confirmButtonText: 'Upload');
										if (file != null) {
											_runAddMenuTask(() async {
												await _uploadFile(file);
											});
										}
									},
								),
							]),
						),
					);
				},
			);
-- 
2.39.3 (Apple Git-145)
Pushed, thanks!