git
This commit is contained in:
@@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user