This commit is contained in:
toly
2023-10-23 10:17:40 +08:00
parent bcba7ebae2
commit e26099ac18
50 changed files with 3616 additions and 135 deletions

View File

@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:iroute/components/toly_ui/toly_ui.dart';
import 'package:iroute/components/components.dart';
import '../router/app_router_delegate.dart';
class AppNavigationRail extends StatefulWidget {
@@ -10,11 +10,12 @@ class AppNavigationRail extends StatefulWidget {
}
class _AppNavigationRailState extends State<AppNavigationRail> {
final List<NavigationRailDestination> destinations = const [
NavigationRailDestination(icon: Icon(Icons.color_lens_outlined), label: Text("颜色板")),
NavigationRailDestination(icon: Icon(Icons.add_chart), label: Text("计数器")),
NavigationRailDestination(icon: Icon(Icons.person), label: Text("我的")),
NavigationRailDestination(icon: Icon(Icons.settings), label: Text("设置")),
final List<MenuMeta> deskNavBarMenus = const [
MenuMeta(label: '颜色板', icon: Icons.color_lens_outlined),
MenuMeta(label: '计数器', icon: Icons.add_chart),
MenuMeta(label: '我的', icon: Icons.person),
MenuMeta(label: '设置', icon: Icons.settings),
];
@override
@@ -31,23 +32,19 @@ class _AppNavigationRailState extends State<AppNavigationRail> {
@override
Widget build(BuildContext context) {
return TolyNavigationRail(
leading: Padding(
padding: const EdgeInsets.symmetric(vertical: 18.0),
child: FlutterLogo(),
return DragToMoveWrap(
child: TolyNavigationRail(
items: deskNavBarMenus,
leading: const Padding(
padding: EdgeInsets.symmetric(vertical: 18.0),
child: FlutterLogo(),
),
backgroundColor: const Color(0xff3975c6),
onDestinationSelected: _onDestinationSelected,
selectedIndex: router.activeIndex,
),
backgroundColor: const Color(0xff3975c6),
onDestinationSelected: _onDestinationSelected,
selectedIndex: router.activeIndex,
);
// return NavigationRail(
// backgroundColor: Colors.transparent,
// labelType: NavigationRailLabelType.all,
// onDestinationSelected: _onDestinationSelected,
// destinations: destinations,
// selectedIndex: router.activeIndex,
// );
}
void _onDestinationSelected(int index) {