Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 06a76afc42 | |||
| 3032e13dc9 | |||
| d0492b2f79 | |||
| c2506fab7a |
@@ -21,7 +21,7 @@ class CollectionsListPage extends StatefulWidget {
|
|||||||
|
|
||||||
class _CollectionsListPageState extends State<CollectionsListPage> {
|
class _CollectionsListPageState extends State<CollectionsListPage> {
|
||||||
bool addingNewBookmark = false;
|
bool addingNewBookmark = false;
|
||||||
final bookmarkCountMap = Storage.loadPerCollectionBookmarkCount();
|
var bookmarkCountMap = <int, int>{};
|
||||||
|
|
||||||
Widget bottomSheetBuilder(BuildContext context) {
|
Widget bottomSheetBuilder(BuildContext context) {
|
||||||
final titleTextFieldController = TextEditingController(
|
final titleTextFieldController = TextEditingController(
|
||||||
@@ -84,8 +84,9 @@ class _CollectionsListPageState extends State<CollectionsListPage> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final collections = Storage.loadCollections();
|
final collections = Storage.loadCollections();
|
||||||
final provider = context.watch<SharedLinkProvider>();
|
bookmarkCountMap = Storage.loadPerCollectionBookmarkCount();
|
||||||
addingNewBookmark = provider.currentMapsLinkMetadata != null;
|
addingNewBookmark =
|
||||||
|
context.watch<SharedLinkProvider>().currentMapsLinkMetadata != null;
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: addingNewBookmark
|
title: addingNewBookmark
|
||||||
@@ -94,7 +95,8 @@ class _CollectionsListPageState extends State<CollectionsListPage> {
|
|||||||
actions: [
|
actions: [
|
||||||
if (addingNewBookmark)
|
if (addingNewBookmark)
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => provider.removeCurrentMapsLink(),
|
onPressed: () =>
|
||||||
|
context.read<SharedLinkProvider>().removeCurrentMapsLink(),
|
||||||
child: Text(AppLocalizations.of(context)!.cancel),
|
child: Text(AppLocalizations.of(context)!.cancel),
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -8,14 +8,32 @@ class Notifying {
|
|||||||
required String text,
|
required String text,
|
||||||
bool isError = false,
|
bool isError = false,
|
||||||
}) {
|
}) {
|
||||||
|
ScaffoldMessenger.of(context).hideCurrentSnackBar();
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(
|
backgroundColor: Theme.of(context).colorScheme.error,
|
||||||
|
content: SizedBox(
|
||||||
|
height: 30,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
text,
|
text,
|
||||||
style: isError
|
style: isError
|
||||||
? TextStyle(color: Theme.of(context).colorScheme.error)
|
? TextStyle(color: Theme.of(context).colorScheme.onError)
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () =>
|
||||||
|
ScaffoldMessenger.of(context).hideCurrentSnackBar(),
|
||||||
|
icon: Icon(
|
||||||
|
Icons.close_rounded,
|
||||||
|
color: Theme.of(context).colorScheme.onError,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user