Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu Settings and favorite button #12

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.0+3\\\\","dependencies":[]}],"android":[{"name":"path_provider","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.0+3\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.5\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.0+3\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.1.5\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.0.5\\\\","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2022-02-08 17:19:22.670048","version":"2.10.0"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider","path":"D:\\\\tools\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\tools\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.0+3\\\\","dependencies":[]}],"android":[{"name":"path_provider","path":"D:\\\\tools\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\tools\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.0+3\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"D:\\\\tools\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.5\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\tools\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.0+3\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"D:\\\\tools\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.1.5\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"D:\\\\tools\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.0.5\\\\","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2022-04-03 02:05:10.429143","version":"2.10.3"}
6 changes: 6 additions & 0 deletions lib/screens/note_detail.dart
Expand Up @@ -3,6 +3,7 @@ import 'package:intl/intl.dart';
import 'package:notes_app/db_helper/db_helper.dart';
import 'package:notes_app/modal_class/notes.dart';
import 'package:notes_app/utils/widgets.dart';
import 'package:favorite_button/favorite_button.dart';

class NoteDetail extends StatefulWidget {
final String appBarTitle;
Expand Down Expand Up @@ -53,6 +54,11 @@ class NoteDetailState extends State<NoteDetail> {
isEdited ? showDiscardDialog(context) : moveToLastScreen();
}),
actions: <Widget>[
StarButton(
isStarred: false,
valueChanged: (_isStarred) {
},
),
IconButton(
splashRadius: 22,
icon: const Icon(
Expand Down
51 changes: 49 additions & 2 deletions lib/screens/note_list.dart
Expand Up @@ -7,6 +7,8 @@ import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:notes_app/screens/search_note.dart';
import 'package:notes_app/utils/widgets.dart';
import 'package:sqflite/sqflite.dart';
import 'package:notes_app/main.dart';
import 'package:settings_ui/settings_ui.dart';

class NoteList extends StatefulWidget {
const NoteList({Key key}) : super(key: key);
Expand Down Expand Up @@ -73,6 +75,52 @@ class NoteListState extends State<NoteList> {

return Scaffold(
appBar: myAppBar(),
endDrawer: Drawer(
child: Container(
child: SettingsList(
sections: [
SettingsSection(
title: const Text('Settings'),
tiles: [
SettingsTile(
title: const Text('Language'),
description: const Text('English'),
leading: const Icon(Icons.language),
onPressed: (BuildContext context) {},
),
SettingsTile.switchTile(
title: const Text('Use System Theme'),
leading: const Icon(Icons.phone_android),
enabled: true,
onToggle: (value) {
setState(() {
//isSwitched = value;
});
},
),
],
),
SettingsSection(
title: const Text('Security'),
tiles: [
SettingsTile(
title: const Text('Security'),
description: const Text('Fingerprint'),
leading: const Icon(Icons.lock),
onPressed: (BuildContext context) {},
),
SettingsTile.switchTile(
title: const Text('Use fingerprint'),
leading: const Icon(Icons.fingerprint),
enabled: true,
onToggle: (value) {},
),
],
),
],
),
),
),
body: noteList.isEmpty
? Container(
color: Colors.white,
Expand Down Expand Up @@ -145,8 +193,7 @@ class NoteListState extends State<NoteList> {
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
child: Text(
noteList[index].description ?? '',
child: Text(noteList[index].description ?? '',
style: Theme.of(context).textTheme.bodyText1),
)
],
Expand Down
14 changes: 14 additions & 0 deletions pubspec.lock
Expand Up @@ -71,6 +71,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
favorite_button:
dependency: "direct main"
description:
name: favorite_button
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4"
ffi:
dependency: transitive
description:
Expand Down Expand Up @@ -228,6 +235,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.4"
settings_ui:
dependency: "direct main"
description:
name: settings_ui
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
sky_engine:
dependency: transitive
description: flutter
Expand Down
2 changes: 2 additions & 0 deletions pubspec.yaml
Expand Up @@ -13,6 +13,8 @@ dependencies:
path_provider: 2.0.1
intl: 0.17.0
flutter_staggered_grid_view: 0.4.0
settings_ui: ^2.0.2
favorite_button: ^0.0.4

dev_dependencies:
flutter_test:
Expand Down