add m.location support

Needs cross-platform testing. Currently only tested on Android.
This commit is contained in:
Henry Hiles 2026-11-02 15:02:49 -05:00
commit 3a8d977f11
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
2 changed files with 810 additions and 12 deletions

View file

@ -173,7 +173,9 @@ extension BuildEventOptions on Event {
),
),
if (content is MessageContent && sender == userId)
if (content is MessageContent &&
content is! LocationMessageContent &&
sender == userId)
PopupMenuItem(
onTap: () => onRelation(rowId, .edit),
child: const ListTile(leading: Icon(Icons.edit), title: Text("Edit")),

View file

@ -4,7 +4,10 @@ import "package:nexus/helpers/extensions/is_desktop.dart";
extension ShowAdaptiveSheet on BuildContext {
/// Shows the widget from [builder] in a dialog on desktop, or a bottom sheet
/// on mobile. Use the context passed to [builder] to close it.
Future<T?> showAdaptiveSheet<T>(WidgetBuilder builder) => isDesktop
Future<T?> showAdaptiveSheet<T>(
WidgetBuilder builder, {
bool enableDrag = true,
}) => isDesktop
? showDialog<T>(
context: this,
builder: (context) => Dialog(
@ -18,6 +21,7 @@ extension ShowAdaptiveSheet on BuildContext {
: showModalBottomSheet<T>(
context: this,
isScrollControlled: true,
enableDrag: enableDrag,
constraints: .new(maxHeight: MediaQuery.sizeOf(this).height - 80),
builder: (context) => SafeArea(child: builder(context)),
);