Skip to content

Commit

Permalink
Add color highlight on history locations
Browse files Browse the repository at this point in the history
  • Loading branch information
wangwillian0 committed May 29, 2023
1 parent a0455a5 commit 9d23c6a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/history/accessory_history.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ class _AccessoryHistoryState extends State<AccessoryHistory> {
}

void _onCircleTapped(Circle circle) {
final originalCircleColor = circle.options.circleColor;
_mapController!.updateCircle(circle, CircleOptions(circleColor: Colors.green.toHexStringRGB()));

final snackBar = SnackBar(
content: Text(
'${circle.data!['time'].toLocal().toString().substring(0, 19)}\n'
Expand All @@ -90,7 +93,9 @@ class _AccessoryHistoryState extends State<AccessoryHistory> {
),
backgroundColor: Theme.of(context).primaryColor);
ScaffoldMessenger.of(context).clearSnackBars();
ScaffoldMessenger.of(context).showSnackBar(snackBar);
ScaffoldMessenger.of(context).showSnackBar(snackBar).closed.then((_) {
_mapController!.updateCircle(circle, CircleOptions(circleColor: originalCircleColor));
});
}

@override
Expand Down

0 comments on commit 9d23c6a

Please sign in to comment.