Chat basis

This commit is contained in:
2024-05-26 01:21:08 +08:00
parent 657f36c1f8
commit 5b45718ebd
16 changed files with 379 additions and 28 deletions

View File

@@ -15,18 +15,21 @@ class _AppNavigationBottomBarState extends State<AppNavigationBottomBar> {
@override
Widget build(BuildContext context) {
return BottomNavigationBar(
items: AppNavigation.destinations.map(
(e) => BottomNavigationBarItem(
icon: e.icon,
label: e.label,
),
).toList(),
items: AppNavigation.destinations
.map(
(e) => BottomNavigationBarItem(
icon: e.icon,
label: e.label,
),
)
.toList(),
landscapeLayout: BottomNavigationBarLandscapeLayout.centered,
currentIndex: _selectedIndex,
showUnselectedLabels: false,
onTap: (idx) {
setState(() => _selectedIndex = idx);
AppRouter.instance.goNamed(AppNavigation.destinations[idx].page);
AppRouter.instance
.pushReplacementNamed(AppNavigation.destinations[idx].page);
},
);
}

View File

@@ -27,7 +27,8 @@ class _AppNavigationRailState extends State<AppNavigationRail> {
selectedIndex: _selectedIndex,
onDestinationSelected: (idx) {
setState(() => _selectedIndex = idx);
AppRouter.instance.pushNamed(AppNavigation.destinations[idx].page);
AppRouter.instance
.pushReplacementNamed(AppNavigation.destinations[idx].page);
},
);
}