You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
195 lines
8.2 KiB
Dart
195 lines
8.2 KiB
Dart
// import 'package:car_provider_app/config/provider_routes.dart';
|
|
// import 'package:easy_localization/easy_localization.dart';
|
|
// import 'package:flutter/material.dart';
|
|
// import 'package:flutter_svg/flutter_svg.dart';
|
|
// import 'package:image_picker/image_picker.dart';
|
|
//
|
|
// import 'package:car_provider_app/view_models/dashboard_view_model.dart';
|
|
// import 'package:mc_common_app/classes/app_state.dart';
|
|
// import 'package:mc_common_app/classes/consts.dart';
|
|
// import 'package:mc_common_app/config/routes.dart';
|
|
// import 'package:mc_common_app/extensions/int_extensions.dart';
|
|
// import 'package:mc_common_app/extensions/string_extensions.dart';
|
|
// import 'package:mc_common_app/generated/locale_keys.g.dart';
|
|
// import 'package:mc_common_app/models/user_models/image_response.dart';
|
|
// import 'package:mc_common_app/theme/colors.dart';
|
|
// import 'package:mc_common_app/utils/navigator.dart';
|
|
// import 'package:mc_common_app/utils/utils.dart';
|
|
// import 'package:mc_common_app/widgets/button/show_fill_button.dart';
|
|
// import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
|
//
|
|
// class CustomDrawer extends StatefulWidget {
|
|
// final DashboardVM dashboardVM;
|
|
//
|
|
// const CustomDrawer({Key? key, required this.dashboardVM}) : super(key: key);
|
|
//
|
|
// @override
|
|
// State<CustomDrawer> createState() => _CustomDrawerState();
|
|
// }
|
|
//
|
|
// class _CustomDrawerState extends State<CustomDrawer> {
|
|
// void _openImagePicker() {
|
|
// showDialog<ImageSource>(
|
|
// context: context,
|
|
// builder: (context) => AlertDialog(
|
|
// content: const Text("Choose image source"),
|
|
// actions: [
|
|
// TextButton(child: const Text("Camera"), onPressed: () => widget.dashboardVM.pickImageFromPhone(context, 0)),
|
|
// TextButton(child: const Text("Gallery"), onPressed: () => widget.dashboardVM.pickImageFromPhone(context, 1)),
|
|
// ],
|
|
// ),
|
|
// );
|
|
// }
|
|
//
|
|
// @override
|
|
// Widget build(BuildContext context) {
|
|
// return Drawer(
|
|
// child: Column(
|
|
// children: [
|
|
// Stack(
|
|
// children: [
|
|
// Container(
|
|
// width: double.infinity,
|
|
// height: 200,
|
|
// color: MyColors.darkPrimaryColor.withOpacity(0.01),
|
|
// child: Image.network(
|
|
// // ApiConsts.baseUrlServices +
|
|
// AppState().getUser.data!.userInfo!.userImageUrl.toString(),
|
|
// ),
|
|
// ),
|
|
// Positioned(
|
|
// top: 10,
|
|
// right: 10,
|
|
// child: Row(
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
// children: [
|
|
// Column(
|
|
// children: [
|
|
// Container(
|
|
// width: 40,
|
|
// height: 40,
|
|
// decoration: BoxDecoration(
|
|
// color: Colors.grey[200],
|
|
// borderRadius: BorderRadius.circular(30),
|
|
// ),
|
|
// child: const Icon(
|
|
// Icons.edit,
|
|
// color: MyColors.darkPrimaryColor,
|
|
// ).onPress(() {
|
|
// _openImagePicker();
|
|
// // _handleURLButtonPress(context, ImageSourceType.camera);
|
|
// }),
|
|
// ),
|
|
// 12.height,
|
|
// Container(
|
|
// width: 40,
|
|
// height: 40,
|
|
// decoration: BoxDecoration(
|
|
// color: Colors.grey[200],
|
|
// borderRadius: BorderRadius.circular(30),
|
|
// ),
|
|
// child: const Icon(
|
|
// Icons.delete,
|
|
// color: Colors.red,
|
|
// ).onPress(() async {
|
|
// Utils.showLoading(context);
|
|
// ImageResponse response = await widget.dashboardVM.updateUserImage("");
|
|
// if (response.messageStatus == 1) {
|
|
// Utils.showToast("Image is Deleted");
|
|
// setState(() {
|
|
// AppState().getUser.data!.userInfo!.userImageUrl = response.data;
|
|
// });
|
|
// }
|
|
// Utils.hideLoading(context);
|
|
// }),
|
|
// ),
|
|
// ],
|
|
// ),
|
|
// ],
|
|
// ),
|
|
// )
|
|
// ],
|
|
// ),
|
|
// Container(
|
|
// width: double.infinity,
|
|
// color: MyColors.darkPrimaryColor.withOpacity(0.1),
|
|
// padding: const EdgeInsets.all(20),
|
|
// child: Row(
|
|
// children: [
|
|
// Expanded(
|
|
// child: Column(
|
|
// mainAxisAlignment: MainAxisAlignment.start,
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
// children: [
|
|
// AppState().getUser.data!.userInfo!.firstName!.toText(
|
|
// isBold: true,
|
|
// fontSize: 20,
|
|
// letterSpacing: -1.44,
|
|
// ),
|
|
// AppState().getUser.data!.userInfo!.roleName! == "ServiceProvider_Dealership" || AppState().getUser.data!.userInfo!.roleName! == "ServiceProvider_Individual"
|
|
// ? ("${AppState().getUser.data!.userInfo!.roleName!.split("_").first} ${AppState().getUser.data!.userInfo!.roleName!.split("_").last}").toText()
|
|
// : AppState().getUser.data!.userInfo!.roleName!.toText(fontSize: 10),
|
|
// ],
|
|
// ),
|
|
// ),
|
|
// ShowFillButton(
|
|
// title: LocaleKeys.edit.tr(),
|
|
// fontSize: 12,
|
|
// maxHeight: 35,
|
|
// maxWidth: 70,
|
|
// onPressed: () {
|
|
// navigateWithName(context, AppRoutes.editAccountPage);
|
|
// },
|
|
// ),
|
|
// ],
|
|
// ),
|
|
// ),
|
|
// ListTile(
|
|
// leading: SvgPicture.asset(MyAssets.nextIcon, color: MyColors.darkPrimaryColor),
|
|
// title: LocaleKeys.defineLicences.tr().toText(fontSize: 12),
|
|
// onTap: () {
|
|
// // AppPermissions.checkStoragePermissions(context);
|
|
// navigateWithName(context, ProviderAppRoutes.defineLicense);
|
|
// },
|
|
// ),
|
|
// ListTile(
|
|
// leading: SvgPicture.asset(MyAssets.nextIcon, color: MyColors.darkPrimaryColor),
|
|
// title: "Subscriptions".toText(fontSize: 12),
|
|
// onTap: () {
|
|
// navigateWithName(context, ProviderAppRoutes.mySubscriptionsPage);
|
|
// },
|
|
// ),
|
|
// ListTile(
|
|
// leading: Image.asset(
|
|
// MyAssets.icWorldPng,
|
|
// width: 20,
|
|
// height: 20,
|
|
// color: MyColors.darkPrimaryColor,
|
|
// ),
|
|
// title: LocaleKeys.english.tr().toText(fontSize: 12),
|
|
// onTap: () {
|
|
// if (EasyLocalization.of(context)?.currentLocale?.countryCode == "SA") {
|
|
// context.setLocale(const Locale("en", "US"));
|
|
// } else {
|
|
// context.setLocale(const Locale('ar', 'SA'));
|
|
// }
|
|
// },
|
|
// ),
|
|
// ListTile(
|
|
// leading: const Icon(
|
|
// Icons.logout,
|
|
// color: MyColors.darkPrimaryColor,
|
|
// ),
|
|
// title: LocaleKeys.signOut.tr().toText(fontSize: 12),
|
|
// onTap: () {
|
|
// pop(context);
|
|
// navigateReplaceWithName(context, AppRoutes.registerSelection);
|
|
// },
|
|
// ),
|
|
// ],
|
|
// ),
|
|
// );
|
|
// }
|
|
// }
|