feat : init statics
This commit is contained in:
76
packages/inspection/lib/presentation/pages/action/logic.dart
Normal file
76
packages/inspection/lib/presentation/pages/action/logic.dart
Normal file
@@ -0,0 +1,76 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class ActionLogic extends GetxController with GetTickerProviderStateMixin {
|
||||
late Rx<SlidableController> slidController;
|
||||
bool showSlideHint = true;
|
||||
|
||||
RxInt selectedIndex = 0.obs;
|
||||
RxInt previousIndex = 0.obs;
|
||||
|
||||
List<String> headersTitle = [
|
||||
'کاربران',
|
||||
'سوابق',
|
||||
'آمار',
|
||||
];
|
||||
|
||||
List<String> headersIcons = [
|
||||
Assets.vec.profileUserSvg.path,
|
||||
Assets.vec.calendarSearchSvg.path,
|
||||
Assets.vec.diagramSvg.path,
|
||||
];
|
||||
|
||||
RxList<bool> supervisionHistoryList = [false, false, false, false].obs;
|
||||
|
||||
List<String> tmpLs = ['دولتی', 'غیر دولتی', 'استیجاری', 'شخصی', 'سایر'];
|
||||
|
||||
List<String> hamadanCities = [
|
||||
'همدان',
|
||||
'ملایر',
|
||||
'نهاوند',
|
||||
'تویسرکان',
|
||||
'اسدآباد',
|
||||
'بهار',
|
||||
'رزن',
|
||||
'کبودرآهنگ',
|
||||
'فامنین',
|
||||
'لالجین',
|
||||
];
|
||||
|
||||
RxInt filter1Index = 0.obs;
|
||||
RxInt filter2Index = 0.obs;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
slidController = SlidableController(this).obs;
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
Future<void> triggerSlidableAnimation() async {
|
||||
await Future.delayed(Duration(milliseconds: 200));
|
||||
await slidController.value.openEndActionPane();
|
||||
await Future.delayed(Duration(milliseconds: 200));
|
||||
await slidController.value.close();
|
||||
showSlideHint = !showSlideHint;
|
||||
}
|
||||
|
||||
void updateSelectedIndex(int index) {
|
||||
if (index == selectedIndex.value) {
|
||||
return;
|
||||
}
|
||||
previousIndex.value = selectedIndex.value;
|
||||
selectedIndex.value = index;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user