reorganize and rename widgets

This commit is contained in:
Henry Hiles 2026-11-09 17:25:02 -05:00
commit d5f29dc344
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -0,0 +1,68 @@
import "package:material_ui/material_ui.dart";
import "package:material_adaptive_sheets/material_adaptive_sheets.dart";
import "package:nexus/models/content/message.dart";
import "package:nexus/models/location.dart";
import "package:nexus/widgets/location/location_map.dart";
import "package:nexus/widgets/location/location_viewer_sheet.dart";
class const LocationMessage(final LocationMessageContent content, {super.key})
extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final point = content.point;
final description = content.description;
if (point == null) {
return Wrap(
spacing: 8,
children: [
Text(
"Invalid location:",
style: TextStyle(color: theme.colorScheme.error),
),
Text(content.body),
],
);
}
return Column(
crossAxisAlignment: .start,
spacing: 8,
children: [
if (description != null)
Text(description, style: theme.textTheme.titleSmall),
ConstrainedBox(
constraints: const .new(maxWidth: 400),
child: AspectRatio(
aspectRatio: 3 / 2,
child: ClipRRect(
borderRadius: .circular(12),
child: Stack(
children: [
LocationMap(point),
Positioned.fill(
child: Material(
type: .transparency,
child: InkWell(
onTap: () => context.showAdaptiveSheet(
enableDrag: false,
(_) => LocationViewerSheet(
point,
type: content.assetType,
description: description,
),
),
),
),
),
],
),
),
),
),
Text(point.formatted, style: theme.textTheme.labelSmall),
],
);
}
}