Skip to content

Commit

Permalink
Merge pull request flutter#23 from Otobucks01/Zameer
Browse files Browse the repository at this point in the history
changes by Zameer
  • Loading branch information
inzimambhatti authored Feb 11, 2023
2 parents ad3696e + 106ba8d commit a377fc6
Show file tree
Hide file tree
Showing 15 changed files with 178 additions and 138 deletions.
Binary file added assets/images/delete_account.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/splash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = T2UZQABC5L;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
Expand All @@ -401,7 +401,7 @@
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
VERSIONING_SYSTEM = "apple-generic";
};
name = Profile;
Expand Down Expand Up @@ -522,7 +522,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = T2UZQABC5L;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
Expand All @@ -542,7 +542,7 @@
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
Expand All @@ -556,7 +556,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = T2UZQABC5L;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
Expand All @@ -575,7 +575,7 @@
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
Expand Down
2 changes: 1 addition & 1 deletion ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Edumegaearning</string>
<string>Otobucks</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
Expand Down
21 changes: 21 additions & 0 deletions lib/View/Auth/controllers/login_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,27 @@ class LoginController extends GetxController {
});
}

deleteUserTask(BuildContext context) async {
isShowLoader = true;
update();

HashMap<String, Object> requestParams = HashMap();
final prefManager = await SharedPreferences.getInstance();

var userId = prefManager.getString(SharedPrefKey.KEY_USER_ID);

var deleteUser = await LoginRepo().deleteAccount(requestParams, userId.toString());

isShowLoader = false;
update();

deleteUser.fold((failure) {
Global.showToastAlert(context: context, strTitle: "", strMsg: failure.MESSAGE, toastType: TOAST_TYPE.toastError);
}, (mResult) {
Global.setLogout(context);
});
}

void gotoMobileOTPScreen(BuildContext context) async {
ModelOTP mModelOTP = ModelOTP(password: controllerPassword.text.toString(), emailId: controllerEmail.text.toString());

Expand Down
5 changes: 4 additions & 1 deletion lib/View/Drawer/Views/drawer_custom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ getDrawerItem(DrawerItem mDrawerItem, BuildContext context) {
}
if (mDrawerItem.pageType == PageType.logout) {
Global.showLogoutDialog(Get.overlayContext!);
} else if (mDrawerItem.pageType == PageType.deleteAccount) {
Global.showDeleteAccountDialog(Get.overlayContext!);
} else {
Get.find<HomeScreenController>().callback(mDrawerItem.pageType);
}
Expand Down Expand Up @@ -217,5 +219,6 @@ var alDrawerItem = [
// icon: AppImages.ic_drawer_about,
// pageType: PageType.aboutUs),
DrawerItem(title: Constants.TAG_CUSTOMER, icon: AppImages.ic_whatsapp, pageType: PageType.whatsapp),
DrawerItem(title: Constants.TAG_LOG_OUT, icon: AppImages.ic_drawer_logout, pageType: PageType.logout)
DrawerItem(title: Constants.TAG_LOG_OUT, icon: AppImages.ic_drawer_logout, pageType: PageType.logout),
DrawerItem(title: Constants.TAG_DELETE_ACCOUNT, icon: AppImages.ic_delete_account, pageType: PageType.deleteAccount)
];
8 changes: 4 additions & 4 deletions lib/View/Profile/View/my_profile_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class MyProfileFragmentState extends State<MyProfileFragment> {
String? editId;
@override
void initState() {
if (controller.carList.isEmpty && controller.mUserModel == null) {
controller.getCarList();
controller.getProfile();
}
// if (controller.carList.isEmpty && controller.mUserModel == null) {
controller.getCarList();
controller.getProfile();
// }

super.initState();
}
Expand Down
45 changes: 33 additions & 12 deletions lib/View/SplashScreen/Views/splash_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,41 @@ class _SplashScreenState extends State<SplashScreen> {
SizeConfig().init(constraints, orientation);
return Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: AppColors.colorWhite,
body: SizedBox(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: Stack(
children: <Widget>[
VideoPlayer(_controller),
ClosedCaption(text: _controller.value.caption.text),
// _ControlsOverlay(controller: _controller),
// VideoProgressIndicator(_controller, allowScrubbing: false),
],
),
backgroundColor: AppColors.colorBlueEnd,
body: Stack(
children: <Widget>[
Container(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
decoration: const BoxDecoration(image: DecorationImage(image: AssetImage("assets/images/splash.jpg"), fit: BoxFit.fitHeight)),
),
Positioned(
bottom: MediaQuery.of(context).size.height * 0.1,
left: MediaQuery.of(context).size.width * 0.45,
child: const CircularProgressIndicator(
color: Colors.white,
),
)
// _ControlsOverlay(controller: _controller),
// VideoProgressIndicator(_controller, allowScrubbing: false),
],
),

// if you want to replace image with video use this

// SizedBox(
// height: MediaQuery.of(context).size.height,
// width: MediaQuery.of(context).size.width,
// child: Stack(
// children: <Widget>[
// VideoPlayer(_controller),
// ClosedCaption(text: _controller.value.caption.text),
// // _ControlsOverlay(controller: _controller),
// // VideoProgressIndicator(_controller, allowScrubbing: false),
// ],
// ),
// ),

// ConstrainedBox(
// constraints: const BoxConstraints.expand(),
// child: Container(
Expand Down
43 changes: 15 additions & 28 deletions lib/global/app_images.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
class AppImages {
// assert images Start
static const String icAppIconWhite = "assets/images/ic_app_icon_white.png";
static const String icSplashScreenIcon =
"assets/images/side_drawer_logo.png";
static const String icSplashScreenIcon = "assets/images/side_drawer_logo.png";
static const String ic_place_holder = "assets/images/ic_place_holder.png";
static const String appLogo = "assets/images/autofix.png";
static const String ic_alert_circle = "assets/images/ic_alert_circle.png";
Expand Down Expand Up @@ -35,47 +34,35 @@ class AppImages {

static const String ic_drawer_about = "assets/images/ic_drawer_about.png";
static const String ic_drawer_add_car = "assets/images/ic_drawer_add_car.png";
static const String ic_customer_support =
"assets/images/ic_customer_support.png";
static const String ic_drawer_analytics =
"assets/images/ic_drawer_analytics.png";
static const String ic_drawer_booking_history =
"assets/images/ic_drawer_booking_history.png";
static const String ic_drawer_estimation =
"assets/images/ic_drawer_estimation.png";
static const String ic_customer_support = "assets/images/ic_customer_support.png";
static const String ic_drawer_analytics = "assets/images/ic_drawer_analytics.png";
static const String ic_drawer_booking_history = "assets/images/ic_drawer_booking_history.png";
static const String ic_drawer_estimation = "assets/images/ic_drawer_estimation.png";
static const String ic_drawer_invite = "assets/images/ic_drawer_invite.png";
static const String ic_drawer_my_profile =
"assets/images/ic_drawer_my_profile.png";
static const String ic_drawer_notification =
"assets/images/ic_drawer_notification.png";
static const String ic_drawer_my_profile = "assets/images/ic_drawer_my_profile.png";
static const String ic_drawer_notification = "assets/images/ic_drawer_notification.png";
static const String ic_drawer_rating = "assets/images/ic_drawer_rating.png";
static const String ic_drawer_terms = "assets/images/ic_drawer_terms.png";
static const String ic_drawer_transection_history =
"assets/images/ic_drawer_transection_history.png";
static const String ic_drawer_purchase_product =
"assets/images/ic_drawer_purchase_product.png";
static const String ic_drawer_transection_history = "assets/images/ic_drawer_transection_history.png";
static const String ic_drawer_purchase_product = "assets/images/ic_drawer_purchase_product.png";
static const String ic_drawer_wallet = "assets/images/ic_drawer_wallet.png";
static const String ic_delete_account = "assets/images/delete_account.png";
static const String ic_drawer_logout = "assets/images/ic_drawer_logout.png";
static const String ic_drawer_facebook =
"assets/images/ic_drawer_facebook.png";
static const String ic_drawer_facebook = "assets/images/ic_drawer_facebook.png";
static const String ic_drawer_google = "assets/images/ic_drawer_google.png";
static const String ic_drawer_insta = "assets/images/ic_drawer_insta.png";
static const String ic_round_blue_tick =
"assets/images/ic_round_blue_tick.png";
static const String ic_round_blue_tick = "assets/images/ic_round_blue_tick.png";
static const String ic_camera = "assets/images/ic_camera.png";
static const String ic_cloud = "assets/images/ic_cloud.png";
static const String ic_video_cam = "assets/images/ic_video_cam.png";
static const String ic_mic = "assets/images/ic_mic.png";
static const String ic_thank_you_service =
"assets/images/book_done.png";
static const String ic_thank_you_service = "assets/images/book_done.png";
static const String ic_thank_you = "assets/images/ic_thank_you.png";
static const String ic_edit_profile_icon =
"assets/images/ic_edit_profile_icon.png";
static const String ic_edit_profile_icon = "assets/images/ic_edit_profile_icon.png";
static const String ic_car = "assets/images/ic_car.png";
static const String ic_color = "assets/images/ic_color.png";
static const String ic_petrol = "assets/images/ic_petrol.png";
static const String ic_invite_friend_top_image =
"assets/images/ic_invite_friend_top_image.png";
static const String ic_invite_friend_top_image = "assets/images/ic_invite_friend_top_image.png";

static const String ic_fb_share = "assets/images/ic_fb_share.png";
static const String ic_linked = "assets/images/ic_linkedin.png";
Expand Down
4 changes: 3 additions & 1 deletion lib/global/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ class Constants {
TAG_ENTER_YOUR_CAR_DETAILS = 'Enter your car details',
//it was Estimations then text is replaced by My Bookings in drawerremaininh navigationis with same name of estimation just text changed
TAG_ESTIMATION = 'My Booking'.tr,
TAG_LOG_OUT = 'Log Out';
TAG_LOG_OUT = 'Log Out',
TAG_DELETE_ACCOUNT = 'Delete Account';

// dashboard
static const String STATUS_PENDING = "pending",
Expand Down Expand Up @@ -370,6 +371,7 @@ class Constants {

// Logout app dialog
static const String STRING_SIGN_OUT = "Sign Out?", STRING_SIGN_OUT_MSG = "Do you want to Sign Out ?", STRING_OK = "Ok", STRING_BACK = "Back";
static const String STRING_DELETE_Account = "DELETE ACCOUNT", STRING_DELETE_Account_msg = "Are you sure you want to delete your account permanantly ?";

static const String STRING_PRODUCT_QUANTITY = "Product Quantity",
STRING_ORDER_DETAIL = "Order Detail",
Expand Down
10 changes: 2 additions & 8 deletions lib/global/enum.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ enum PageType {
whatsapp,
estimations,
logout,
deleteAccount,
promotions,
thankYou,
}
Expand Down Expand Up @@ -46,13 +47,6 @@ enum ShowData { showData, showNoDataFound, showLoading, showError }
enum TOAST_TYPE { toastInfo, toastSuccess, toastWarning, toastError }

//
enum EstimationStatus {
pending,
inProgress,
complete,
cancelled,
submitted,
all
}
enum EstimationStatus { pending, inProgress, complete, cancelled, submitted, all }

enum CarType { newCar, oldCar }
29 changes: 29 additions & 0 deletions lib/global/global.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:collection';
import 'dart:convert';
import 'dart:developer';
import 'dart:io';
Expand All @@ -13,6 +14,7 @@ import 'package:image_cropper/image_cropper.dart';
import 'package:intl/intl.dart';
// import 'package:date_range_picker/date_range_picker.dart' as DateRangePicker;
import 'package:location/location.dart' as location_selection;
import 'package:otobucks/View/Auth/controllers/login_controller.dart';
import 'package:otobucks/global/Models/failure.dart';
import 'package:otobucks/global/Models/time_model.dart';
import 'package:otobucks/global/app_style.dart';
Expand All @@ -26,6 +28,7 @@ import 'package:share_plus/share_plus.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:url_launcher/url_launcher.dart';
import '../View/Auth/Models/country_code.dart';
import '../services/repository/login_repo.dart';
import '../widgets/custom_ui/bot_sms.dart';
import '../widgets/custom_ui/bottom_sheet.dart';
import 'Models/date_model.dart';
Expand Down Expand Up @@ -585,6 +588,32 @@ class Global {
});
}

static showDeleteAccountDialog(BuildContext mContext) {
AppViews.showCustomAlert(
context: mContext,
strTitle: Constants.STRING_DELETE_Account,
strMessage: Constants.STRING_DELETE_Account_msg,
strLeftBtnText: Constants.TEXT_CANCEL,
onTapLeftBtn: () {
Navigator.pop(mContext);
},
strRightBtnText: Constants.STRING_OK,
onTapRightBtn: () async {
HashMap<String, Object> requestParams = HashMap();
final prefManager = await SharedPreferences.getInstance();

var userId = prefManager.getString(SharedPrefKey.KEY_USER_ID);

var deleteUser = await LoginRepo().deleteAccount(requestParams, userId.toString());

deleteUser.fold((failure) {
Global.showToastAlert(context: mContext, strTitle: "", strMsg: failure.MESSAGE, toastType: TOAST_TYPE.toastError);
}, (mResult) {
Global.setLogout(mContext);
});
});
}

static setLogout(BuildContext mContext) async {
final prefManager = await SharedPreferences.getInstance();

Expand Down
1 change: 1 addition & 0 deletions lib/global/url_collection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class RequestBuilder {
static final String API_CURRENT_USER = "auth/users/currentUser";
static final String API_UPDATE_USER = "auth/customers/updateMe";
static final String API_FORGOT_PASSWORD = "auth/customers/forgotPassword";
static final String API_DELETE_ACCOUNT = "auth/customers/deleteAccount/";
static final String API_RESET_PASSWORD = "auth/customers/resetPassword/";
static final String API_SIGN_UP = "auth/customers/register";
static final String API_DELETE_Booking = "bookings/bookService";
Expand Down
Loading

0 comments on commit a377fc6

Please sign in to comment.