This commit is contained in:
toly
2023-10-24 12:17:11 +08:00
parent 8a95ed4417
commit 9313882748
27 changed files with 988 additions and 732 deletions

View File

@@ -7,6 +7,7 @@ import '../../../pages/color/color_detail_page.dart';
import '../../../pages/color/color_page.dart';
import '../../../pages/empty/empty_page.dart';
import '../../../pages/settings/settings_page.dart';
import '../../../pages/user/user_page.dart';
import '../../../pages/counter/counter_page.dart';
import '../../../pages/sort/sort_page.dart';
import '../transition/fade_transition_page.dart';
@@ -15,6 +16,7 @@ import '../../../pages/color/color_add_page.dart';
const List<String> kDestinationsPaths = [
'/color',
'/counter',
'/sort',
'/user',
'/settings',
];
@@ -29,8 +31,9 @@ class AppRouterDelegate extends RouterDelegate<Object> with ChangeNotifier {
int? get activeIndex {
if(path.startsWith('/color')) return 0;
if(path.startsWith('/counter')) return 1;
if(path.startsWith('/user')) return 2;
if(path.startsWith('/settings')) return 3;
if(path.startsWith('/sort')) return 2;
if(path.startsWith('/user')) return 3;
if(path.startsWith('/settings')) return 4;
return null;
}
@@ -95,9 +98,13 @@ class AppRouterDelegate extends RouterDelegate<Object> with ChangeNotifier {
child = const CounterPage();
}
if (path == kDestinationsPaths[2]) {
child = const SortPage();
child = LayoutBuilder(
builder: (_,cts)=> SortPage(size: Size(cts.maxWidth,cts.maxHeight),));
}
if (path == kDestinationsPaths[3]) {
child = const UserPage();
}
if (path == kDestinationsPaths[4]) {
child = const SettingPage();
}
return [

View File

@@ -1,4 +1,6 @@
import 'package:flutter/material.dart';
import 'package:iroute/v5/pages/sort/provider/sort_config.dart';
import '../../../pages/sort/sort_setting.dart';
import '../router/app_router_delegate.dart';
import 'app_navigation_rail.dart';
import 'app_top_bar.dart';
@@ -10,6 +12,9 @@ class AppNavigation extends StatelessWidget {
Widget build(BuildContext context) {
double px1 = 1/View.of(context).devicePixelRatio;
return Scaffold(
endDrawer: Drawer(
child: SortSettings(config: sortConfig.value,),
),
body: Row(
children: [
const AppNavigationRail(),

View File

@@ -14,6 +14,7 @@ class _AppNavigationRailState extends State<AppNavigationRail> {
final List<MenuMeta> deskNavBarMenus = const [
MenuMeta(label: '颜色板', icon: Icons.color_lens_outlined),
MenuMeta(label: '计数器', icon: Icons.add_chart),
MenuMeta(label: '排序', icon: Icons.sort),
MenuMeta(label: '我的', icon: Icons.person),
MenuMeta(label: '设置', icon: Icons.settings),
];

View File

@@ -1,6 +1,9 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:iroute/components/toly_ui/button/hover_icon_button.dart';
import 'package:iroute/components/toly_ui/popable/drop_selectable_widget.dart';
import 'package:iroute/v5/pages/sort/provider/sort_config.dart';
import '../../../pages/sort/functions.dart';
import '../router/app_router_delegate.dart';
class AppRouterEditor extends StatefulWidget {
@@ -36,6 +39,35 @@ class _AppRouterEditorState extends State<AppRouterEditor> {
@override
Widget build(BuildContext context) {
return Row(
children: [
DropSelectableWidget(
fontSize: 12,
data: sortNameMap.values.toList(),
iconSize: 20,
height: 30,
width: 200,
disableColor: const Color(0xff1F425F),
onDropSelected: (int index) async {
sortName.value=sortNameMap.keys.toList()[index];
// curveAnim = CurvedAnimation(
// parent: _ctrl, curve: maps.values.toList()[index]);
// _startAnim();
},
),
const SizedBox(width: 10,),
GestureDetector(
onTap: (){
Scaffold.of(context).openEndDrawer();
// showDialog(
// useRootNavigator: false,
// context: context, builder: (ctx)=>AlertDialog());
},
child: const Icon(Icons.settings))
],
);
return Stack(
alignment: Alignment.centerRight,
children: [

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:iroute/components/components.dart';
import '../../../pages/sort/functions.dart';
import '../router/app_router_delegate.dart';
import 'app_router_editor.dart';
@@ -20,7 +21,7 @@ class AppTopBar extends StatelessWidget {
child: Row(children: [
const Spacer(),
SizedBox(
width: 250,
// width: 200,
child: AppRouterEditor(
onSubmit: (path) => router.path = path,
)),
@@ -52,6 +53,7 @@ Map<String, String> kRouteLabelMap = {
'/color/detail': '颜色详情',
'/counter': '计数器',
'/user': '我的',
'/sort': '可视化排序',
'/settings': '系统设置',
};