84 lines
2.7 KiB
Dart
84 lines
2.7 KiB
Dart
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:star_lock/mine/mine_page.dart';
|
|
|
|
import 'app_settings/app_colors.dart';
|
|
import 'main/lockMian/lockMain_page.dart';
|
|
|
|
class NavPages extends StatefulWidget {
|
|
const NavPages({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<NavPages> createState() => _NavPagesState();
|
|
}
|
|
|
|
class _NavPagesState extends State<NavPages> {
|
|
int _currentIndex = 0;
|
|
final List<Widget> _listPage = [
|
|
StarLockMain(),
|
|
// StarLockMinePage(key: starLockMineKey),
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
var sp;
|
|
return Scaffold(
|
|
body: IndexedStack(
|
|
/// 在这里修改
|
|
// index: _currentIndex,
|
|
children: _listPage,
|
|
),
|
|
// bottomNavigationBar: BottomNavigationBar(
|
|
// elevation: 0.0,
|
|
// selectedFontSize: 24.sp,
|
|
// unselectedFontSize: 24.sp,
|
|
// type: BottomNavigationBarType.fixed,
|
|
// selectedItemColor: AppColors.mainColor,
|
|
// backgroundColor: Colors.white,
|
|
// currentIndex: _currentIndex, //对应点击/显示哪个底部导航栏按钮
|
|
// onTap: (index) {
|
|
// //bottomNavigationBar的点击事件
|
|
// if (_currentIndex == index) {
|
|
// return;
|
|
// }
|
|
// setState(() {
|
|
// _currentIndex = index; //将选中的下标进行替换
|
|
// });
|
|
// if (_currentIndex == 0) {
|
|
// starLockMainKey.currentState?.onShow();
|
|
// starLockMineKey.currentState?.onHide();
|
|
// } else if (_currentIndex == 1) {
|
|
// starLockMainKey.currentState?.onHide();
|
|
// starLockMineKey.currentState?.onShow();
|
|
// }
|
|
// },
|
|
// items: [
|
|
// BottomNavigationBarItem(
|
|
// icon: SizedBox(
|
|
// width: 56.w,
|
|
// height: 56.w,
|
|
// child: Image.asset(
|
|
// _currentIndex == 0
|
|
// ? 'images/tabbar/icon_tab_main_selet.png'
|
|
// : 'images/tabbar/icon_tab_main_unselet.png',
|
|
// fit: BoxFit.cover),
|
|
// ),
|
|
// label: '首页'),
|
|
// BottomNavigationBarItem(
|
|
// icon: SizedBox(
|
|
// width: 56.w,
|
|
// height: 56.w,
|
|
// child: Image.asset(
|
|
// _currentIndex == 1
|
|
// ? 'images/tabbar/icon_tab_my_selet.png'
|
|
// : 'images/tabbar/icon_tab_my_unselet.png',
|
|
// fit: BoxFit.cover),
|
|
// ),
|
|
// label: '我的'),
|
|
// ],
|
|
// ),
|
|
);
|
|
}
|
|
}
|