This commit is contained in:
2024-01-04 16:41:51 +08:00
parent 55085ee563
commit 47f82097e2
22 changed files with 483 additions and 645 deletions

View File

@@ -1,3 +1,6 @@
import 'dart:io';
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
@@ -28,47 +31,32 @@ class TabPage extends StatelessWidget {
);
}
List<BottomNavigationBarItem> createBottomItems() {
return <BottomNavigationBarItem>[
const BottomNavigationBarItem(
icon: Icon(
TDIcons.dashboard,
color: Colors.grey,
),
activeIcon: Icon(
TDIcons.dashboard,
color: Color.fromRGBO(0, 82, 217, 1),
),
label: "工作台",
List<NavigationDestination> createBottomItems() {
return <NavigationDestination>[
const NavigationDestination(
selectedIcon: Icon(TDIcons.dashboard, color: Colors.white),
icon: Icon(TDIcons.dashboard),
label: '工作台',
),
const BottomNavigationBarItem(
icon: Icon(
TDIcons.desktop,
color: Colors.grey,
),
activeIcon: Icon(
TDIcons.desktop,
color: Color.fromRGBO(0, 82, 217, 1),
),
label: "商家中心",
const NavigationDestination(
selectedIcon: Icon(TDIcons.desktop, color: Colors.white),
icon: Icon(TDIcons.desktop),
label: '商家中心',
),
];
}
/// 底部导航
Widget buildBottomNavigationBar() {
List<BottomNavigationBarItem> bottomItems = createBottomItems();
return BottomNavigationBar(
items: bottomItems,
currentIndex: state.currentPage,
List<NavigationDestination> bottomItems = createBottomItems();
return NavigationBar(
backgroundColor: Colors.white,
unselectedItemColor: Colors.grey,
selectedItemColor: const Color.fromRGBO(0, 82, 217, 1),
type: BottomNavigationBarType.fixed,
onTap: logic.handleNavBarTap,
selectedFontSize: 10.sp,
unselectedFontSize: 10.sp,
iconSize: 32.w,
shadowColor: Colors.black,
surfaceTintColor: Colors.white,
indicatorColor: Colors.blueAccent,
onDestinationSelected: logic.handleNavBarTap,
selectedIndex: state.currentPage,
destinations: bottomItems,
);
}