diff --git a/client/assets/images/logo.png b/client/assets/images/logo.png new file mode 100644 index 00000000..3ee7ff45 Binary files /dev/null and b/client/assets/images/logo.png differ diff --git a/client/lib/ui/app/nav_list.dart b/client/lib/ui/app/nav_list.dart index f493da93..d98b9a16 100644 --- a/client/lib/ui/app/nav_list.dart +++ b/client/lib/ui/app/nav_list.dart @@ -20,107 +20,140 @@ class NavList extends StatelessWidget { @override Widget build(BuildContext context) { final account = context.read(); - return SingleChildScrollView( + // final color = Theme.of(context).colorScheme.onSurface; + return SafeArea( child: Column( - crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (showFab) - Padding( - padding: const EdgeInsets.all(16), - child: PopupMenuButton( - tooltip: 'Create', - position: PopupMenuPosition.under, - itemBuilder: (context) => [ - for (final action in getCreateActions(context)) - if (action == null) - const PopupMenuItem(enabled: false, height: 16, child: Divider()) - else - PopupMenuItem( - child: Text(action.descripiton), onTap: () => Actions.maybeInvoke(context, action.intent)), - ], - child: FloatingActionButton.extended( - icon: const Icon(Icons.add), - label: const Text('New'), - elevation: 0, - enableFeedback: false, - onPressed: null), - ), - ), - ListTile( - leading: const Icon(Icons.home), - title: const Text('Home'), - onTap: () => Actions.maybeInvoke(context, NavIntent(target: ExplorerPageHome(context.read()))), - ), - ListTile( - leading: const Icon(Icons.history), - title: const Text('Recents'), - onTap: () => context.read().go(ExplorerPageRecents()), - ), - ListTile( - leading: const Icon(Icons.people_outlined), - title: const Text('Shared With Me'), - onTap: () => context.read().go(ExplorerPageShared()), - ), - StreamBuilder>( - stream: account.db.selectBookmarks().watch(), - initialData: const [], - builder: (context, snapshot) { - return Theme( - data: Theme.of(context).copyWith(dividerColor: Colors.transparent), - child: ExpansionTile( - title: Text('Bookmarks'), - leading: Icon(Icons.bookmark), - initiallyExpanded: true, - children: (snapshot.data ?? const []) - .map((b) => ListTile( - title: Text(b.name), - leading: Icon(null), - onTap: () async { - if (b.dir) { - Actions.maybeInvoke( - context, NavIntent(target: ExplorerPageFolder(folderId: b.resourceId))); - return; - } - final resource = await account.db.getResource(b.resourceId); - if (!context.mounted) return; - if (resource == null) { - final nav = Navigator.of(context); - showProgressDialog(context, title: 'Downloading ${b.name}'); - final success = await account.resourceRepository - .requestResource(b.resourceId) - .then((result) => result is ApiSuccessResponse); - nav.pop(); - if (!success) { - if (context.mounted) { - showAlertDialog(context, title: 'Unable to get file info'); - } - return; - } - } - if (resource != null && context.mounted) { - Actions.maybeInvoke(context, OpenResourceIntent(resource)); - } - }, - )) - .toList(growable: false), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 12.0), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + const Padding( + padding: EdgeInsets.only(right: 6.0), + child: Image( + image: AssetImage('assets/images/logo.png'), + height: 36, + width: 36, + fit: BoxFit.contain, + ), ), - ); - }, - ), - ListTile( - leading: const Icon(Icons.delete), - title: const Text('Trash'), - onTap: () => context.read().go(ExplorerPageTrash()), + Text('PHYLUM', style: Theme.of(context).textTheme.headlineSmall + // style: TextStyle( + // color: color, + // ), + ), + ], + ), ), const Divider(), - if (!kIsWeb) const DownloadButton(), - const ServerStatusButton(), - ListTile( - leading: const Icon(Icons.settings), - title: const Text('Settings'), - onTap: () { - context.read().logOut(); - }, + Expanded( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (showFab) + Padding( + padding: const EdgeInsets.all(16), + child: PopupMenuButton( + tooltip: 'Create', + position: PopupMenuPosition.under, + itemBuilder: (context) => [ + for (final action in getCreateActions(context)) + if (action == null) + const PopupMenuItem(enabled: false, height: 16, child: Divider()) + else + PopupMenuItem( + child: Text(action.descripiton), + onTap: () => Actions.maybeInvoke(context, action.intent)), + ], + child: FloatingActionButton.extended( + icon: const Icon(Icons.add), + label: const Text('New'), + elevation: 0, + enableFeedback: false, + onPressed: null), + ), + ), + ListTile( + leading: const Icon(Icons.home), + title: const Text('Home'), + onTap: () => Actions.maybeInvoke(context, NavIntent(target: ExplorerPageHome(context.read()))), + ), + ListTile( + leading: const Icon(Icons.history), + title: const Text('Recents'), + onTap: () => context.read().go(ExplorerPageRecents()), + ), + ListTile( + leading: const Icon(Icons.people_outlined), + title: const Text('Shared With Me'), + onTap: () => context.read().go(ExplorerPageShared()), + ), + StreamBuilder>( + stream: account.db.selectBookmarks().watch(), + initialData: const [], + builder: (context, snapshot) { + return Theme( + data: Theme.of(context).copyWith(dividerColor: Colors.transparent), + child: ExpansionTile( + title: Text('Bookmarks'), + leading: Icon(Icons.bookmark), + initiallyExpanded: true, + children: (snapshot.data ?? const []) + .map((b) => ListTile( + title: Text(b.name), + leading: Icon(null), + onTap: () async { + if (b.dir) { + Actions.maybeInvoke( + context, NavIntent(target: ExplorerPageFolder(folderId: b.resourceId))); + return; + } + final resource = await account.db.getResource(b.resourceId); + if (!context.mounted) return; + if (resource == null) { + final nav = Navigator.of(context); + showProgressDialog(context, title: 'Downloading ${b.name}'); + final success = await account.resourceRepository + .requestResource(b.resourceId) + .then((result) => result is ApiSuccessResponse); + nav.pop(); + if (!success) { + if (context.mounted) { + showAlertDialog(context, title: 'Unable to get file info'); + } + return; + } + } + if (resource != null && context.mounted) { + Actions.maybeInvoke(context, OpenResourceIntent(resource)); + } + }, + )) + .toList(growable: false), + ), + ); + }, + ), + ListTile( + leading: const Icon(Icons.delete), + title: const Text('Trash'), + onTap: () => context.read().go(ExplorerPageTrash()), + ), + const Divider(), + if (!kIsWeb) const DownloadButton(), + const ServerStatusButton(), + ListTile( + leading: const Icon(Icons.settings), + title: const Text('Settings'), + onTap: () { + context.read().logOut(); + }, + ), + ], + ), + ), ), ], ), diff --git a/client/pubspec.yaml b/client/pubspec.yaml index d43213b6..aa303992 100644 --- a/client/pubspec.yaml +++ b/client/pubspec.yaml @@ -49,4 +49,7 @@ dev_dependencies: build_runner: ^2.4.12 flutter: - uses-material-design: true \ No newline at end of file + uses-material-design: true + + assets: + - assets/images/logo.png \ No newline at end of file