|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
|
|
@ -73,7 +72,7 @@ class _LandPageState extends State<LandPage> {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
String path = ModalRoute.of(context)!.settings.arguments.toString();
|
|
|
|
|
String? path = ModalRoute.of(context)?.settings.arguments.toString();
|
|
|
|
|
_height = MediaQuery.of(context).size.height;
|
|
|
|
|
_width = MediaQuery.of(context).size.width;
|
|
|
|
|
_settingProvider = Provider.of<SettingProvider>(context);
|
|
|
|
@ -81,12 +80,14 @@ class _LandPageState extends State<LandPage> {
|
|
|
|
|
_departmentsProvider = Provider.of<DepartmentsProvider>(context);
|
|
|
|
|
_devicesProvider = Provider.of<DevicesProvider>(context);
|
|
|
|
|
_serviceRequestsProvider = Provider.of<ServiceRequestsProvider>(context);
|
|
|
|
|
_preventiveMaintenanceVisitsProvider = Provider.of<PreventiveMaintenanceVisitsProvider>(context);
|
|
|
|
|
_preventiveMaintenanceVisitsProvider =
|
|
|
|
|
Provider.of<PreventiveMaintenanceVisitsProvider>(context);
|
|
|
|
|
_regularVisitsProvider = Provider.of<RegularVisitsProvider>(context);
|
|
|
|
|
Subtitle _subtitle = AppLocalization.of(context)!.subtitle!;
|
|
|
|
|
if (firstTime) {
|
|
|
|
|
if (path != null) {
|
|
|
|
|
Navigator.of(context).pushNamed("/" + path.split("/").first, arguments: path.split("/").last);
|
|
|
|
|
Navigator.of(context).pushNamed("/" + path.split("/").first,
|
|
|
|
|
arguments: path.split("/").last);
|
|
|
|
|
}
|
|
|
|
|
firstTime = false;
|
|
|
|
|
}
|
|
|
|
@ -158,14 +159,16 @@ class _LandPageState extends State<LandPage> {
|
|
|
|
|
text: _subtitle.newServiceRequest,
|
|
|
|
|
icon: FontAwesomeIcons.tools,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.of(context).pushNamed(CreateRequestPage.id);
|
|
|
|
|
Navigator.of(context)
|
|
|
|
|
.pushNamed(CreateRequestPage.id);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
LandPageItem(
|
|
|
|
|
text: _subtitle.trackServiceRequest,
|
|
|
|
|
icon: FontAwesomeIcons.tasks,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.of(context).pushNamed(ServiceRequestsPage.id);
|
|
|
|
|
Navigator.of(context)
|
|
|
|
|
.pushNamed(ServiceRequestsPage.id);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
//if (_userProvider.user.type == UsersTypes.engineer)
|
|
|
|
@ -189,28 +192,32 @@ class _LandPageState extends State<LandPage> {
|
|
|
|
|
text: "Request Gas Refill",
|
|
|
|
|
icon: FontAwesomeIcons.truckFast,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.of(context).pushNamed(RequestGasRefill.id);
|
|
|
|
|
Navigator.of(context)
|
|
|
|
|
.pushNamed(RequestGasRefill.id);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
LandPageItem(
|
|
|
|
|
text: "Track Gas Refill",
|
|
|
|
|
icon: Icons.content_paste_search,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.of(context).pushNamed(TrackGasRefillPage.id);
|
|
|
|
|
Navigator.of(context)
|
|
|
|
|
.pushNamed(TrackGasRefillPage.id);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
LandPageItem(
|
|
|
|
|
text: "transfer Device",
|
|
|
|
|
icon: FontAwesomeIcons.rightLeft,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.of(context).pushNamed(RequestDeviceTransfer.id);
|
|
|
|
|
Navigator.of(context)
|
|
|
|
|
.pushNamed(RequestDeviceTransfer.id);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
LandPageItem(
|
|
|
|
|
text: "Track Device Transfer",
|
|
|
|
|
icon: FontAwesomeIcons.peopleCarryBox,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.of(context).pushNamed(TrackDeviceTransferPage.id);
|
|
|
|
|
Navigator.of(context)
|
|
|
|
|
.pushNamed(TrackDeviceTransferPage.id);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
@ -243,7 +250,8 @@ class _LandPageState extends State<LandPage> {
|
|
|
|
|
Align(
|
|
|
|
|
alignment: Alignment.topRight,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
|
|
|
|
padding:
|
|
|
|
|
const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
|
|
|
|
child: AIconButton(
|
|
|
|
|
iconData: Icons.menu,
|
|
|
|
|
color: AColors.primaryColor,
|
|
|
|
@ -275,16 +283,23 @@ class _LandPageState extends State<LandPage> {
|
|
|
|
|
height: 50 * AppStyle.getScaleFactor(context),
|
|
|
|
|
width: 50 * AppStyle.getScaleFactor(context),
|
|
|
|
|
padding: EdgeInsets.all(4),
|
|
|
|
|
decoration: BoxDecoration(border: Border.all(color: Theme.of(context).primaryColor, width: 2), shape: BoxShape.circle),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: Theme.of(context).primaryColor, width: 2),
|
|
|
|
|
shape: BoxShape.circle),
|
|
|
|
|
child: ClipOval(
|
|
|
|
|
child: ClipOval(
|
|
|
|
|
child: Icon(Icons.person,size: 36,color: Theme.of(context).colorScheme.primary,),
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.person,
|
|
|
|
|
size: 36,
|
|
|
|
|
color: Theme.of(context).colorScheme.primary,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
12.width,
|
|
|
|
|
Text(
|
|
|
|
|
_userProvider.user?.userName??"",
|
|
|
|
|
_userProvider.user?.userName ?? "",
|
|
|
|
|
style: Theme.of(context).textTheme.headline6?.copyWith(
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
@ -311,7 +326,10 @@ class _LandPageState extends State<LandPage> {
|
|
|
|
|
}),
|
|
|
|
|
Text(
|
|
|
|
|
"English",
|
|
|
|
|
style: Theme.of(context).textTheme.bodyText1?.copyWith(color: AColors.grey3A),
|
|
|
|
|
style: Theme.of(context)
|
|
|
|
|
.textTheme
|
|
|
|
|
.bodyText1
|
|
|
|
|
?.copyWith(color: AColors.grey3A),
|
|
|
|
|
textScaleFactor: AppStyle.getScaleFactor(context),
|
|
|
|
|
),
|
|
|
|
|
Radio(
|
|
|
|
@ -324,7 +342,10 @@ class _LandPageState extends State<LandPage> {
|
|
|
|
|
}),
|
|
|
|
|
Text(
|
|
|
|
|
"عربي",
|
|
|
|
|
style: Theme.of(context).textTheme.bodyText1?.copyWith(color: AColors.grey3A),
|
|
|
|
|
style: Theme.of(context)
|
|
|
|
|
.textTheme
|
|
|
|
|
.bodyText1
|
|
|
|
|
?.copyWith(color: AColors.grey3A),
|
|
|
|
|
textScaleFactor: AppStyle.getScaleFactor(context),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
@ -368,8 +389,12 @@ class _LandPageState extends State<LandPage> {
|
|
|
|
|
icon: Icons.share,
|
|
|
|
|
title: _subtitle.shareApp,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
PackageInfo packageInfo = await PackageInfo.fromPlatform();
|
|
|
|
|
String shareLink = "\n https://play.google.com/store/apps/details?id=" + packageInfo.packageName + "\n https://apps.apple.com/us/app/";
|
|
|
|
|
PackageInfo packageInfo =
|
|
|
|
|
await PackageInfo.fromPlatform();
|
|
|
|
|
String shareLink =
|
|
|
|
|
"\n https://play.google.com/store/apps/details?id=" +
|
|
|
|
|
packageInfo.packageName +
|
|
|
|
|
"\n https://apps.apple.com/us/app/";
|
|
|
|
|
Share.share(shareLink);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
@ -381,11 +406,15 @@ class _LandPageState extends State<LandPage> {
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
"Powered By NewTrack",
|
|
|
|
|
style: Theme.of(context).textTheme.headline6?.copyWith(fontWeight: FontWeight.w500, color: AColors.grey3A, fontSize: 12),
|
|
|
|
|
style: Theme.of(context).textTheme.headline6?.copyWith(
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
color: AColors.grey3A,
|
|
|
|
|
fontSize: 12),
|
|
|
|
|
textScaleFactor: AppStyle.getScaleFactor(context),
|
|
|
|
|
),
|
|
|
|
|
6.width,
|
|
|
|
|
Image.asset("assets/images/qr.jpeg", width: 32, height: 32, color: AColors.grey3A)
|
|
|
|
|
Image.asset("assets/images/qr.jpeg",
|
|
|
|
|
width: 32, height: 32, color: AColors.grey3A)
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(left: 20, right: 20, top: 8, bottom: 8),
|
|
|
|
|
],
|
|
|
|
|