Skip to content

Commit

Permalink
exception bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MOKTADIR authored and MOKTADIR committed Apr 5, 2023
1 parent 8b3a63f commit 8719a3a
Show file tree
Hide file tree
Showing 12 changed files with 165 additions and 80 deletions.
Binary file added assets/images/email.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 26 additions & 26 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,30 @@ PODS:
- file_picker (0.0.1):
- DKImagePickerController/PhotoGallery
- Flutter
- Firebase/CoreOnly (10.3.0):
- FirebaseCore (= 10.3.0)
- Firebase/Messaging (10.3.0):
- Firebase/CoreOnly (10.7.0):
- FirebaseCore (= 10.7.0)
- Firebase/Messaging (10.7.0):
- Firebase/CoreOnly
- FirebaseMessaging (~> 10.3.0)
- firebase_core (2.7.1):
- Firebase/CoreOnly (= 10.3.0)
- FirebaseMessaging (~> 10.7.0)
- firebase_core (2.9.0):
- Firebase/CoreOnly (= 10.7.0)
- Flutter
- firebase_messaging (14.2.6):
- Firebase/Messaging (= 10.3.0)
- firebase_messaging (14.4.0):
- Firebase/Messaging (= 10.7.0)
- firebase_core
- Flutter
- FirebaseCore (10.3.0):
- FirebaseCore (10.7.0):
- FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/Logger (~> 7.8)
- FirebaseCoreInternal (10.4.0):
- FirebaseCoreInternal (10.7.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseInstallations (10.4.0):
- FirebaseInstallations (10.7.0):
- FirebaseCore (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/UserDefaults (~> 7.8)
- PromisesObjC (~> 2.1)
- FirebaseMessaging (10.3.0):
- FirebaseMessaging (10.7.0):
- FirebaseCore (~> 10.0)
- FirebaseInstallations (~> 10.0)
- GoogleDataTransport (~> 9.2)
Expand Down Expand Up @@ -103,10 +103,10 @@ PODS:
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- PromisesObjC (2.1.1)
- SDWebImage (5.15.0):
- SDWebImage/Core (= 5.15.0)
- SDWebImage/Core (5.15.0)
- PromisesObjC (2.2.0)
- SDWebImage (5.15.5):
- SDWebImage/Core (= 5.15.5)
- SDWebImage/Core (5.15.5)
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
Expand Down Expand Up @@ -165,13 +165,13 @@ SPEC CHECKSUMS:
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
Firebase: f92fc551ead69c94168d36c2b26188263860acd9
firebase_core: 1ae9f9aa76e6e1edc14fb181637ad466fd6c6fa4
firebase_messaging: f8c01f8b540feb4196e8dbe45ae17534747d779d
FirebaseCore: 988754646ab3bd4bdcb740f1bfe26b9f6c0d5f2a
FirebaseCoreInternal: e301297f4c15a17489e48ed722d733b1578e0c02
FirebaseInstallations: 36b38c733fd37e50857e5e8d74138648f466f18c
FirebaseMessaging: e345b219fd15d325f0cf2fef28cb8ce00d851b3f
Firebase: 0219acf760880eeec8ce479895bd7767466d9f81
firebase_core: d85432877e814811e040e7659f9c82faeab66e04
firebase_messaging: 45c0514ca78426630338a42fb7b55af962c7ccd2
FirebaseCore: e317665b9d744727a97e623edbbed009320afdd7
FirebaseCoreInternal: 8845798510aae74703467480f71ac613788d0696
FirebaseInstallations: 59c0e4c7a816a0f76710d83f77e5369b3e45eb96
FirebaseMessaging: ac9062bcc35ed56e15a0241d8fd317022499baf8
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef
GoogleDataTransport: ea169759df570f4e37bdee1623ec32a7e64e67c4
Expand All @@ -180,11 +180,11 @@ SPEC CHECKSUMS:
IosAwnCore: 6494e0e174d49f04f513e8a002187be226889a37
nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431
path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9
PromisesObjC: ab77feca74fa2823e7af4249b8326368e61014cb
SDWebImage: 9bec4c5cdd9579e1f57104735ee0c37df274d593
PromisesObjC: 09985d6d70fbe7878040aa746d78236e6946d2ef
SDWebImage: fd7e1a22f00303e058058278639bf6196ee431fe
shared_preferences_foundation: 986fc17f3d3251412d18b0265f9c64113a8c2472
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f

PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3

COCOAPODS: 1.11.3
COCOAPODS: 1.12.0
75 changes: 75 additions & 0 deletions lib/app/components/custom_snackbar.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class CustomSnackBar {
static showCustomSnackBar(
{required String title, required String message, Duration? duration}) {
Get.snackbar(
title,
message,
duration: duration ?? const Duration(milliseconds: 1500),
margin: const EdgeInsets.only(top: 10, left: 10, right: 10),
colorText: Colors.white,
backgroundColor: Colors.green,
icon: const Icon(
Icons.check_circle,
color: Colors.white,
),
);
}

static showCustomErrorSnackBar(
{required String title,
required String message,
Color? color,
Duration? duration}) {
Get.snackbar(
title,
message,
duration: duration ?? const Duration(milliseconds: 1500),
margin: const EdgeInsets.only(top: 10, left: 10, right: 10),
colorText: Colors.white,
backgroundColor: color ?? Colors.redAccent,
icon: const Icon(
Icons.error,
color: Colors.white,
),
);
}

static showCustomToast(
{String? title,
required String message,
Color? color,
Duration? duration}) {
Get.rawSnackbar(
title: title,
duration: duration ?? const Duration(milliseconds: 1500),
snackStyle: SnackStyle.GROUNDED,
backgroundColor: color ?? Colors.green,
onTap: (snack) {
Get.closeAllSnackbars();
},
//overlayBlur: 0.8,
message: message,
);
}

static showCustomErrorToast(
{String? title,
required String message,
Color? color,
Duration? duration}) {
Get.rawSnackbar(
title: title,
duration: duration ?? const Duration(milliseconds: 1500),
snackStyle: SnackStyle.GROUNDED,
backgroundColor: color ?? Colors.redAccent,
onTap: (snack) {
Get.closeAllSnackbars();
},
// overlayBlur: 0.8,
message: message,
);
}
}
1 change: 1 addition & 0 deletions lib/app/data/local/my_shared_pref.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class MySharedPref {

// STORING KEYS
static const String _fcmTokenKey = 'fcm_token';

static const String _currentLocalKey = 'current_local';
static const String _lightThemeKey = 'is_theme_light';

Expand Down
2 changes: 1 addition & 1 deletion lib/app/routes/app_pages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ part 'app_routes.dart';
class AppPages {
AppPages._();

static const INITIAL = Routes.NAV;
static const NAV = Routes.NAV;
static const HOME = Routes.HOME;

static final routes = [
Expand Down
5 changes: 1 addition & 4 deletions lib/app/service/api_exceptions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ class DioExceptions implements Exception {
case DioErrorType.connectionTimeout:
message = Strings.connectionTimeout.tr;
break;
case DioErrorType.connectionError:
message = Strings.connectionProblem.tr;
break;
case DioErrorType.receiveTimeout:
message = Strings.receiveTimeout.tr;
break;
Expand All @@ -26,7 +23,7 @@ class DioExceptions implements Exception {
message = Strings.sendTimeout.tr;
break;
case DioErrorType.unknown:
message = Strings.somethingWrong.tr;
message = Strings.connectionProblem.tr;
break;
default:
message = Strings.somethingWrong.tr;
Expand Down
3 changes: 2 additions & 1 deletion lib/app/service/base_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import 'helper/dialog_helper.dart';

class BaseController {
RxBool isError = false.obs;

void handleError(error) {
isError.value = true;
hideLoading();

/**/
var errorText = DioExceptions.fromDioError(error).toString();

showErrorDialog(Strings.oops.tr, errorText);
Expand Down
2 changes: 1 addition & 1 deletion lib/app/service/helper/api_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Header {
'Content-Type': 'multipart/form-data',
};

// SECURE HEADER
// SECURE MULTIPART HEADER
static Map<String, dynamic> secureMultipartHeader = {
"Authorization": "Bearer 'token'",
'Accept': 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Future<void> main() async {
},

initialRoute:
AppPages.INITIAL, // first screen to show when app is running
AppPages.NAV, // first screen to show when app is running
getPages: AppPages.routes, // app screens
locale: MySharedPref.getCurrentLocal(), // app language
translations:
Expand Down
1 change: 1 addition & 0 deletions lib/utils/constants.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
class AppImages {
static String get kAppIcon => 'assets/images/app_icon.png';
static String get kEmail => 'assets/images/email.png';
}
Loading

0 comments on commit 8719a3a

Please sign in to comment.