added bookmarks page
This commit is contained in:
35
lib/pages/bookmarks_page.dart
Normal file
35
lib/pages/bookmarks_page.dart
Normal file
@@ -0,0 +1,35 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../service/bookmarks_provider.dart';
|
||||
import '../service/storage.dart';
|
||||
|
||||
class BookmarksPage extends StatelessWidget {
|
||||
const BookmarksPage({super.key});
|
||||
|
||||
static const String routeName = '/bookmarks';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (BookmarksProvider.selectedCollectionId == null) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
final bookmarks = Storage.loadBookmarksForCollection(
|
||||
BookmarksProvider.selectedCollectionId!,
|
||||
);
|
||||
|
||||
BookmarksProvider.selectedCollectionId == null;
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
Storage.loadCollections()
|
||||
.firstWhere((c) => c.id == BookmarksProvider.selectedCollectionId)
|
||||
.name,
|
||||
),
|
||||
),
|
||||
body: ListView(
|
||||
children: bookmarks.map((e) => ListTile(title: Text(e.name))).toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user