diff --git a/star_lock/lib/main/lockDetail/card/addCardType/addCardManage/addCardTypeManage_page.dart b/star_lock/lib/main/lockDetail/card/addCardType/addCardManage/addCardTypeManage_page.dart deleted file mode 100644 index 533b5110..00000000 --- a/star_lock/lib/main/lockDetail/card/addCardType/addCardManage/addCardTypeManage_page.dart +++ /dev/null @@ -1,45 +0,0 @@ - -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; - -import '../../../../../app_settings/app_colors.dart'; -import '../../../../../tools/titleAppBar.dart'; -import '../../../../../translations/trans_lib.dart'; -import 'addCardTypeManage_tabbar.dart'; - -class AddCardTypeManagePage extends StatefulWidget { - const AddCardTypeManagePage({Key? key}) : super(key: key); - - @override - State createState() => _AddCardTypeManagePageState(); -} - -class _AddCardTypeManagePageState extends State { - var index = 0; - - @override - Widget build(BuildContext context) { - Map map = Get.arguments; - var lockId = map["lockId"]; - var fromType = map["fromType"]??1; // 1从添加钥匙列表进入 2从考勤添加员工入口进入 - var fromTypeTwoStaffName = ""; - if(fromType == 2){ - fromTypeTwoStaffName = map["fromTypeTwoStaffName"]; // 从添加员工进入 传入员工名字 - } - - return Scaffold( - backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar( - barTitle: - "${TranslationLoader.lanKeys!.addTip!.tr}${TranslationLoader.lanKeys!.card!.tr}", - haveBack: true, - backgroundColor: AppColors.mainColor), - body: Column( - children: [ - AddCardManageTabbar(initialIndex: index, lockId: lockId, fromType: fromType, fromTypeTwoStaffName:fromTypeTwoStaffName), - ], - ), - ); - } - -} diff --git a/star_lock/lib/main/lockDetail/card/addCardType/addCardManage/addCardTypeManage_tabbar.dart b/star_lock/lib/main/lockDetail/card/addCardType/addCardManage/addCardTypeManage_tabbar.dart deleted file mode 100644 index 12d283e2..00000000 --- a/star_lock/lib/main/lockDetail/card/addCardType/addCardManage/addCardTypeManage_tabbar.dart +++ /dev/null @@ -1,123 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; - -import '../../../../../app_settings/app_colors.dart'; -import '../../../../../tools/CustomUnderlineTabIndicator.dart'; -import '../../../../../translations/trans_lib.dart'; -import '../addCardType_page.dart'; - -class AddCardManageTabbar extends StatefulWidget { - var initialIndex = 1; - var lockId = 0; - var fromType = 0; // 1从添加钥匙列表进入 2从考勤添加员工入口进入 - var fromTypeTwoStaffName = ""; // 从添加员工进入 传入员工名字 - - AddCardManageTabbar( - {Key? key, - required this.initialIndex, - required this.lockId, - required this.fromType, - required this.fromTypeTwoStaffName}) - : super(key: key); - - @override - State createState() => _AddCardManageTabbarState(); -} - -class _AddCardManageTabbarState extends State - with SingleTickerProviderStateMixin { - late TabController _tabController; - - final List _itemTabs = [ - ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: "0"), - ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: "1"), - ItemView(title: TranslationLoader.lanKeys!.circulation!.tr, selectType: "2"), - ]; - - final List _fromCheckInTypeItemTabs = [ - ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: "0"), - ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: "1"), - ]; - - @override - void initState() { - // TODO: implement initState - super.initState(); - - _tabController = TabController( - vsync: this, - length: widget.fromType == 1 ? _itemTabs.length : _fromCheckInTypeItemTabs.length, - initialIndex: widget.initialIndex); - _tabController.addListener(() { - print("_tabController.indexIsChanging:${_tabController.indexIsChanging} _tabController.index:${_tabController.index}"); - if (_tabController.animation!.value == _tabController.index) { - FocusScope.of(context).requestFocus(FocusNode()); - } - }); - } - - @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: widget.fromType == 1 ? _itemTabs.map((ItemView item) => _tab(item)).toList() : _fromCheckInTypeItemTabs.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( - child: SizedBox( - width: 1.sw / 5, - child: Text(item.title, textAlign: TextAlign.center))); - } - - Widget _pageWidget() { - return Expanded( - child: TabBarView( - controller: _tabController, - children: - widget.fromType == 1 - ? _itemTabs.map((ItemView item) => AddCardPage()).toList() - : _fromCheckInTypeItemTabs.map((ItemView item) => AddCardPage()).toList(), - ), - ); - } -} - -class ItemView { - const ItemView({required this.title, required this.selectType}); - - final String title; - final String selectType; -} diff --git a/star_lock/lib/main/lockDetail/face/addFaceType/addFaceTypeManage/addFaceTypeManage_page.dart b/star_lock/lib/main/lockDetail/face/addFaceType/addFaceTypeManage/addFaceTypeManage_page.dart deleted file mode 100644 index 8ed2b3f2..00000000 --- a/star_lock/lib/main/lockDetail/face/addFaceType/addFaceTypeManage/addFaceTypeManage_page.dart +++ /dev/null @@ -1,44 +0,0 @@ - -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; - -import '../../../../../app_settings/app_colors.dart'; -import '../../../../../tools/titleAppBar.dart'; -import '../../../../../translations/trans_lib.dart'; -import 'addFaceTypeManage_tabbar.dart'; - -class AddFaceTypeManagePage extends StatefulWidget { - const AddFaceTypeManagePage({Key? key}) : super(key: key); - - @override - State createState() => _AddFaceTypeManagePageState(); -} - -class _AddFaceTypeManagePageState extends State { - var index = 0; - - @override - Widget build(BuildContext context) { - Map map = Get.arguments; - var lockId = map["lockId"]; - var fromType = map["fromType"]; // 1从添加钥匙列表进入 2从考勤添加员工入口进入 - var fromTypeTwoStaffName = ""; - if(fromType == 2){ - fromTypeTwoStaffName = map["fromTypeTwoStaffName"]; // 从添加员工进入 传入员工名字 - } - return Scaffold( - backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar( - barTitle: - "${TranslationLoader.lanKeys!.addTip!.tr}${TranslationLoader.lanKeys!.face!.tr}", - haveBack: true, - backgroundColor: AppColors.mainColor), - body: Column( - children: [ - AddFaceTypeManageTabbar(lockId: lockId, fromType: fromType, fromTypeTwoStaffName: fromTypeTwoStaffName, initialIndex: index), - ], - ), - ); - } - -} diff --git a/star_lock/lib/main/lockDetail/face/addFaceType/addFaceTypeManage/addFaceTypeManage_tabbar.dart b/star_lock/lib/main/lockDetail/face/addFaceType/addFaceTypeManage/addFaceTypeManage_tabbar.dart deleted file mode 100644 index 34b0ae91..00000000 --- a/star_lock/lib/main/lockDetail/face/addFaceType/addFaceTypeManage/addFaceTypeManage_tabbar.dart +++ /dev/null @@ -1,114 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; - -import '../../../../../app_settings/app_colors.dart'; -import '../../../../../tools/CustomUnderlineTabIndicator.dart'; -import '../../../../../translations/trans_lib.dart'; -import '../addFaceType_page.dart'; - -class AddFaceTypeManageTabbar extends StatefulWidget { - var initialIndex = 1; - var lockId = 0; - var fromType = 1; // 1从添加钥匙列表进入 2从考勤添加员工入口进入 - var fromTypeTwoStaffName = "";// 从添加员工进入 传入员工名字 - AddFaceTypeManageTabbar({Key? key, required this.lockId, required this.fromType, required this.fromTypeTwoStaffName, required this.initialIndex}) : super(key: key); - - @override - State createState() => _AddFaceTypeManageTabbarState(); -} - -class _AddFaceTypeManageTabbarState extends State with SingleTickerProviderStateMixin { - late TabController _tabController; - - final List _itemTabs = [ - ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: "0"), - ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: "1"), - ItemView(title: TranslationLoader.lanKeys!.circulation!.tr, selectType: "2"), - ]; - - final List _fromCheckInTypeItemTabs = [ - ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: "0"), - ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: "1"), - ]; - - @override - void initState() { - // TODO: implement initState - super.initState(); - _tabController = TabController( - vsync: this, - length: _itemTabs.length, - initialIndex: widget.initialIndex); - - _tabController.addListener(() { - // print("_tabController.animation!.value:${_tabController.animation!.value} _tabController.index:${_tabController.index}"); - if (_tabController.animation!.value == _tabController.index) { - FocusScope.of(context).requestFocus(FocusNode()); - } - }); - } - - @override - Widget build(BuildContext context) { - return Expanded( - child: Column( - children: [ - _tabBar(), - _pageWidget(), - ], - )); - } - - TabBar _tabBar() { - return TabBar( - controller: _tabController, - tabs: widget.fromType == 1 ? _itemTabs.map((ItemView item) => _tab(item)).toList() : _fromCheckInTypeItemTabs.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( - child: SizedBox( - width: 1.sw / 5, - child: Text(item.title, textAlign: TextAlign.center))); - } - - Widget _pageWidget() { - return Expanded( - child: TabBarView( - controller: _tabController, - children: - widget.fromType == 1 - ? _itemTabs.map((ItemView item) => AddFaceTypePage(selectType: item.selectType, lockId: widget.lockId, fromType: widget.fromType, fromTypeTwoStaffName:widget.fromTypeTwoStaffName)).toList() - :_itemTabs.map((ItemView item) => AddFaceTypePage(selectType: item.selectType, lockId: widget.lockId, fromType: widget.fromType, fromTypeTwoStaffName:widget.fromTypeTwoStaffName)).toList(), - - // _itemTabs.map((ItemView item) => AddFaceTypePage(selectType: item.selectType, lockId: widget.lockId, fromType: widget.fromType, fromTypeTwoStaffName:widget.fromTypeTwoStaffName)).toList(), - ), - ); - } -} - -class ItemView { - const ItemView({required this.title, required this.selectType}); - - final String title; - final String selectType; -} diff --git a/star_lock/lib/main/lockDetail/fingerprint/addFingerprintSelectType/addFingerprintManage/addFingerprintTypeManage_page.dart b/star_lock/lib/main/lockDetail/fingerprint/addFingerprintSelectType/addFingerprintManage/addFingerprintTypeManage_page.dart deleted file mode 100644 index c9578bab..00000000 --- a/star_lock/lib/main/lockDetail/fingerprint/addFingerprintSelectType/addFingerprintManage/addFingerprintTypeManage_page.dart +++ /dev/null @@ -1,45 +0,0 @@ - -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; - -import '../../../../../app_settings/app_colors.dart'; -import '../../../../../tools/titleAppBar.dart'; -import '../../../../../translations/trans_lib.dart'; -import 'addFingerprintTypeManage_tabbar.dart'; - -class AddFingerprintTypeManagePage extends StatefulWidget { - const AddFingerprintTypeManagePage({Key? key}) : super(key: key); - - @override - State createState() => _AddFingerprintTypeManagePageState(); -} - -class _AddFingerprintTypeManagePageState extends State { - var index = 0; - - @override - Widget build(BuildContext context) { - Map map = Get.arguments; - var lockId = map["lockId"]; - var fromType = map["fromType"]; // 1从添加钥匙列表进入 2从考勤添加员工入口进入 - var fromTypeTwoStaffName = ""; - if(fromType == 2){ - fromTypeTwoStaffName = map["fromTypeTwoStaffName"]; // 从添加员工进入 传入员工名字 - } - - return Scaffold( - backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar( - barTitle: - "${TranslationLoader.lanKeys!.addTip!.tr}${TranslationLoader.lanKeys!.fingerprint!.tr}", - haveBack: true, - backgroundColor: AppColors.mainColor), - body: Column( - children: [ - AddFingerprintTypeManageTabbar(initialIndex: index, lockId: lockId, fromType: fromType, fromTypeTwoStaffName:fromTypeTwoStaffName), - ], - ), - ); - } -} - diff --git a/star_lock/lib/main/lockDetail/fingerprint/addFingerprintSelectType/addFingerprintManage/addFingerprintTypeManage_tabbar.dart b/star_lock/lib/main/lockDetail/fingerprint/addFingerprintSelectType/addFingerprintManage/addFingerprintTypeManage_tabbar.dart deleted file mode 100644 index b3c51930..00000000 --- a/star_lock/lib/main/lockDetail/fingerprint/addFingerprintSelectType/addFingerprintManage/addFingerprintTypeManage_tabbar.dart +++ /dev/null @@ -1,117 +0,0 @@ - -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; - -import '../../../../../app_settings/app_colors.dart'; -import '../../../../../tools/CustomUnderlineTabIndicator.dart'; -import '../../../../../translations/trans_lib.dart'; -import '../addFingerprintType_page.dart'; - -class AddFingerprintTypeManageTabbar extends StatefulWidget { - var initialIndex = 1; - var lockId = 0; - var fromType = 0; // 1从添加钥匙列表进入 2从考勤添加员工入口进入 - var fromTypeTwoStaffName = "";// 从添加员工进入 传入员工名字 - - AddFingerprintTypeManageTabbar( - {Key? key, required this.initialIndex, required this.lockId, required this.fromType, required this.fromTypeTwoStaffName}) : super(key: key); - - @override - State createState() => _AddFingerprintTypeManageTabbarState(); -} - -class _AddFingerprintTypeManageTabbarState extends State with SingleTickerProviderStateMixin { - late TabController _tabController; - - final List _itemTabs = [ - ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: "0"), - ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: "1"), - ItemView(title: TranslationLoader.lanKeys!.circulation!.tr, selectType: "2"), - ]; - - final List _fromCheckInTypeItemTabs = [ - ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: "0"), - ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: "1"), - ]; - - @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()); - } - }); - } - - @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: widget.fromType == 1 ? _itemTabs.map((ItemView item) => _tab(item)).toList() : _fromCheckInTypeItemTabs.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(child: SizedBox( - width: 1.sw / 5, - child: Text(item.title, textAlign: TextAlign.center))); - } - - Widget _pageWidget() { - return Expanded( - child: TabBarView( - controller: _tabController, - children: - widget.fromType == 1 - ? _itemTabs.map((ItemView item) => const AddFingerprintTypePage()).toList() - :_itemTabs.map((ItemView item) => const AddFingerprintTypePage()).toList(), - ), - ); - } - -} - -class ItemView { - const ItemView({required this.title, required this.selectType}); - - final String title; - final String selectType; -} diff --git a/star_lock/lib/main/lockDetail/remoteControl/addRemoteControl/addRemoteControlManage/addRemoteControlManage_page.dart b/star_lock/lib/main/lockDetail/remoteControl/addRemoteControl/addRemoteControlManage/addRemoteControlManage_page.dart deleted file mode 100644 index c2c5b95a..00000000 --- a/star_lock/lib/main/lockDetail/remoteControl/addRemoteControl/addRemoteControlManage/addRemoteControlManage_page.dart +++ /dev/null @@ -1,38 +0,0 @@ - -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; - -import '../../../../../app_settings/app_colors.dart'; -import '../../../../../tools/titleAppBar.dart'; -import '../../../../../translations/trans_lib.dart'; -import 'addRemoteControlManage_tabbar.dart'; - -class AddRemoteControlManagePage extends StatefulWidget { - const AddRemoteControlManagePage({Key? key}) : super(key: key); - - @override - State createState() => _AddRemoteControlManagePageState(); -} - -class _AddRemoteControlManagePageState extends State { - var index = 0; - - @override - Widget build(BuildContext context) { - - return Scaffold( - backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar( - barTitle: - "${TranslationLoader.lanKeys!.addTip!.tr}${TranslationLoader.lanKeys!.remoteControl!.tr}", - haveBack: true, - backgroundColor: AppColors.mainColor), - body: Column( - children: [ - AddRemoteControlManageTabbar(initialIndex: index), - ], - ), - ); - } - -} diff --git a/star_lock/lib/main/lockDetail/remoteControl/addRemoteControl/addRemoteControlManage/addRemoteControlManage_tabbar.dart b/star_lock/lib/main/lockDetail/remoteControl/addRemoteControl/addRemoteControlManage/addRemoteControlManage_tabbar.dart deleted file mode 100644 index 537ced04..00000000 --- a/star_lock/lib/main/lockDetail/remoteControl/addRemoteControl/addRemoteControlManage/addRemoteControlManage_tabbar.dart +++ /dev/null @@ -1,100 +0,0 @@ - - -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; - -import '../../../../../app_settings/app_colors.dart'; -import '../../../../../tools/CustomUnderlineTabIndicator.dart'; -import '../../../../../translations/trans_lib.dart'; -import '../addRemoteControl_page.dart'; - -class AddRemoteControlManageTabbar extends StatefulWidget { - var initialIndex = 1; - - AddRemoteControlManageTabbar({Key? key, required this.initialIndex}) : super(key: key); - - @override - State createState() => _AddRemoteControlManageTabbarState(); -} - -class _AddRemoteControlManageTabbarState extends State with SingleTickerProviderStateMixin { - late TabController _tabController; - - final List _itemTabs = [ - ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: "0"), - ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: "1"), - ItemView(title: TranslationLoader.lanKeys!.circulation!.tr, selectType: "2"), - ]; - - @override - void initState() { - // TODO: implement initState - super.initState(); - _tabController = TabController( - vsync: this, - length: _itemTabs.length, - initialIndex: widget.initialIndex); - } - - @override - Widget build(BuildContext context) { - return Expanded( - child: Column( - children: [ - _tabBar(), - _pageWidget(), - ], - )); - } - - TabBar _tabBar() { - return TabBar( - controller: _tabController, - 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( - child: SizedBox( - width: 1.sw / 5, - child: Text(item.title, textAlign: TextAlign.center))); - } - - Widget _pageWidget() { - return Expanded( - child: TabBarView( - controller: _tabController, - children: _itemTabs - .map((ItemView item) => AddRemoteControlPage(selectType: item.selectType,)) - .toList(), - ), - ); - } -} - -class ItemView { - const ItemView({required this.title, required this.selectType}); - - final String title; - final String selectType; -} -