diff options
| author | mirror <mirror@localhost> | 2026-11-22 08:41:00 +0900 |
|---|---|---|
| committer | mirror <mirror@localhost> | 2026-11-22 08:41:00 +0900 |
| commit | 449d8b74bd6d9dae98a07254cdfad677b920e7b0 (patch) | |
| tree | c131c3528c4d517f56e19b854a7453fedb097d40 /lib/widgets/map/date_row.dart | |
| download | aves-src-master.tar.gz aves-src-master.zip | |
Diffstat (limited to 'lib/widgets/map/date_row.dart')
| -rw-r--r-- | lib/widgets/map/date_row.dart | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/widgets/map/date_row.dart b/lib/widgets/map/date_row.dart new file mode 100644 index 0000000..d83e715 --- /dev/null +++ b/lib/widgets/map/date_row.dart @@ -0,0 +1,41 @@ +import 'package:aves/model/entry/entry.dart'; +import 'package:aves/theme/format.dart'; +import 'package:aves/theme/icons.dart'; +import 'package:aves/theme/text.dart'; +import 'package:aves/widgets/common/extensions/build_context.dart'; +import 'package:aves/widgets/map/info_row.dart'; +import 'package:flutter/material.dart'; + +class MapDateRow extends StatelessWidget { + final AvesEntry? entry; + + const MapDateRow({ + super.key, + required this.entry, + }); + + @override + Widget build(BuildContext context) { + final use24hour = MediaQuery.alwaysUse24HourFormatOf(context); + + final date = entry?.bestDate; + final dateText = date != null ? formatDateTime(date, context.locale, use24hour) : AText.valueNotAvailable; + return Text.rich( + TextSpan( + children: [ + WidgetSpan( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: MapInfoRow.iconPadding), + child: Icon(AIcons.date, size: MapInfoRow.getIconSize(context)), + ), + alignment: PlaceholderAlignment.middle, + ), + TextSpan(text: dateText), + ], + ), + softWrap: false, + overflow: TextOverflow.fade, + maxLines: 1, + ); + } +} |
