diff --git a/lib/screens/home.dart b/lib/screens/home.dart index 0f9c761..17e22ba 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -5,7 +5,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_markdown/flutter_markdown.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:navigation_rail/navigation_rail.dart'; import 'package:ccxgui/bloc/process_bloc/process_bloc.dart'; import 'package:ccxgui/bloc/updater_bloc/updater_bloc.dart'; @@ -75,66 +74,93 @@ class _HomeState extends State { context, 'You are already on the latest version'); } }, - child: NavRail( - desktopBreakpoint: 1150, - hideTitleBar: true, - drawerHeaderBuilder: (context) { - return Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - DrawerHeader( - child: SvgPicture.asset( + child: Row( + children: [ + NavigationRail( + selectedIndex: _currentIndex, + extended: true, + onDestinationSelected: (int index) { + setState(() { + _currentIndex = index; + }); + }, + selectedLabelTextStyle: TextStyle( + color: Theme.of(context).colorScheme.secondary, + ), + unselectedIconTheme: IconThemeData( + color: Colors.white54, + ), + unselectedLabelTextStyle: TextStyle( + color: Colors.white54, + ), + selectedIconTheme: IconThemeData( + color: Theme.of(context).colorScheme.secondary, + ), + useIndicator: false, + leading: Column( + children: [ + SizedBox( + height: 20, + ), + SvgPicture.asset( logo, semanticsLabel: 'CCExtractor Logo', + height: 80, ), + _CheckForUpdatesButton(), + ], + ), + destinations: [ + NavigationRailDestination( + padding: EdgeInsets.only(top: 6), + icon: Icon(Icons.dashboard), + selectedIcon: Icon(Icons.dashboard), + label: Text('Dashboard'), + ), + NavigationRailDestination( + padding: EdgeInsets.only(top: 6), + icon: Icon(Icons.settings), + selectedIcon: Icon(Icons.settings), + label: Text('Basic Settings'), + ), + NavigationRailDestination( + padding: EdgeInsets.only(top: 6), + icon: Icon(Icons.input), + selectedIcon: Icon(Icons.input), + label: Text('Input Settings'), + ), + NavigationRailDestination( + padding: EdgeInsets.only(top: 6), + icon: Icon(Icons.dvr_outlined), + selectedIcon: Icon(Icons.dvr_outlined), + label: Text('Output Settings'), + ), + NavigationRailDestination( + padding: EdgeInsets.only(top: 6), + icon: Icon(Icons.search), + selectedIcon: Icon(Icons.search), + label: Text('HardSubx Settings'), + ), + NavigationRailDestination( + padding: EdgeInsets.only(top: 6), + icon: Icon(Icons.do_disturb_alt_rounded), + selectedIcon: Icon(Icons.do_disturb_alt_rounded), + label: Text('Obscure Settings'), ), - _CheckForUpdatesButton() ], - ); - }, - currentIndex: _currentIndex, - onTap: (val) { - if (mounted && _currentIndex != val) { - setState(() { - _currentIndex = val; - }); - } - }, - body: IndexedStack( - index: _currentIndex, - children: [ - Dashboard(), - BasicSettingsScreen(), - InputSettingsScreen(), - OutputSettingsScreen(), - HardSubxSettingsScreen(), - ObscureSettingsScreen(), - ], - ), - tabs: [ - BottomNavigationBarItem( - label: 'Dashboard', - icon: Icon(Icons.dashboard), - ), - BottomNavigationBarItem( - label: 'Basic Settings', - icon: Icon(Icons.settings), ), - BottomNavigationBarItem( - label: 'Input Settings', - icon: Icon(Icons.input), - ), - BottomNavigationBarItem( - label: 'Output Settings', - icon: Icon(Icons.dvr_outlined), - ), - BottomNavigationBarItem( - label: 'HardSubx Settings', - icon: Icon(Icons.search), - ), - BottomNavigationBarItem( - label: 'Obscure Settings', - icon: Icon(Icons.do_disturb_alt_rounded), + Expanded( + child: IndexedStack( + index: _currentIndex, + children: [ + Dashboard(), + BasicSettingsScreen(), + InputSettingsScreen(), + OutputSettingsScreen(), + HardSubxSettingsScreen(), + ObscureSettingsScreen(), + ], + ), ), ], ), diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 7af3dc6..3097ae0 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -203,7 +203,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 33CC10EC2044A3C60003C045 = { diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index d7f6103..a48cb40 100644 --- a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ =2.18.0 <3.0.0" + dart: ">=3.3.0 <4.0.0" flutter: ">=2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index ca4218b..4f364e7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -26,9 +26,6 @@ dependencies: localstorage: git: url: https://git@github.com/Techno-Disaster/flutter_localstorage.git - navigation_rail: - git: - url: https://git@github.com/Techno-Disaster/navigation_rail.git path_provider: ^2.0.2 percent_indicator: ^3.0.1 url_launcher: ^6.0.9 @@ -38,7 +35,7 @@ dependencies: path: plugins/window_size provider: ^6.0.3 platform: ^3.1.0 - desktop_drop: ^0.4.0 + desktop_drop: ^0.4.4 file: ^6.1.4 pedantic: ^1.11.1 @@ -46,7 +43,7 @@ dev_dependencies: flutter_test: sdk: flutter build_runner: ^2.1.0 - hive_generator: ^1.1.0 + hive_generator: ^2.0.1 import_sorter: ^4.6.0 flutter: