Compare commits
6 Commits
306a38a36a
...
v0.1.24
| Author | SHA1 | Date | |
|---|---|---|---|
| dca8c64555 | |||
| c80606b7d0 | |||
| be6020d6c5 | |||
| 5eb58d7cf2 | |||
| 1aaea5f6d9 | |||
| 3a54a077f3 |
@@ -102,10 +102,16 @@ class _CollectionPageState extends State<CollectionPage> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: ListView.builder(
|
body: Center(
|
||||||
|
child: SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.9,
|
||||||
|
child: ListView.separated(
|
||||||
itemBuilder: (context, index) =>
|
itemBuilder: (context, index) =>
|
||||||
bookmarksListItemBuilder(context, bookmarks.elementAt(index)),
|
bookmarksListItemBuilder(context, bookmarks.elementAt(index)),
|
||||||
itemCount: bookmarks.length,
|
itemCount: bookmarks.length,
|
||||||
|
separatorBuilder: (context, index) => SizedBox(height: 10),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
onPressed: onAddButtonPressed,
|
onPressed: onAddButtonPressed,
|
||||||
|
|||||||
@@ -110,12 +110,18 @@ class _CollectionsListPageState extends State<CollectionsListPage> {
|
|||||||
child: Icon(Icons.add),
|
child: Icon(Icons.add),
|
||||||
),
|
),
|
||||||
body: collections.isNotEmpty
|
body: collections.isNotEmpty
|
||||||
? ListView.builder(
|
? Center(
|
||||||
|
child: SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.9,
|
||||||
|
child: ListView.separated(
|
||||||
itemBuilder: (context, index) => collectionsListItemBuilder(
|
itemBuilder: (context, index) => collectionsListItemBuilder(
|
||||||
context,
|
context,
|
||||||
collections.elementAt(index),
|
collections.elementAt(index),
|
||||||
),
|
),
|
||||||
itemCount: collections.length,
|
itemCount: collections.length,
|
||||||
|
separatorBuilder: (context, index) => SizedBox(height: 10),
|
||||||
|
),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
: Center(
|
: Center(
|
||||||
child: Text(AppLocalizations.of(context)!.tipCreateCollections),
|
child: Text(AppLocalizations.of(context)!.tipCreateCollections),
|
||||||
|
|||||||
@@ -14,15 +14,22 @@ class SearchPage extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(title: Text(AppLocalizations.of(context)!.search)),
|
appBar: AppBar(title: Text(AppLocalizations.of(context)!.search)),
|
||||||
body: Column(
|
body: Center(
|
||||||
|
child: SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.9,
|
||||||
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
|
Padding(padding: EdgeInsetsGeometry.only(top: 10)),
|
||||||
SearchBarWidget(
|
SearchBarWidget(
|
||||||
onEditingComplete: context.read<SearchProvider>().setSearchText,
|
onEditingComplete: context.read<SearchProvider>().setSearchText,
|
||||||
onResetSearch: context.read<SearchProvider>().removeSearchText,
|
onResetSearch: context.read<SearchProvider>().removeSearchText,
|
||||||
),
|
),
|
||||||
|
Padding(padding: EdgeInsetsGeometry.only(top: 10)),
|
||||||
Expanded(child: SearchResultsWidget()),
|
Expanded(child: SearchResultsWidget()),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,26 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
ThemeData get lightTheme => ThemeData.from(colorScheme: _lightColorScheme);
|
const _seed = Colors.deepPurple;
|
||||||
|
|
||||||
ThemeData get darkTheme => ThemeData.from(colorScheme: _darkColorScheme);
|
ColorScheme get _lightColorScheme =>
|
||||||
|
ColorScheme.fromSeed(seedColor: _seed, brightness: Brightness.light);
|
||||||
|
|
||||||
ColorScheme get _darkColorScheme => ColorScheme.fromSeed(
|
ColorScheme get _darkColorScheme =>
|
||||||
seedColor: Colors.deepPurple,
|
ColorScheme.fromSeed(seedColor: _seed, brightness: Brightness.dark);
|
||||||
brightness: Brightness.dark,
|
|
||||||
);
|
|
||||||
|
|
||||||
ColorScheme get _lightColorScheme => ColorScheme.fromSeed(
|
ThemeData get lightTheme => _baseTheme(_lightColorScheme);
|
||||||
seedColor: Colors.deepPurple,
|
|
||||||
brightness: Brightness.light,
|
ThemeData get darkTheme => _baseTheme(_darkColorScheme);
|
||||||
);
|
|
||||||
|
ThemeData _baseTheme(ColorScheme scheme) =>
|
||||||
|
ThemeData.from(colorScheme: scheme, useMaterial3: true).copyWith(
|
||||||
|
inputDecorationTheme: InputDecorationTheme(
|
||||||
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
|
||||||
|
),
|
||||||
|
listTileTheme: ListTileThemeData(
|
||||||
|
tileColor: scheme.surfaceContainer,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadiusGeometry.circular(12),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|||||||
@@ -41,9 +41,7 @@ class CreateBookmarkCollectionDialog extends StatelessWidget {
|
|||||||
FilteringTextInputFormatter.deny(RegExp(r'\s\s+')),
|
FilteringTextInputFormatter.deny(RegExp(r'\s\s+')),
|
||||||
],
|
],
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
// TODO: Localize
|
|
||||||
labelText: AppLocalizations.of(context)!.collectionName,
|
labelText: AppLocalizations.of(context)!.collectionName,
|
||||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(10)),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
|
|||||||
@@ -61,9 +61,6 @@ class CreateBookmarkDialog extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: AppLocalizations.of(context)!.bookmarkTitle,
|
labelText: AppLocalizations.of(context)!.bookmarkTitle,
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextField(
|
TextField(
|
||||||
@@ -78,9 +75,6 @@ class CreateBookmarkDialog extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: AppLocalizations.of(context)!.url,
|
labelText: AppLocalizations.of(context)!.url,
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextField(
|
TextField(
|
||||||
@@ -95,9 +89,6 @@ class CreateBookmarkDialog extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: AppLocalizations.of(context)!.description,
|
labelText: AppLocalizations.of(context)!.description,
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../l10n/app_localizations.dart';
|
||||||
|
|
||||||
class SearchBarWidget extends StatelessWidget {
|
class SearchBarWidget extends StatelessWidget {
|
||||||
const SearchBarWidget({
|
const SearchBarWidget({
|
||||||
super.key,
|
super.key,
|
||||||
@@ -28,6 +30,7 @@ class SearchBarWidget extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
icon: Icon(Icons.delete_outline_outlined),
|
icon: Icon(Icons.delete_outline_outlined),
|
||||||
),
|
),
|
||||||
|
labelText: AppLocalizations.of(context)!.search,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,9 +47,10 @@ class _SearchResultsWidgetState extends State<SearchResultsWidget> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (filteredBookmarks.isNotEmpty) {
|
if (filteredBookmarks.isNotEmpty) {
|
||||||
return ListView.builder(
|
return ListView.separated(
|
||||||
itemBuilder: bookmarkListItemBuilder,
|
itemBuilder: bookmarkListItemBuilder,
|
||||||
itemCount: filteredBookmarks.length,
|
itemCount: filteredBookmarks.length,
|
||||||
|
separatorBuilder: (context, index) => SizedBox(height: 10),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Center(child: Text(AppLocalizations.of(context)!.tipNoResults));
|
return Center(child: Text(AppLocalizations.of(context)!.tipNoResults));
|
||||||
|
|||||||
Reference in New Issue
Block a user