mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-01 04:07:53 +08:00
Expose the Folders view
This adds a new 'Folders' screen which shows you all your folders and lets you manage the notes inside them. It currently doesn't allow you to add or remove Folders, though. This nearly addresses #18
This commit is contained in:
@ -20,6 +20,7 @@ import 'package:dynamic_theme/dynamic_theme.dart';
|
|||||||
|
|
||||||
import 'screens/githostsetup_screens.dart';
|
import 'screens/githostsetup_screens.dart';
|
||||||
import 'screens/onboarding_screens.dart';
|
import 'screens/onboarding_screens.dart';
|
||||||
|
import 'screens/folder_listing.dart';
|
||||||
|
|
||||||
class JournalApp extends StatelessWidget {
|
class JournalApp extends StatelessWidget {
|
||||||
static Future main(SharedPreferences pref) async {
|
static Future main(SharedPreferences pref) async {
|
||||||
@ -120,6 +121,7 @@ class JournalApp extends StatelessWidget {
|
|||||||
initialRoute: initialRoute,
|
initialRoute: initialRoute,
|
||||||
routes: {
|
routes: {
|
||||||
'/': (context) => HomeScreen(),
|
'/': (context) => HomeScreen(),
|
||||||
|
'/folders': (context) => FolderListingScreen(),
|
||||||
'/settings': (context) => SettingsScreen(),
|
'/settings': (context) => SettingsScreen(),
|
||||||
'/setupRemoteGit': (context) =>
|
'/setupRemoteGit': (context) =>
|
||||||
GitHostSetupScreen(stateContainer.completeGitHostSetup),
|
GitHostSetupScreen(stateContainer.completeGitHostSetup),
|
||||||
|
@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:gitjournal/state_container.dart';
|
import 'package:gitjournal/state_container.dart';
|
||||||
|
|
||||||
import 'journal_listing.dart';
|
import 'journal_listing.dart';
|
||||||
import 'folder_listing.dart';
|
|
||||||
|
|
||||||
class HomeScreen extends StatelessWidget {
|
class HomeScreen extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
@ -10,7 +9,6 @@ class HomeScreen extends StatelessWidget {
|
|||||||
final container = StateContainer.of(context);
|
final container = StateContainer.of(context);
|
||||||
final appState = container.appState;
|
final appState = container.appState;
|
||||||
|
|
||||||
return JournalListingScreen(noteFolder: appState.noteFolder);
|
return JournalListingScreen(notesFolder: appState.notesFolder);
|
||||||
// return FolderListingScreen();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,31 @@ class AppDrawer extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
setupGitButton,
|
setupGitButton,
|
||||||
|
ListTile(
|
||||||
|
leading: Icon(Icons.note, color: textStyle.color),
|
||||||
|
title: Text('Notes', style: textStyle),
|
||||||
|
onTap: () {
|
||||||
|
var m = ModalRoute.of(context);
|
||||||
|
if (m.settings.name == "/") {
|
||||||
|
Navigator.pop(context);
|
||||||
|
} else {
|
||||||
|
Navigator.pop(context);
|
||||||
|
Navigator.pushReplacementNamed(context, '/');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: Icon(Icons.folder, color: textStyle.color),
|
||||||
|
title: Text('Folders', style: textStyle),
|
||||||
|
onTap: () {
|
||||||
|
var m = ModalRoute.of(context);
|
||||||
|
if (m.settings.name == "/folders") {
|
||||||
|
Navigator.pop(context);
|
||||||
|
} else {
|
||||||
|
Navigator.popAndPushNamed(context, "/folders");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: Icon(Icons.share, color: textStyle.color),
|
leading: Icon(Icons.share, color: textStyle.color),
|
||||||
title: Text('Share App', style: textStyle),
|
title: Text('Share App', style: textStyle),
|
||||||
|
Reference in New Issue
Block a user