|
@@ -16,6 +16,7 @@ import 'package:shared/utils/screen_util.dart';
|
|
|
import 'package:shared/utils/util.dart';
|
|
|
import 'package:widgets/ext/ex_widget.dart';
|
|
|
import 'package:widgets/load_state_layout.dart';
|
|
|
+import 'package:widgets/my_appbar.dart';
|
|
|
import 'package:widgets/my_button.dart';
|
|
|
import 'package:widgets/my_load_image.dart';
|
|
|
import 'package:widgets/my_text_field.dart';
|
|
@@ -32,11 +33,7 @@ class SignInSignOutPage extends BaseStatefulPage<SignInSignOutController> {
|
|
|
|
|
|
//启动当前页面
|
|
|
static void startInstance() {
|
|
|
- return Get.start(RouterPath.JOB_SIGN_IN_SIGN_OUT, launchModel: LaunchModel.singleTask);
|
|
|
- }
|
|
|
-
|
|
|
- static void startWithPop() {
|
|
|
- Get.startWithPop(RouterPath.JOB_SIGN_IN_SIGN_OUT);
|
|
|
+ return Get.start(RouterPath.JOB_SIGN_IN_SIGN_OUT);
|
|
|
}
|
|
|
|
|
|
@override
|
|
@@ -94,51 +91,79 @@ class _SignInSignOutPageState extends BaseState<SignInSignOutPage, SignInSignOut
|
|
|
return autoCtlGetBuilder(
|
|
|
builder: (controller) {
|
|
|
return Scaffold(
|
|
|
- body: Container(
|
|
|
- width: double.infinity,
|
|
|
- height: double.infinity,
|
|
|
- decoration: const BoxDecoration(
|
|
|
- gradient: LinearGradient(
|
|
|
- colors: [
|
|
|
- Color(0xFF091D44),
|
|
|
- Color(0xFF245A8A),
|
|
|
- Color(0xFF7F7CEC),
|
|
|
+ extendBodyBehindAppBar: true,
|
|
|
+ appBar: MyAppBar.appSearchBar(
|
|
|
+ context,
|
|
|
+ value: controller.keyword,
|
|
|
+ hintText: 'Name/Mobile'.tr,
|
|
|
+ controller: state.searchController,
|
|
|
+ onSearch: (keyword) {
|
|
|
+ controller.doSearch(keyword);
|
|
|
+ },
|
|
|
+ actions: [
|
|
|
+ MyButton(
|
|
|
+ onPressed: () {
|
|
|
+ controller.resetFiltering();
|
|
|
+ },
|
|
|
+ text: "Reset".tr,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ backgroundColor: hexToColor("#2BA9F9", opacity: 0.5),
|
|
|
+ radius: 17.25,
|
|
|
+ minWidth: 60,
|
|
|
+ minHeight: 35,
|
|
|
+ ).marginOnly(right: 15)
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ body: SafeArea(
|
|
|
+ bottom: true,
|
|
|
+ top: false,
|
|
|
+ child: Container(
|
|
|
+ width: double.infinity,
|
|
|
+ height: double.infinity,
|
|
|
+ padding: EdgeInsets.only(top: kToolbarHeight + ScreenUtil.getStatusBarH(context) + 1),
|
|
|
+ decoration: const BoxDecoration(
|
|
|
+ gradient: LinearGradient(
|
|
|
+ colors: [
|
|
|
+ Color(0xFF091D44),
|
|
|
+ Color(0xFF245A8A),
|
|
|
+ Color(0xFF7F7CEC),
|
|
|
+ ],
|
|
|
+ begin: Alignment.topCenter,
|
|
|
+ end: Alignment.bottomCenter,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ //顶部的搜索标题布局
|
|
|
+ // _buildSearchTitleBar(),
|
|
|
+
|
|
|
+ // Container(color: Color(0XFF415B7C), height: 0.5, margin: EdgeInsets.only(top: 12)),
|
|
|
+
|
|
|
+ _buildFilterDateWidget(),
|
|
|
+
|
|
|
+ EasyRefresh(
|
|
|
+ controller: controller.refreshController,
|
|
|
+ onRefresh: controller.onRefresh,
|
|
|
+ child: LoadStateLayout(
|
|
|
+ state: controller.loadingState,
|
|
|
+ errorMessage: controller.errorMessage,
|
|
|
+ errorRetry: () {
|
|
|
+ controller.retryRequest();
|
|
|
+ },
|
|
|
+ successSliverWidget: [
|
|
|
+ SliverList(
|
|
|
+ delegate: SliverChildBuilderDelegate(
|
|
|
+ (context, index) {
|
|
|
+ return _buildAttendanceItem(controller, index, () {});
|
|
|
+ },
|
|
|
+ childCount: controller.datas.length,
|
|
|
+ ))
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ).expanded(),
|
|
|
],
|
|
|
- begin: Alignment.topCenter,
|
|
|
- end: Alignment.bottomCenter,
|
|
|
),
|
|
|
),
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- //顶部的搜索标题布局
|
|
|
- _buildSearchTitleBar(),
|
|
|
-
|
|
|
- Container(color: Color(0XFF415B7C), height: 0.5, margin: EdgeInsets.only(top: 12)),
|
|
|
-
|
|
|
- _buildFilterDateWidget(),
|
|
|
-
|
|
|
- EasyRefresh(
|
|
|
- controller: controller.refreshController,
|
|
|
- onRefresh: controller.onRefresh,
|
|
|
- child: LoadStateLayout(
|
|
|
- state: controller.loadingState,
|
|
|
- errorMessage: controller.errorMessage,
|
|
|
- errorRetry: () {
|
|
|
- controller.retryRequest();
|
|
|
- },
|
|
|
- successSliverWidget: [
|
|
|
- SliverList(
|
|
|
- delegate: SliverChildBuilderDelegate(
|
|
|
- (context, index) {
|
|
|
- return _buildAttendanceItem(controller, index, () {});
|
|
|
- },
|
|
|
- childCount: controller.datas.length,
|
|
|
- ))
|
|
|
- ],
|
|
|
- ),
|
|
|
- ).expanded(),
|
|
|
- ],
|
|
|
- ),
|
|
|
),
|
|
|
);
|
|
|
},
|
|
@@ -146,85 +171,85 @@ class _SignInSignOutPageState extends BaseState<SignInSignOutPage, SignInSignOut
|
|
|
}
|
|
|
|
|
|
/// 顶部的搜索栏布局
|
|
|
- Widget _buildSearchTitleBar() {
|
|
|
- return Row(
|
|
|
- mainAxisSize: MainAxisSize.max,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
- children: [
|
|
|
- Container(
|
|
|
- height: 35,
|
|
|
- padding: EdgeInsets.only(left: 15, right: 11),
|
|
|
- margin: EdgeInsets.only(left: 15, right: 10),
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
|
|
|
- borderRadius: BorderRadius.circular(17.25), // 设置圆角
|
|
|
- ),
|
|
|
- child: Row(
|
|
|
- mainAxisSize: MainAxisSize.max,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
- children: [
|
|
|
- //输入框
|
|
|
- IgnoreKeyboardDismiss(
|
|
|
- child: TextField(
|
|
|
- cursorColor: ColorConstants.white,
|
|
|
- cursorWidth: 1.5,
|
|
|
- autofocus: false,
|
|
|
- maxLines: 1,
|
|
|
- minLines: 1,
|
|
|
- // 是否自动获取焦点
|
|
|
- focusNode: state.formData['keyword']!['focusNode'],
|
|
|
- // 焦点控制
|
|
|
- controller: state.formData['keyword']!['controller'],
|
|
|
- // 与输入框交互控制器
|
|
|
- //装饰
|
|
|
- decoration: InputDecoration(
|
|
|
- isDense: true,
|
|
|
- //清除垂直方向的填充
|
|
|
- isCollapsed: true,
|
|
|
- //让文字垂直居中
|
|
|
- border: InputBorder.none,
|
|
|
- hintText: state.formData['keyword']!['hintText'],
|
|
|
- hintStyle: TextStyle(
|
|
|
- color: hexToColor("#AECAE5"),
|
|
|
- fontSize: 15.0,
|
|
|
- fontWeight: FontWeight.w400,
|
|
|
- ),
|
|
|
- ),
|
|
|
- style: TextStyle(
|
|
|
- color: ColorConstants.white,
|
|
|
- fontSize: 15.0,
|
|
|
- fontWeight: FontWeight.w400,
|
|
|
- ),
|
|
|
- // 键盘动作右下角图标
|
|
|
- textInputAction: TextInputAction.search,
|
|
|
- textAlignVertical: TextAlignVertical.center,
|
|
|
- onSubmitted: (value) {
|
|
|
- controller.doSearch();
|
|
|
- }, //输入框完成触发
|
|
|
- ),
|
|
|
- ).expanded(),
|
|
|
-
|
|
|
- //搜索图标
|
|
|
- MyAssetImage(Assets.cptJobSearchIcon, width: 15, height: 15).marginOnly(left: 10).onTap(() {
|
|
|
- controller.doSearch();
|
|
|
- }),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ).expanded(),
|
|
|
- MyButton(
|
|
|
- onPressed: () {
|
|
|
- controller.resetFiltering();
|
|
|
- },
|
|
|
- text: "Reset".tr,
|
|
|
- textColor: ColorConstants.white,
|
|
|
- backgroundColor: hexToColor("#2BA9F9", opacity: 0.5),
|
|
|
- radius: 17.25,
|
|
|
- minWidth: 60,
|
|
|
- minHeight: 35,
|
|
|
- )
|
|
|
- ],
|
|
|
- ).marginOnly(top: ScreenUtil.getStatusBarH(context) + 5, right: 12);
|
|
|
- }
|
|
|
+ // Widget _buildSearchTitleBar() {
|
|
|
+ // return Row(
|
|
|
+ // mainAxisSize: MainAxisSize.max,
|
|
|
+ // crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ // children: [
|
|
|
+ // Container(
|
|
|
+ // height: 35,
|
|
|
+ // padding: EdgeInsets.only(left: 15, right: 11),
|
|
|
+ // margin: EdgeInsets.only(left: 15, right: 10),
|
|
|
+ // decoration: BoxDecoration(
|
|
|
+ // color: Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
|
|
|
+ // borderRadius: BorderRadius.circular(17.25), // 设置圆角
|
|
|
+ // ),
|
|
|
+ // child: Row(
|
|
|
+ // mainAxisSize: MainAxisSize.max,
|
|
|
+ // crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ // children: [
|
|
|
+ // //输入框
|
|
|
+ // IgnoreKeyboardDismiss(
|
|
|
+ // child: TextField(
|
|
|
+ // cursorColor: ColorConstants.white,
|
|
|
+ // cursorWidth: 1.5,
|
|
|
+ // autofocus: false,
|
|
|
+ // maxLines: 1,
|
|
|
+ // minLines: 1,
|
|
|
+ // // 是否自动获取焦点
|
|
|
+ // focusNode: state.formData['keyword']!['focusNode'],
|
|
|
+ // // 焦点控制
|
|
|
+ // controller: state.formData['keyword']!['controller'],
|
|
|
+ // // 与输入框交互控制器
|
|
|
+ // //装饰
|
|
|
+ // decoration: InputDecoration(
|
|
|
+ // isDense: true,
|
|
|
+ // //清除垂直方向的填充
|
|
|
+ // isCollapsed: true,
|
|
|
+ // //让文字垂直居中
|
|
|
+ // border: InputBorder.none,
|
|
|
+ // hintText: state.formData['keyword']!['hintText'],
|
|
|
+ // hintStyle: TextStyle(
|
|
|
+ // color: hexToColor("#AECAE5"),
|
|
|
+ // fontSize: 15.0,
|
|
|
+ // fontWeight: FontWeight.w400,
|
|
|
+ // ),
|
|
|
+ // ),
|
|
|
+ // style: TextStyle(
|
|
|
+ // color: ColorConstants.white,
|
|
|
+ // fontSize: 15.0,
|
|
|
+ // fontWeight: FontWeight.w400,
|
|
|
+ // ),
|
|
|
+ // // 键盘动作右下角图标
|
|
|
+ // textInputAction: TextInputAction.search,
|
|
|
+ // textAlignVertical: TextAlignVertical.center,
|
|
|
+ // onSubmitted: (value) {
|
|
|
+ // controller.doSearch();
|
|
|
+ // }, //输入框完成触发
|
|
|
+ // ),
|
|
|
+ // ).expanded(),
|
|
|
+ //
|
|
|
+ // //搜索图标
|
|
|
+ // MyAssetImage(Assets.cptJobSearchIcon, width: 15, height: 15).marginOnly(left: 10).onTap(() {
|
|
|
+ // controller.doSearch();
|
|
|
+ // }),
|
|
|
+ // ],
|
|
|
+ // ),
|
|
|
+ // ).expanded(),
|
|
|
+ // MyButton(
|
|
|
+ // onPressed: () {
|
|
|
+ // controller.resetFiltering();
|
|
|
+ // },
|
|
|
+ // text: "Reset".tr,
|
|
|
+ // textColor: ColorConstants.white,
|
|
|
+ // backgroundColor: hexToColor("#2BA9F9", opacity: 0.5),
|
|
|
+ // radius: 17.25,
|
|
|
+ // minWidth: 60,
|
|
|
+ // minHeight: 35,
|
|
|
+ // )
|
|
|
+ // ],
|
|
|
+ // ).marginOnly(top: ScreenUtil.getStatusBarH(context) + 5, right: 12);
|
|
|
+ // }
|
|
|
|
|
|
/// 时间筛选布局
|
|
|
Widget _buildFilterDateWidget() {
|