show timestamps for state events
This commit is contained in:
parent
f23a35384d
commit
cfab803fa0
4 changed files with 35 additions and 17 deletions
17
lib/widgets/timestamp.dart
Normal file
17
lib/widgets/timestamp.dart
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import "package:flutter/material.dart";
|
||||
import "package:timeago/timeago.dart";
|
||||
|
||||
class const Timestamp(final DateTime timestamp, {super.key})
|
||||
extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) => Tooltip(
|
||||
message: timestamp.toString(),
|
||||
child: Text(
|
||||
format(timestamp),
|
||||
maxLines: 1,
|
||||
overflow: .ellipsis,
|
||||
style: Theme.of(context).textTheme.labelSmall
|
||||
?.copyWith(color: Colors.grey),
|
||||
),
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue