|
|
|
|
@ -11,17 +11,16 @@ import 'package:test_sa/extensions/context_extension.dart';
|
|
|
|
|
import 'package:test_sa/extensions/int_extensions.dart';
|
|
|
|
|
import 'package:test_sa/extensions/string_extensions.dart';
|
|
|
|
|
import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
|
import 'package:test_sa/models/enums/user_types.dart';
|
|
|
|
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
|
|
|
import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
|
|
|
|
|
import 'package:test_sa/new_views/pages/land_page/calendar_page.dart';
|
|
|
|
|
import 'package:test_sa/new_views/pages/land_page/my_request/my_requests_page.dart';
|
|
|
|
|
import 'package:test_sa/new_views/swipe_module/mark_attendance_widget.dart';
|
|
|
|
|
import 'package:test_sa/new_views/pages/settings_page.dart';
|
|
|
|
|
import 'package:test_sa/new_views/swipe_module/swipe_success_view.dart';
|
|
|
|
|
import 'package:test_sa/new_views/swipe_module/utils/swipe_general_utils.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/equipment/single_device_picker.dart';
|
|
|
|
|
|
|
|
|
|
import '../../../controllers/providers/settings/setting_provider.dart';
|
|
|
|
|
import '../../../views/widgets/dialogs/dialog.dart';
|
|
|
|
|
import '../../common_widgets/app_bottom_nav_bar.dart';
|
|
|
|
|
@ -49,7 +48,6 @@ class _LandPageState extends State<LandPage> {
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
_pages = <Widget>[];
|
|
|
|
|
|
|
|
|
|
super.initState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -103,19 +101,19 @@ class _LandPageState extends State<LandPage> {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> checkNfcSupported() async {
|
|
|
|
|
isNfcSupported = await NfcManager.instance.isAvailable();
|
|
|
|
|
setState(() {});
|
|
|
|
|
}
|
|
|
|
|
// Future<void> checkNfcSupported() async {
|
|
|
|
|
// isNfcSupported = await NfcManager.instance.isAvailable();
|
|
|
|
|
// setState(() {});
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
if (_userProvider == null) {
|
|
|
|
|
_userProvider = Provider.of<UserProvider>(context, listen: false);
|
|
|
|
|
// if (_userProvider.isUserConfirmSwipe) {
|
|
|
|
|
if (!_userProvider.user.employeeIsHMG) {
|
|
|
|
|
checkNfcSupported();
|
|
|
|
|
}
|
|
|
|
|
// if (!_userProvider.user.employeeIsHMG) {
|
|
|
|
|
// checkNfcSupported();
|
|
|
|
|
// }
|
|
|
|
|
_pages = <Widget>[
|
|
|
|
|
DashboardPage(onDrawerPress: (() {
|
|
|
|
|
_scaffoldKey.currentState.isDrawerOpen ? _scaffoldKey.currentState.closeDrawer() : _scaffoldKey.currentState.openDrawer();
|
|
|
|
|
@ -191,17 +189,18 @@ class _LandPageState extends State<LandPage> {
|
|
|
|
|
),
|
|
|
|
|
if (userProvider.user != null && !userProvider.user.employeeIsHMG)
|
|
|
|
|
Positioned(
|
|
|
|
|
right:_userProvider.user.type==UsersTypes.engineer? 20.toScreenWidth:null,
|
|
|
|
|
left:_userProvider.user.type!=UsersTypes.engineer? 20.toScreenWidth:null ,
|
|
|
|
|
right: _userProvider.user.type == UsersTypes.engineer ? 20.toScreenWidth : null,
|
|
|
|
|
left: _userProvider.user.type != UsersTypes.engineer ? 20.toScreenWidth : null,
|
|
|
|
|
bottom: 130.toScreenHeight,
|
|
|
|
|
child: GestureDetector(
|
|
|
|
|
onTap: () {
|
|
|
|
|
onTap: () async {
|
|
|
|
|
isNfcSupported = await NfcManager.instance.isAvailable();
|
|
|
|
|
SwipeGeneralUtils.showSwipeTypeBottomSheetSheet(context: context, isNfcSupported: isNfcSupported);
|
|
|
|
|
},
|
|
|
|
|
child: CircularAnimationWithProgressIndicator(
|
|
|
|
|
child: Container(
|
|
|
|
|
width: 120.toScreenWidth,
|
|
|
|
|
height: 120.toScreenHeight,
|
|
|
|
|
width: 100.toScreenWidth,
|
|
|
|
|
height: 100.toScreenHeight,
|
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
|
color: AppColor.white,
|
|
|
|
|
@ -212,11 +211,22 @@ class _LandPageState extends State<LandPage> {
|
|
|
|
|
children: [
|
|
|
|
|
'swipe'.toSvgAsset(width: 32, height: 32),
|
|
|
|
|
8.height,
|
|
|
|
|
context.translation.checkIn.bodyText(context).custom(color: AppColor.neutral80),
|
|
|
|
|
8.height,
|
|
|
|
|
userProvider.swipeTransactionModel != null && userProvider.swipeTransactionModel.swipeTime != null
|
|
|
|
|
? SwipeGeneralUtils.formatTimeOnly(userProvider.swipeTransactionModel.swipeTime).bodyText(context).custom(color: AppColor.neutral80)
|
|
|
|
|
: '--:--'.bodyText(context).custom(color: AppColor.neutral80),
|
|
|
|
|
Text(
|
|
|
|
|
("${context.translation.checkIn}\n${userProvider.swipeTransactionModel != null && userProvider.swipeTransactionModel.swipeTime != null ? SwipeGeneralUtils.formatTimeOnly(userProvider.swipeTransactionModel.swipeTime) : '--:--'}"),
|
|
|
|
|
style: AppTextStyles.bodyText2.copyWith(color: AppColor.neutral80, fontWeight: FontWeight.w500, fontFamily: "Poppins"),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
// (context.translation.checkIn +
|
|
|
|
|
// "\n" +
|
|
|
|
|
// (userProvider.swipeTransactionModel != null && userProvider.swipeTransactionModel.swipeTime != null
|
|
|
|
|
// ? SwipeGeneralUtils.formatTimeOnly(userProvider.swipeTransactionModel.swipeTime)
|
|
|
|
|
// : '--:--'))
|
|
|
|
|
// .bodyText2(context)
|
|
|
|
|
// .custom(color: AppColor.neutral80),
|
|
|
|
|
// 8.height,
|
|
|
|
|
// userProvider.swipeTransactionModel != null && userProvider.swipeTransactionModel.swipeTime != null
|
|
|
|
|
// ? SwipeGeneralUtils.formatTimeOnly(userProvider.swipeTransactionModel.swipeTime).bodyText2(context).custom(color: AppColor.neutral80)
|
|
|
|
|
// : '--:--'.bodyText(context).custom(color: AppColor.neutral80),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|