Revert the project to the previous structure with applying null safety

merge-requests/4/head
zaid_daoud 2 years ago
parent d9d26a0fe0
commit c1a3eedbf6

@ -6,10 +6,10 @@ PODS:
- Firebase/Messaging (10.3.0):
- Firebase/CoreOnly
- FirebaseMessaging (~> 10.3.0)
- firebase_core (2.4.1):
- firebase_core (2.6.1):
- Firebase/CoreOnly (= 10.3.0)
- Flutter
- firebase_messaging (14.2.1):
- firebase_messaging (14.2.4):
- Firebase/Messaging (= 10.3.0)
- firebase_core
- Flutter
@ -79,8 +79,9 @@ PODS:
- nanopb/encode (2.30909.0)
- package_info (0.0.1):
- Flutter
- path_provider_ios (0.0.1):
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- permission_handler_apple (9.0.4):
- Flutter
- PromisesObjC (2.1.1)
@ -89,8 +90,9 @@ PODS:
- MTBBarcodeScanner
- share (0.0.1):
- Flutter
- shared_preferences_ios (0.0.1):
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- speech_to_text (0.0.1):
- Flutter
- Try
@ -113,11 +115,11 @@ DEPENDENCIES:
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- package_info (from `.symlinks/plugins/package_info/ios`)
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`)
- share (from `.symlinks/plugins/share/ios`)
- shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/ios`)
- speech_to_text (from `.symlinks/plugins/speech_to_text/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
@ -160,16 +162,16 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/image_picker_ios/ios"
package_info:
:path: ".symlinks/plugins/package_info/ios"
path_provider_ios:
:path: ".symlinks/plugins/path_provider_ios/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/ios"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
qr_code_scanner:
:path: ".symlinks/plugins/qr_code_scanner/ios"
share:
:path: ".symlinks/plugins/share/ios"
shared_preferences_ios:
:path: ".symlinks/plugins/shared_preferences_ios/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/ios"
speech_to_text:
:path: ".symlinks/plugins/speech_to_text/ios"
sqflite:
@ -180,8 +182,8 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
Firebase: f92fc551ead69c94168d36c2b26188263860acd9
firebase_core: bf59c32d2e53814f558efa20840c1902fa2fe461
firebase_messaging: ee597229fc260f8fa491fa8f2d4a32dfbfa406fa
firebase_core: 6242f038aefa4582e028536e71312f7e3a41e6bb
firebase_messaging: ee61b8065c395a117864224e3031729e656232af
FirebaseCore: 988754646ab3bd4bdcb740f1bfe26b9f6c0d5f2a
FirebaseCoreInternal: 29b76f784d607df8b2a1259d73c3f04f1210137b
FirebaseInstallations: e2f26126089dcf41e215f7b8925af8d953c7d602
@ -199,18 +201,18 @@ SPEC CHECKSUMS:
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
path_provider_foundation: 37748e03f12783f9de2cb2c4eadfaa25fe6d4852
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
PromisesObjC: ab77feca74fa2823e7af4249b8326368e61014cb
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
share: 0b2c3e82132f5888bccca3351c504d0003b3b410
shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad
shared_preferences_foundation: 297b3ebca31b34ec92be11acd7fb0ba932c822ca
speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de
url_launcher_ios: fb12c43172927bb5cf75aeebd073f883801f1993
PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048
COCOAPODS: 1.10.2
COCOAPODS: 1.11.3

@ -146,7 +146,7 @@ class MyApp extends StatelessWidget {
routes: {
SplashScreen.id: (_) => const SplashScreen(),
LandPage.id: (_) => const LandPage(),
Login.id: (_) => Login(),
Login.id: (_) => const Login(),
Register.id: (_) => Register(),
ProfilePage.id: (_) => ProfilePage(),
ReportIssuesPage.id: (_) => const ReportIssuesPage(),

@ -83,11 +83,11 @@ class _LoginState extends State<Login> {
initialValue: _user.userName ?? "",
hintText: subtitle?.name ?? "",
textAlign: TextAlign.left,
style: Theme.of(context).textTheme.bodyText1,
style: Theme.of(context).textTheme.bodyLarge,
prefixIconData: Icons.account_circle,
validator: (value) => Validator.hasValue(value!)
? ''
: subtitle?.nameValidateMessage ?? "",
validator: (value) => Validator.hasValue(value ?? '')
? null
: subtitle?.nameValidateMessage,
textInputType: TextInputType.name,
onSaved: (value) {
_user.userName = value!;
@ -102,9 +102,9 @@ class _LoginState extends State<Login> {
prefixIconData: Icons.vpn_key_sharp,
textAlign: TextAlign.left,
validator: (value) =>
Validator.isValidPassword(value!)
? ''
: subtitle?.passwordValidateMessage ?? "",
Validator.isValidPassword(value ?? '')
? null
: subtitle?.passwordValidateMessage,
showPassword: () {
_obscurePassword = !_obscurePassword;
setState(() {});
@ -119,8 +119,9 @@ class _LoginState extends State<Login> {
AButton(
text: subtitle?.signIn ?? "",
onPressed: () async {
if (!(_formKey.currentState?.validate() ?? false))
if (!(_formKey.currentState?.validate() ?? true)) {
return;
}
_formKey.currentState?.save();
int? status = await _userProvider?.login(
user: _user,
@ -135,7 +136,8 @@ class _LoginState extends State<Login> {
Navigator.of(context).pushNamed(LandPage.id);
} else {
Fluttertoast.showToast(
msg: subtitle?.activationAlert ?? "");
msg: subtitle?.activationAlert ?? "",
);
}
} else {
String errorMessage = status == 400

@ -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),
],

@ -4,7 +4,7 @@ import '../app_style/sizing.dart';
class ATextFormField extends StatefulWidget {
final Function(String?)? onSaved;
final String Function(String?)? validator;
final String? Function(String?)? validator;
final Function(String)? onChange;
final bool? obscureText;
final VoidCallback? showPassword;

Loading…
Cancel
Save