@ -9,6 +9,7 @@ import 'package:share/share.dart';
import ' package:test_sa/controllers/notification/firebase_notification_manger.dart ' ;
import ' package:test_sa/controllers/providers/api/user_provider.dart ' ;
import ' package:test_sa/controllers/providers/settings/setting_provider.dart ' ;
import ' package:test_sa/extensions/context_extension.dart ' ;
import ' package:test_sa/extensions/int_extensions.dart ' ;
import ' package:test_sa/extensions/widget_extensions.dart ' ;
import ' package:test_sa/new_views/pages/new_gas_refill_request_page.dart ' ;
@ -87,11 +88,11 @@ class _LandPageState extends State<LandPage> {
onWillPop: ( ) async {
bool result = await showDialog (
context: context ,
builder: ( _ ) = > const AAlertDialog (
builder: ( _ ) = > AAlertDialog (
/ / title: _subtitle . exit ,
title: " Exit " ,
title: context . translation . exit ,
/ / content: _subtitle . exitAlert ,
content: " Are you sure you want to exit? " ,
content: context . translation . sureExit ,
) ) ;
if ( result = = true ) {
if ( Platform . isAndroid ) {
@ -129,9 +130,9 @@ class _LandPageState extends State<LandPage> {
/ / )
/ / ) ,
/ / ) ,
SizedBox (
height: 48 * AppStyle . getScaleFactor ( context ) ,
) ,
/ / SizedBox (
/ / height: 48 * AppStyle . getScaleFactor ( context ) ,
/ / ) ,
/ / Hero (
/ / tag: " logo " ,
/ / child: Image (
@ -150,7 +151,7 @@ class _LandPageState extends State<LandPage> {
if ( _userProvider . user ! = null & & _userProvider . user . type = = UsersTypes . normal_user )
LandPageItem (
/ / text: _subtitle . newServiceRequest ,
text: " New Service Request " ,
text: context . translation . newServiceRequest ,
icon: FontAwesomeIcons . screwdriverWrench ,
onPressed: ( ) {
Navigator . of ( context ) . pushNamed ( CreateServiceRequestPage . id ) ;
@ -158,7 +159,7 @@ class _LandPageState extends State<LandPage> {
) ,
LandPageItem (
/ / text: _subtitle . trackServiceRequest ,
text: " Track Service Request " ,
text: context . translation . trackServiceRequest ,
icon: FontAwesomeIcons . listCheck ,
onPressed: ( ) {
Navigator . of ( context ) . pushNamed ( ServiceRequestsPage . id ) ;
@ -167,7 +168,7 @@ class _LandPageState extends State<LandPage> {
/ / if ( _userProvider . user . type = = UsersTypes . engineer )
LandPageItem (
/ / text: _subtitle . preventiveMaintenance ,
text: " Preventive Maintenance " ,
text: context . translation . preventiveMaintenance ,
icon: FontAwesomeIcons . personWalking ,
onPressed: ( ) {
Navigator . of ( context ) . pushNamed ( RegularVisitsPage . id ) ;
@ -183,7 +184,7 @@ class _LandPageState extends State<LandPage> {
/ / ) ,
if ( _userProvider ? . user ! = null & & _userProvider ? . user ? . type ! = UsersTypes . engineer )
LandPageItem (
text: " Request Gas Refill " ,
text: context . translation . requestGasRefill ,
icon: FontAwesomeIcons . truckFast ,
onPressed: ( ) {
/ / Navigator . of ( context ) . pushNamed ( RequestGasRefill . id ) ;
@ -191,21 +192,21 @@ class _LandPageState extends State<LandPage> {
} ,
) ,
LandPageItem (
text: " Track Gas Refill " ,
text: context . translation . trackGasRefill ,
icon: Icons . content_paste_search ,
onPressed: ( ) {
Navigator . of ( context ) . pushNamed ( TrackGasRefillPage . id ) ;
} ,
) ,
LandPageItem (
text: " Transfer Asset " ,
text: context . translation . deviceTransfer ,
icon: FontAwesomeIcons . rightLeft ,
onPressed: ( ) {
Navigator . of ( context ) . pushNamed ( RequestDeviceTransfer . id ) ;
} ,
) ,
LandPageItem (
text: " Track Asset Transfer " ,
text: context . translation . trackAssetTransfer ,
icon: FontAwesomeIcons . peopleCarryBox ,
onPressed: ( ) {
Navigator . of ( context ) . pushNamed ( TrackDeviceTransferPage . id ) ;
@ -223,219 +224,219 @@ class _LandPageState extends State<LandPage> {
) ,
] ,
) ,
Align (
alignment: Alignment . topLeft ,
child: ABackButton (
icon: Icons . power_settings_new_rounded ,
onPressed: ( ) async {
bool result = await showDialog (
context: context ,
builder: ( _ ) = > const AAlertDialog (
/ / title: _subtitle . signOut ,
title: " Sign Out " ,
/ / content: _subtitle . signOutAlert ,
content: " Are you sure you want to exit? " ,
) ) ;
if ( result ) {
/ / _devicesProvider . reset ( ) ;
/ / _departmentsProvider . reset ( ) ;
/ / _serviceRequestsProvider . reset ( ) ;
/ / _regularVisitsProvider . reset ( ) ;
/ / _preventiveMaintenanceVisitsProvider . reset ( ) ;
_settingProvider . resetSettings ( ) ;
_userProvider . reset ( ) ;
Navigator . of ( context ) . pop ( ) ;
}
} ,
) ,
) ,
Align (
alignment: Alignment . topRight ,
child: Padding (
padding: const EdgeInsets . symmetric ( horizontal: 8 , vertical: 4 ) ,
child: AIconButton (
iconData: Icons . menu ,
color: AColors . primaryColor ,
buttonSize: 42 ,
backgroundColor: AColors . white ,
onPressed: ( ) {
_scaffoldKey . currentState . openEndDrawer ( ) ;
} ,
) ,
) ,
) ,
] ,
) ,
) ,
endDrawer: Drawer (
backgroundColor: Colors . white ,
child: Column (
children: [
40. height ,
Row (
mainAxisAlignment: MainAxisAlignment . end ,
children: [
const Icon ( Icons . clear ) . onPress ( ( ) = > Navigator . pop ( context ) ) ,
] ,
) . paddingOnly ( start: 4 , end: 14 ) ,
Row (
children: [
Container (
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 ) ,
child: ClipOval (
child: ClipOval (
child: Icon (
Icons . person ,
size: 36 ,
color: Theme . of ( context ) . colorScheme . primary ,
) ,
) ,
) ,
) ,
12. width ,
Text (
_userProvider . user ? . userName ? ? " ?? " ,
style: Theme . of ( context ) . textTheme . headline6 . copyWith (
fontWeight: FontWeight . w600 ,
) ,
textScaleFactor: AppStyle . getScaleFactor ( context ) ,
) . expanded
] ,
) . paddingOnly ( start: 14 , end: 14 , top: 21 , bottom: 21 ) ,
Divider (
height: 1 ,
thickness: 1 ,
color: AColors . greyEF ,
) ,
ListView (
children: [
Row (
children: [
Radio (
value: " en " ,
activeColor: AColors . grey3A ,
focusColor: AColors . grey3A ,
groupValue: _settingProvider . language ,
onChanged: ( value ) {
_settingProvider . setLanguage ( value ) ;
} ) ,
Text (
" English " ,
style: Theme . of ( context ) . textTheme . bodyText1 . copyWith ( color: AColors . grey3A ) ,
textScaleFactor: AppStyle . getScaleFactor ( context ) ,
) ,
Radio (
value: " ar " ,
activeColor: AColors . grey3A ,
focusColor: AColors . grey3A ,
groupValue: _settingProvider . language ,
onChanged: ( value ) {
_settingProvider . setLanguage ( value ) ;
} ) ,
Text (
" عربي " ,
style: Theme . of ( context ) . textTheme . bodyText1 . copyWith ( color: AColors . grey3A ) ,
textScaleFactor: AppStyle . getScaleFactor ( context ) ,
) ,
] ,
) ,
Row (
children: [
Radio (
value: true ,
activeColor: AColors . grey3A ,
focusColor: AColors . grey3A ,
groupValue: _settingProvider . language ,
onChanged: ( value ) {
_settingProvider . setDarkTheme ( value ) ;
} ) ,
Text (
" Dark " ,
style: Theme . of ( context ) . textTheme . bodyText1 . copyWith ( color: AColors . grey3A ) ,
textScaleFactor: AppStyle . getScaleFactor ( context ) ,
) ,
Radio (
value: false ,
activeColor: AColors . grey3A ,
focusColor: AColors . grey3A ,
groupValue: _settingProvider . language ,
onChanged: ( value ) {
_settingProvider . setDarkTheme ( value ) ;
} ) ,
Text (
" Light " ,
style: Theme . of ( context ) . textTheme . bodyText1 . copyWith ( color: AColors . grey3A ) ,
textScaleFactor: AppStyle . getScaleFactor ( context ) ,
) ,
] ,
) ,
/ / DrawerItem (
/ / icon: Icons . notifications ,
/ / title: _subtitle . notifications ,
/ / onPressed: ( ) {
/ / Navigator . of ( context ) . pushNamed ( NotificationsPage . id ) ;
/ / } ,
/ / ) ,
DrawerItem (
icon: Icons . mail ,
/ / title: _subtitle . email ,
title: " Email " ,
onPressed: ( ) {
launch ( " mailto:customerservice@Test SA.com " ) ;
} ,
) ,
/ / DrawerItem (
/ / icon: Icons . phone_in_talk ,
/ / title: " ${ _subtitle . hotLine } 15564 " ,
/ / onPressed: ( ) {
/ / launch ( " tel:15564 " ) ;
/ / } ,
/ / ) ,
/ / DrawerItem (
/ / icon: FontAwesomeIcons . linkedinIn ,
/ / title: _subtitle . linkedIn ,
/ / onPressed: ( ) {
/ / launch ( " https://www.linkedin.com/company/Test SA/ " ) ;
/ / } ,
/ / ) ,
/ / DrawerItem (
/ / icon: FontAwesomeIcons . globe ,
/ / title: _subtitle . ourWebsite ,
/ / onPressed: ( ) {
/ / launch ( " https://www.Test SA.com/ " ) ;
/ / } ,
/ / ) ,
DrawerItem (
icon: Icons . share ,
/ / title: _subtitle . shareApp ,
title: " Share App " ,
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/ " ;
Share . share ( shareLink ) ;
} ,
) ,
] ,
) . expanded ,
Divider ( height: 1 , thickness: 1 , color: AColors . greyEF ) ,
Row (
mainAxisAlignment: MainAxisAlignment . center ,
children: [
Text (
" Powered By Cloud Solutions " ,
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/cloud_logo.png " , width: 32 , height: 32 )
] ,
) . paddingOnly ( start: 20 , end: 20 , top: 8 , bottom: 8 ) ,
/ / Align (
/ / alignment: Alignment . topLeft ,
/ / child: ABackButton (
/ / icon: Icons . power_settings_new_rounded ,
/ / onPressed: ( ) async {
/ / bool result = await showDialog (
/ / context: context ,
/ / builder: ( _ ) = > const AAlertDialog (
/ / / / title: _subtitle . signOut ,
/ / title: " Sign Out " ,
/ / / / content: _subtitle . signOutAlert ,
/ / content: " Are you sure you want to exit? " ,
/ / ) ) ;
/ / if ( result ) {
/ / / / _devicesProvider . reset ( ) ;
/ / / / _departmentsProvider . reset ( ) ;
/ / / / _serviceRequestsProvider . reset ( ) ;
/ / / / _regularVisitsProvider . reset ( ) ;
/ / / / _preventiveMaintenanceVisitsProvider . reset ( ) ;
/ / _settingProvider . resetSettings ( ) ;
/ / _userProvider . reset ( ) ;
/ / Navigator . of ( context ) . pop ( ) ;
/ / }
/ / } ,
/ / ) ,
/ / ) ,
/ / Align (
/ / alignment: Alignment . topRight ,
/ / child: Padding (
/ / padding: const EdgeInsets . symmetric ( horizontal: 8 , vertical: 4 ) ,
/ / child: AIconButton (
/ / iconData: Icons . menu ,
/ / color: AColors . primaryColor ,
/ / buttonSize: 42 ,
/ / backgroundColor: AColors . white ,
/ / onPressed: ( ) {
/ / _scaffoldKey . currentState . openEndDrawer ( ) ;
/ / } ,
/ / ) ,
/ / ) ,
/ / ) ,
] ,
) ,
) ,
/ / endDrawer: Drawer (
/ / backgroundColor: Colors . white ,
/ / child: Column (
/ / children: [
/ / 40. height ,
/ / Row (
/ / mainAxisAlignment: MainAxisAlignment . end ,
/ / children: [
/ / const Icon ( Icons . clear ) . onPress ( ( ) = > Navigator . pop ( context ) ) ,
/ / ] ,
/ / ) . paddingOnly ( start: 4 , end: 14 ) ,
/ / Row (
/ / children: [
/ / Container (
/ / 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 ) ,
/ / child: ClipOval (
/ / child: ClipOval (
/ / child: Icon (
/ / Icons . person ,
/ / size: 36 ,
/ / color: Theme . of ( context ) . colorScheme . primary ,
/ / ) ,
/ / ) ,
/ / ) ,
/ / ) ,
/ / 12. width ,
/ / Text (
/ / _userProvider . user ? . userName ? ? " ?? " ,
/ / style: Theme . of ( context ) . textTheme . headline6 . copyWith (
/ / fontWeight: FontWeight . w600 ,
/ / ) ,
/ / textScaleFactor: AppStyle . getScaleFactor ( context ) ,
/ / ) . expanded
/ / ] ,
/ / ) . paddingOnly ( start: 14 , end: 14 , top: 21 , bottom: 21 ) ,
/ / Divider (
/ / height: 1 ,
/ / thickness: 1 ,
/ / color: AColors . greyEF ,
/ / ) ,
/ / ListView (
/ / children: [
/ / Row (
/ / children: [
/ / Radio (
/ / value: " en " ,
/ / activeColor: AColors . grey3A ,
/ / focusColor: AColors . grey3A ,
/ / groupValue: _settingProvider . language ,
/ / onChanged: ( value ) {
/ / _settingProvider . setLanguage ( value ) ;
/ / } ) ,
/ / Text (
/ / " English " ,
/ / style: Theme . of ( context ) . textTheme . bodyText1 . copyWith ( color: AColors . grey3A ) ,
/ / textScaleFactor: AppStyle . getScaleFactor ( context ) ,
/ / ) ,
/ / Radio (
/ / value: " ar " ,
/ / activeColor: AColors . grey3A ,
/ / focusColor: AColors . grey3A ,
/ / groupValue: _settingProvider . language ,
/ / onChanged: ( value ) {
/ / _settingProvider . setLanguage ( value ) ;
/ / } ) ,
/ / Text (
/ / " عربي " ,
/ / style: Theme . of ( context ) . textTheme . bodyText1 . copyWith ( color: AColors . grey3A ) ,
/ / textScaleFactor: AppStyle . getScaleFactor ( context ) ,
/ / ) ,
/ / ] ,
/ / ) ,
/ / Row (
/ / children: [
/ / Radio (
/ / value: true ,
/ / activeColor: AColors . grey3A ,
/ / focusColor: AColors . grey3A ,
/ / groupValue: _settingProvider . language ,
/ / onChanged: ( value ) {
/ / _settingProvider . setDarkTheme ( value ) ;
/ / } ) ,
/ / Text (
/ / " Dark " ,
/ / style: Theme . of ( context ) . textTheme . bodyText1 . copyWith ( color: AColors . grey3A ) ,
/ / textScaleFactor: AppStyle . getScaleFactor ( context ) ,
/ / ) ,
/ / Radio (
/ / value: false ,
/ / activeColor: AColors . grey3A ,
/ / focusColor: AColors . grey3A ,
/ / groupValue: _settingProvider . language ,
/ / onChanged: ( value ) {
/ / _settingProvider . setDarkTheme ( value ) ;
/ / } ) ,
/ / Text (
/ / " Light " ,
/ / style: Theme . of ( context ) . textTheme . bodyText1 . copyWith ( color: AColors . grey3A ) ,
/ / textScaleFactor: AppStyle . getScaleFactor ( context ) ,
/ / ) ,
/ / ] ,
/ / ) ,
/ / / / DrawerItem (
/ / / / icon: Icons . notifications ,
/ / / / title: _subtitle . notifications ,
/ / / / onPressed: ( ) {
/ / / / Navigator . of ( context ) . pushNamed ( NotificationsPage . id ) ;
/ / / / } ,
/ / / / ) ,
/ / DrawerItem (
/ / icon: Icons . mail ,
/ / / / title: _subtitle . email ,
/ / title: " Email " ,
/ / onPressed: ( ) {
/ / launch ( " mailto:customerservice@Test SA.com " ) ;
/ / } ,
/ / ) ,
/ / / / DrawerItem (
/ / / / icon: Icons . phone_in_talk ,
/ / / / title: " ${ _subtitle . hotLine } 15564 " ,
/ / / / onPressed: ( ) {
/ / / / launch ( " tel:15564 " ) ;
/ / / / } ,
/ / / / ) ,
/ / / / DrawerItem (
/ / / / icon: FontAwesomeIcons . linkedinIn ,
/ / / / title: _subtitle . linkedIn ,
/ / / / onPressed: ( ) {
/ / / / launch ( " https://www.linkedin.com/company/Test SA/ " ) ;
/ / / / } ,
/ / / / ) ,
/ / / / DrawerItem (
/ / / / icon: FontAwesomeIcons . globe ,
/ / / / title: _subtitle . ourWebsite ,
/ / / / onPressed: ( ) {
/ / / / launch ( " https://www.Test SA.com/ " ) ;
/ / / / } ,
/ / / / ) ,
/ / DrawerItem (
/ / icon: Icons . share ,
/ / / / title: _subtitle . shareApp ,
/ / title: " Share App " ,
/ / 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/ " ;
/ / Share . share ( shareLink ) ;
/ / } ,
/ / ) ,
/ / ] ,
/ / ) . expanded ,
/ / Divider ( height: 1 , thickness: 1 , color: AColors . greyEF ) ,
/ / Row (
/ / mainAxisAlignment: MainAxisAlignment . center ,
/ / children: [
/ / Text (
/ / " Powered By Cloud Solutions " ,
/ / 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/cloud_logo.png " , width: 32 , height: 32 )
/ / ] ,
/ / ) . paddingOnly ( start: 20 , end: 20 , top: 8 , bottom: 8 ) ,
/ / ] ,
/ / ) ,
/ / ) ,
) ,
) ;
}