-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
406 additions
and
19 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/// Flutter icons MyIcons | ||
/// Copyright (C) 2025 by original authors @ fluttericon.com, fontello.com | ||
/// This font was generated by FlutterIcon.com, which is derived from Fontello. | ||
/// | ||
/// To use this font, place it in your fonts/ directory and include the | ||
/// following in your pubspec.yaml | ||
/// | ||
/// flutter: | ||
/// fonts: | ||
/// - family: MyIcons | ||
/// fonts: | ||
/// - asset: fonts/MyIcons.ttf | ||
/// | ||
/// | ||
/// * Linearicons Free, Copyright (C) Linearicons.com | ||
/// Author: Perxis | ||
/// License: CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/) | ||
/// Homepage: https://linearicons.com | ||
/// | ||
import 'package:flutter/widgets.dart'; | ||
|
||
class MyIcons { | ||
MyIcons._(); | ||
|
||
static const _kFontFam = 'MyIcons'; | ||
static const String? _kFontPkg = null; | ||
|
||
static const IconData chevron_down = IconData(0xe874, fontFamily: _kFontFam, fontPackage: _kFontPkg); | ||
static const IconData chevron_right = IconData(0xe876, fontFamily: _kFontFam, fontPackage: _kFontPkg); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
|
||
import '../login.dart'; | ||
|
||
class AppDrawer extends ConsumerWidget { | ||
const AppDrawer({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
final loginNotifier = ref.watch(loginStateProvider.notifier); | ||
|
||
return Drawer( | ||
child: ListView( | ||
// Important: Remove any padding from the ListView. | ||
padding: EdgeInsets.zero, | ||
children: [ | ||
const DrawerHeader( | ||
child: Text('Cryptowl 0.1'), | ||
), | ||
ListTile( | ||
title: const Text('Backup'), | ||
onTap: () { | ||
// Update the state of the app. | ||
// ... | ||
}, | ||
), | ||
ListTile( | ||
title: const Text('Logout'), | ||
onTap: () async { | ||
await loginNotifier.logout(); | ||
}, | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import '../../my_icons_icons.dart'; | ||
|
||
class CategoryGroup extends StatelessWidget { | ||
final String name; | ||
|
||
const CategoryGroup({super.key, required this.name}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return InkWell( | ||
child: Row( | ||
children: [ | ||
Icon( | ||
MyIcons.chevron_right, | ||
size: 12, | ||
), | ||
Padding( | ||
padding: EdgeInsets.only(left: 10), | ||
child: Text( | ||
name, | ||
style: TextStyle( | ||
color: Colors.grey, | ||
), | ||
), | ||
), | ||
], | ||
), | ||
onTap: () {}, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class CategoryItem extends StatelessWidget { | ||
final String name; | ||
final IconData icon; | ||
final int count; | ||
|
||
const CategoryItem( | ||
{super.key, required this.name, required this.icon, required this.count}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
// TODO: implement build | ||
throw UnimplementedError(); | ||
return ListTile( | ||
dense: true, | ||
contentPadding: EdgeInsets.only(right: 10), | ||
visualDensity: VisualDensity(horizontal: 0, vertical: -4), | ||
leading: Icon(icon), | ||
title: Text(name), | ||
trailing: Text("$count"), | ||
onTap: () {}, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:riverpod_annotation/riverpod_annotation.dart'; | ||
|
||
import '../../domain/category.dart'; | ||
import '../../providers.dart'; | ||
import '../passwords.dart'; | ||
import 'category_group.dart'; | ||
import 'category_item.dart'; | ||
|
||
part 'password_categories.g.dart'; | ||
|
||
@riverpod | ||
Future<List<Category>> categories(Ref ref) async { | ||
return ref.watch(categoryRepositoryProvider).list(); | ||
} | ||
|
||
class PasswordCategories extends ConsumerWidget { | ||
const PasswordCategories({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
final categories = ref.watch(categoriesProvider); | ||
|
||
return SingleChildScrollView( | ||
child: Column( | ||
children: [ | ||
CategoryItem( | ||
name: "All items", | ||
icon: Icons.dashboard, | ||
count: 10, | ||
), | ||
CategoryItem( | ||
name: "Favourite", | ||
icon: Icons.favorite, | ||
count: 10, | ||
), | ||
CategoryItem( | ||
name: "Trash", | ||
icon: Icons.recycling, | ||
count: 10, | ||
), | ||
SizedBox(height: 15), | ||
CategoryGroup(name: "TYPES"), | ||
CategoryItem( | ||
name: "Login", | ||
icon: Icons.recycling, | ||
count: 10, | ||
), | ||
CategoryItem( | ||
name: "Card", | ||
icon: Icons.recycling, | ||
count: 10, | ||
), | ||
CategoryItem( | ||
name: "SSH Key", | ||
icon: Icons.recycling, | ||
count: 10, | ||
), | ||
SizedBox(height: 15), | ||
CategoryGroup(name: "CATEGORIES"), | ||
categories.when( | ||
data: (list) { | ||
return Column( | ||
children: [ | ||
...list.map((c) { | ||
return CategoryItem( | ||
name: c.name, | ||
icon: Icons.folder_outlined, | ||
count: 10, | ||
); | ||
}) | ||
], | ||
); | ||
}, | ||
loading: () => const Center( | ||
child: CircularProgressIndicator(), | ||
), | ||
error: (e, _) => ErrorWidget(e), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.