4 Commits

Author SHA1 Message Date
06a76afc42 Merge pull request 'Theme changes' (#4) from development into main
All checks were successful
Flutter APK Build / Build Flutter APK (push) Successful in 6m46s
Reviewed-on: #4
2026-01-21 16:38:03 +01:00
3032e13dc9 Added dismiss button
Some checks failed
Flutter APK Build / Build Flutter APK (pull_request) Has been cancelled
2026-01-21 16:37:03 +01:00
d0492b2f79 changed snackbar styling 2026-01-21 16:31:43 +01:00
c2506fab7a refactored code so change in bookmark count is visible immediately 2026-01-21 16:30:30 +01:00
2 changed files with 29 additions and 9 deletions

View File

@@ -21,7 +21,7 @@ class CollectionsListPage extends StatefulWidget {
class _CollectionsListPageState extends State<CollectionsListPage> {
bool addingNewBookmark = false;
final bookmarkCountMap = Storage.loadPerCollectionBookmarkCount();
var bookmarkCountMap = <int, int>{};
Widget bottomSheetBuilder(BuildContext context) {
final titleTextFieldController = TextEditingController(
@@ -84,8 +84,9 @@ class _CollectionsListPageState extends State<CollectionsListPage> {
@override
Widget build(BuildContext context) {
final collections = Storage.loadCollections();
final provider = context.watch<SharedLinkProvider>();
addingNewBookmark = provider.currentMapsLinkMetadata != null;
bookmarkCountMap = Storage.loadPerCollectionBookmarkCount();
addingNewBookmark =
context.watch<SharedLinkProvider>().currentMapsLinkMetadata != null;
return Scaffold(
appBar: AppBar(
title: addingNewBookmark
@@ -94,7 +95,8 @@ class _CollectionsListPageState extends State<CollectionsListPage> {
actions: [
if (addingNewBookmark)
TextButton(
onPressed: () => provider.removeCurrentMapsLink(),
onPressed: () =>
context.read<SharedLinkProvider>().removeCurrentMapsLink(),
child: Text(AppLocalizations.of(context)!.cancel),
)
else

View File

@@ -8,13 +8,31 @@ class Notifying {
required String text,
bool isError = false,
}) {
ScaffoldMessenger.of(context).hideCurrentSnackBar();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
text,
style: isError
? TextStyle(color: Theme.of(context).colorScheme.error)
: null,
backgroundColor: Theme.of(context).colorScheme.error,
content: SizedBox(
height: 30,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
text,
style: isError
? TextStyle(color: Theme.of(context).colorScheme.onError)
: null,
),
IconButton(
onPressed: () =>
ScaffoldMessenger.of(context).hideCurrentSnackBar(),
icon: Icon(
Icons.close_rounded,
color: Theme.of(context).colorScheme.onError,
),
),
],
),
),
),
);