删除文件

This commit is contained in:
魏少阳 2024-04-29 11:41:22 +08:00
parent 0f69460c96
commit a1a85bd06c
2 changed files with 0 additions and 173 deletions

View File

@ -1,45 +0,0 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyManage/passwordKeyManage_tabbar.dart';
import '../../../../../app_settings/app_colors.dart';
import '../../../../../tools/titleAppBar.dart';
import '../../../../../translations/trans_lib.dart';
import '../../../../lockMian/entity/lockListInfo_entity.dart';
class PasswordKeyManagePage extends StatefulWidget {
const PasswordKeyManagePage({Key? key}) : super(key: key);
@override
State<PasswordKeyManagePage> createState() => _PasswordKeyManagePageState();
}
class _PasswordKeyManagePageState extends State<PasswordKeyManagePage> {
var index = 0;
late LockListInfoItemEntity keyInfo;
@override
Widget build(BuildContext context) {
dynamic obj = ModalRoute.of(context)?.settings.arguments;
if (obj != null && (obj["keyInfo"] != null)) {
keyInfo = obj["keyInfo"];
}
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.getPassword!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
body: Column(
children: [
PasswordKeyManageTabbarPage(
initialIndex: index,
keyInfo: keyInfo,
),
],
),
);
}
}

View File

@ -1,128 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
import '../../../../../app_settings/app_colors.dart';
import '../../../../../tools/CustomUnderlineTabIndicator.dart';
import '../../../../../translations/trans_lib.dart';
import '../passwordKey_perpetual_page.dart';
class PasswordKeyManageTabbarPage extends StatefulWidget {
var initialIndex = 1;
final LockListInfoItemEntity keyInfo;
PasswordKeyManageTabbarPage(
{Key? key, required this.initialIndex, required this.keyInfo})
: super(key: key);
@override
State<PasswordKeyManageTabbarPage> createState() =>
_PasswordKeyManageTabbarPageState();
}
class _PasswordKeyManageTabbarPageState extends State<PasswordKeyManageTabbarPage> with SingleTickerProviderStateMixin {
late TabController _tabController;
final List<ItemView> _itemTabs = <ItemView>[
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, type: "0"),
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, type: "1"),
ItemView(title: TranslationLoader.lanKeys!.once!.tr, type: "2"),
ItemView(title: TranslationLoader.lanKeys!.custom!.tr, type: "3"),
ItemView(title: TranslationLoader.lanKeys!.circulation!.tr, type: "4"),
ItemView(title: TranslationLoader.lanKeys!.clearAll!.tr, type: "5"),
];
@override
void initState() {
// TODO: implement initState
super.initState();
_tabController = TabController(
vsync: this,
length: _itemTabs.length,
initialIndex: widget.initialIndex);
_tabController.addListener(() {
if (_tabController.animation!.value==_tabController.index){
FocusScope.of(context).requestFocus(FocusNode());
}
});
// _tabController.addListener(handleTabIndex);
}
// int handleTabIndex() {
// //
// int currentIndex = _tabController.index;
// // item
// eventBus.fire(GetPasswordTypeUpdateIndex(currentIndex));
// return currentIndex;
// }
@override
Widget build(BuildContext context) {
return Expanded(
child: Column(
children: [
_tabBar(),
_pageWidget(),
],
));
}
TabBar _tabBar() {
return TabBar(
controller: _tabController,
onTap: (index){
FocusScope.of(context).requestFocus(FocusNode());
},
tabs: _itemTabs.map((ItemView item) => _tab(item)).toList(),
isScrollable: true,
indicatorColor: Colors.red,
unselectedLabelColor: Colors.black,
unselectedLabelStyle: TextStyle(
color: AppColors.mainColor,
fontSize: 24.sp,
),
automaticIndicatorColorAdjustment: true,
labelColor: AppColors.mainColor,
labelStyle: TextStyle(
color: AppColors.mainColor,
fontSize: 24.sp,
fontWeight: FontWeight.w600),
indicator: CustomUnderlineTabIndicator(
borderSide: BorderSide(color: AppColors.mainColor, width: 4.w),
strokeCap: StrokeCap.round,
width: 30.w),
);
}
Tab _tab(ItemView item) {
return Tab(
// text: item.title,
child: Container(
// width: item.title.length > 2 ? 1.sw / 8 : 1.sw / 12,
// margin: EdgeInsets.all(10.w),
// color: Colors.red,
child: Text(
item.title,
textAlign: TextAlign.center,
),
),
);
}
Widget _pageWidget() {
return Expanded(
child: TabBarView(
controller: _tabController,
children: _itemTabs.map((ItemView item) => PasswordKeyPerpetualPage()).toList(),
),
);
}
}
class ItemView {
const ItemView({required this.title, required this.type});
final String title;
final String type;
}