36 lines
917 B
Dart
36 lines
917 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../service/bookmarks_provider.dart';
|
|
import '../service/storage.dart';
|
|
|
|
class CollectionPage extends StatelessWidget {
|
|
const CollectionPage({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(),
|
|
),
|
|
);
|
|
}
|
|
}
|