issues fixed

aamir_dev
Faiz Hashmi 1 year ago
parent 283c0e9d5a
commit 0d0597ae48

@ -583,11 +583,11 @@
"addNewAppointment": "Add New Appointment", "addNewAppointment": "Add New Appointment",
"myNearbyBranches": "My Nearby Branches", "myNearbyBranches": "My Nearby Branches",
"myRecentBranches": "My Recent Branches", "myRecentBranches": "My Recent Branches",
"favoriteList": "Favourite List", "favoriteList": "Favorite List",
"noReviewsBranch": "This branch has no reviews.", "noReviewsBranch": "This branch has no reviews.",
"readLess": "Read Less", "readLess": "Read Less",
"readMoreReviews": "Read More Reviews", "readMoreReviews": "Read More Reviews",
"noProvidersInFav": "You have no providers in Favourites.", "noProvidersInFav": "You have no providers in Favorites.",
"providerHasNoBranches": "This Provider has no branches yet.", "providerHasNoBranches": "This Provider has no branches yet.",
"totalBranches": "Total Branches", "totalBranches": "Total Branches",
"memberSince": "Member Since", "memberSince": "Member Since",
@ -681,7 +681,7 @@
"adsRemaining": "Ads Remaining", "adsRemaining": "Ads Remaining",
"attachPDF": "Attach PDF", "attachPDF": "Attach PDF",
"noItemsToShow": "No Items to show.", "noItemsToShow": "No Items to show.",
"serviceItem" : "Service Item", "serviceItem": "Service Item",
"createdBy" : "Created By", "createdBy": "Created By",
"createGroupServices": "Create Group Services" "createGroupServices": "Create Group Services"
} }

@ -633,11 +633,11 @@ extension DateTimeConversions on DateTime {
} else if (difference.inHours >= 1) { } else if (difference.inHours >= 1) {
return (numericDates) ? '1 hour ago' : 'An hour ago'; return (numericDates) ? '1 hour ago' : 'An hour ago';
} else if (difference.inMinutes >= 2) { } else if (difference.inMinutes >= 2) {
return '${difference.inMinutes} minutes ago'; return '${difference.inMinutes} min ago';
} else if (difference.inMinutes >= 1) { } else if (difference.inMinutes >= 1) {
return (numericDates) ? '1 minute ago' : 'A minute ago'; return (numericDates) ? '1 min ago' : 'A min ago';
} else if (difference.inSeconds >= 3) { } else if (difference.inSeconds >= 3) {
return '${difference.inSeconds} seconds ago'; return '${difference.inSeconds} sec ago';
} else { } else {
return 'Just now'; return 'Just now';
} }

@ -1288,11 +1288,11 @@ static const Map<String,dynamic> en_US = {
"addNewAppointment": "Add New Appointment", "addNewAppointment": "Add New Appointment",
"myNearbyBranches": "My Nearby Branches", "myNearbyBranches": "My Nearby Branches",
"myRecentBranches": "My Recent Branches", "myRecentBranches": "My Recent Branches",
"favoriteList": "Favourite List", "favoriteList": "Favorite List",
"noReviewsBranch": "This branch has no reviews.", "noReviewsBranch": "This branch has no reviews.",
"readLess": "Read Less", "readLess": "Read Less",
"readMoreReviews": "Read More Reviews", "readMoreReviews": "Read More Reviews",
"noProvidersInFav": "You have no providers in Favourites.", "noProvidersInFav": "You have no providers in Favorites.",
"providerHasNoBranches": "This Provider has no branches yet.", "providerHasNoBranches": "This Provider has no branches yet.",
"totalBranches": "Total Branches", "totalBranches": "Total Branches",
"memberSince": "Member Since", "memberSince": "Member Since",

@ -666,5 +666,4 @@ abstract class LocaleKeys {
static const createdBy = 'createdBy'; static const createdBy = 'createdBy';
static const createGroupServices = 'createGroupServices'; static const createGroupServices = 'createGroupServices';
} }

@ -28,7 +28,13 @@ class Utils {
static bool get isLoading => _isLoadingVisible; static bool get isLoading => _isLoadingVisible;
static void showToast(String message) { static void showToast(String message) {
Fluttertoast.showToast(msg: message, toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.BOTTOM, timeInSecForIosWeb: 2, backgroundColor: Colors.black54, textColor: Colors.white, fontSize: 16.0); Fluttertoast.showToast(msg: message,
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM,
timeInSecForIosWeb: 2,
backgroundColor: Colors.black54,
textColor: Colors.white,
fontSize: 16.0);
} }
static Future<void> openNumberViaCaller({required String phoneNumber}) async { static Future<void> openNumberViaCaller({required String phoneNumber}) async {
@ -71,7 +77,11 @@ class Utils {
return ""; return "";
} }
return ("${timeOfDay.hour.toString().length == 1 ? "0" : ""}${timeOfDay.hour}:${timeOfDay.minute.toString().length == 1 ? "0" : ""}${timeOfDay.minute}").toString(); return ("${timeOfDay.hour
.toString()
.length == 1 ? "0" : ""}${timeOfDay.hour}:${timeOfDay.minute
.toString()
.length == 1 ? "0" : ""}${timeOfDay.minute}").toString();
} }
static dynamic getNotNullValue(List<dynamic> list, int index) { static dynamic getNotNullValue(List<dynamic> list, int index) {
@ -553,7 +563,8 @@ class Utils {
} }
static String getAdsPaymentBrowserForm({required int paymentId, required int adId}) { static String getAdsPaymentBrowserForm({required int paymentId, required int adId}) {
return '<html> <head></head><body><form id="paymentForm" action="${ApiConsts.paymentWebViewUrl}" method="post"><input type="hidden" name="PaymentType" value="$paymentId"><input type="hidden" name="AdsID" value="$adId"></form><script type="text/javascript"> document.getElementById("paymentForm").submit(); </script></body></html>'; return '<html> <head></head><body><form id="paymentForm" action="${ApiConsts
.paymentWebViewUrl}" method="post"><input type="hidden" name="PaymentType" value="$paymentId"><input type="hidden" name="AdsID" value="$adId"></form><script type="text/javascript"> document.getElementById("paymentForm").submit(); </script></body></html>';
} }
// BOTTOM SHEETS // BOTTOM SHEETS
@ -577,15 +588,27 @@ class Utils {
); );
} }
static Widget buildStatusContainer(String text) { static Widget buildStatusContainer(String text, {double marginAll = 8, double fontSize = 14}) {
return Center( return Center(
child: text.toText(color: MyColors.lightTextColor, fontSize: 14), child: text.toText(color: MyColors.lightTextColor, fontSize: fontSize),
).toContainer( ).toContainer(
marginAll: 8, marginAll: marginAll,
paddingAll: 15, paddingAll: 15,
borderRadius: 8, borderRadius: 8,
width: double.infinity, width: double.infinity,
backgroundColor: MyColors.grey98Color.withOpacity(0.1), backgroundColor: MyColors.grey98Color.withOpacity(0.1),
); );
} }
static Future<void> openLocationInMaps({required double latitude, required double longitude}) async {
final Uri googleMapsUrl = Uri.parse('https://www.google.com/maps/search/?api=1&query=$latitude,$longitude');
if (await canLaunchUrl(googleMapsUrl)) {
try {
await launchUrl(googleMapsUrl);
} catch (e) {
await launchUrl(googleMapsUrl);
}
}
}
} }

@ -149,7 +149,7 @@ class AppointmentsVM extends BaseVM {
navigateWithName(context, AppRoutes.paymentMethodsView, arguments: PaymentTypes.appointment); navigateWithName(context, AppRoutes.paymentMethodsView, arguments: PaymentTypes.appointment);
} else { } else {
Utils.showToast(LocaleKeys.appointmentBookedSuccessfully.tr()); Utils.showToast(LocaleKeys.appointmentBookedSuccessfully.tr());
getMyAppointments(); getMyAppointmentsForCustomer();
navigateReplaceWithNameUntilRoute(context, AppRoutes.dashboard); navigateReplaceWithNameUntilRoute(context, AppRoutes.dashboard);
} }
} }
@ -181,9 +181,9 @@ class AppointmentsVM extends BaseVM {
context.read<DashboardVmCustomer>().onNavbarTapped(1); context.read<DashboardVmCustomer>().onNavbarTapped(1);
applyFilterOnAppointmentsVM(appointmentStatusEnum: AppointmentStatusEnum.cancelled); applyFilterOnAppointmentsVM(appointmentStatusEnum: AppointmentStatusEnum.cancelled);
Utils.showToast(genericRespModel.message.toString()); Utils.showToast(genericRespModel.message.toString());
await getMyAppointments(); await getMyAppointmentsForCustomer();
Utils.hideLoading(context); Utils.hideLoading(context);
getMyAppointments(); getMyAppointmentsForCustomer();
navigateReplaceWithNameUntilRoute(context, AppRoutes.dashboard); navigateReplaceWithNameUntilRoute(context, AppRoutes.dashboard);
} }
} catch (e) { } catch (e) {
@ -350,7 +350,7 @@ class AppointmentsVM extends BaseVM {
// notifyListeners(); // notifyListeners();
// } // }
Future<void> getMyAppointments({bool isNeedToRebuild = false}) async { Future<void> getMyAppointmentsForCustomer({bool isNeedToRebuild = false}) async {
if (isNeedToRebuild) setState(ViewState.busy); if (isNeedToRebuild) setState(ViewState.busy);
myAppointments = await appointmentRepo.getMyAppointmentsForCustomersByFilters(); myAppointments = await appointmentRepo.getMyAppointmentsForCustomersByFilters();
@ -383,7 +383,9 @@ class AppointmentsVM extends BaseVM {
setState(ViewState.busy); setState(ViewState.busy);
myAppointments = await appointmentRepo.getMyAppointmentsForProvider(map); myAppointments = await appointmentRepo.getMyAppointmentsForProvider(map);
myFilteredAppointments = myAppointments; myFilteredAppointments = myAppointments;
myUpComingAppointments = myAppointments.where((element) => element.appointmentStatusEnum == AppointmentStatusEnum.confirmed && (DateHelper.parseStringToDate(element.appointmentDate!).isAfter(DateTime.now()))).toList(); myUpComingAppointments = myAppointments
.where((element) => (element.appointmentStatusEnum == AppointmentStatusEnum.confirmed || element.appointmentStatusEnum == AppointmentStatusEnum.booked) && (DateHelper.parseStringToDate(element.appointmentDate!).isAfter(DateTime.now())))
.toList();
applyFilterOnAppointmentsVM(appointmentStatusEnum: AppointmentStatusEnum.allAppointments, isNeedCustomerFilter: true); applyFilterOnAppointmentsVM(appointmentStatusEnum: AppointmentStatusEnum.allAppointments, isNeedCustomerFilter: true);
setState(ViewState.idle); setState(ViewState.idle);
} }
@ -802,7 +804,7 @@ class AppointmentsVM extends BaseVM {
context.read<DashboardVmCustomer>().onNavbarTapped(1); context.read<DashboardVmCustomer>().onNavbarTapped(1);
applyFilterOnAppointmentsVM(appointmentStatusEnum: AppointmentStatusEnum.cancelled); applyFilterOnAppointmentsVM(appointmentStatusEnum: AppointmentStatusEnum.cancelled);
Utils.showToast(genericRespModel.message.toString()); Utils.showToast(genericRespModel.message.toString());
getMyAppointments(); getMyAppointmentsForCustomer();
Utils.hideLoading(context); Utils.hideLoading(context);
navigateReplaceWithNameUntilRoute(context, AppRoutes.dashboard); navigateReplaceWithNameUntilRoute(context, AppRoutes.dashboard);
} }
@ -1419,7 +1421,7 @@ class AppointmentsVM extends BaseVM {
appointmentFilterBranchSearchHistory.clear(); appointmentFilterBranchSearchHistory.clear();
appointmentFiltersCounter = 0; appointmentFiltersCounter = 0;
clearAppointmentFilterSelections(); clearAppointmentFilterSelections();
getMyAppointments(); getMyAppointmentsForCustomer();
notifyListeners(); notifyListeners();
} }

@ -65,7 +65,7 @@ class DashboardVmCustomer extends BaseVM {
appointmentsVM.populateAppointmentsFilterList(); appointmentsVM.populateAppointmentsFilterList();
adVM.populateAdsFilterList(); adVM.populateAdsFilterList();
requestsVM.populateDataForRequestsFilter(); requestsVM.populateDataForRequestsFilter();
await appointmentsVM.getMyAppointments(); await appointmentsVM.getMyAppointmentsForCustomer();
await appointmentsVM.applyFilterOnBranches(index: 0); // to get all branches! await appointmentsVM.applyFilterOnBranches(index: 0); // to get all branches!
await appointmentsVM.getMyRecentBranches(); // to get my recent branches! await appointmentsVM.getMyRecentBranches(); // to get my recent branches!
await adVM.getMyAds(); await adVM.getMyAds();

@ -626,7 +626,7 @@ class RequestsVM extends BaseVM {
bool isCountryFetching = false; bool isCountryFetching = false;
//Request Management //Request Management
String price = "0.0"; String price = "1.0";
String description = ""; String description = "";
String address = ""; String address = "";
String model = ""; String model = "";

@ -149,7 +149,7 @@ class ServiceVM extends BaseVM {
// } // }
// } // }
final BranchDetailModel currentBranch = homePageBranches.firstWhere((element) => element.id == selectedBranchId); final BranchDetailModel currentBranch = branches!.data!.serviceProviderBranch!.firstWhere((element) => element.id == selectedBranchId);
for (var element in currentBranch.branchServices!) { for (var element in currentBranch.branchServices!) {
categories.add( categories.add(
CategoryData( CategoryData(

@ -1,4 +1,5 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:developer';
import 'dart:io'; import 'dart:io';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:file_picker/file_picker.dart'; import 'package:file_picker/file_picker.dart';
@ -349,6 +350,7 @@ class UserVM extends BaseVM {
} }
Future<void> performBasicOtpLoginSelectionPage(BuildContext context, {required String userToken, required AppType appType, String? loginType}) async { Future<void> performBasicOtpLoginSelectionPage(BuildContext context, {required String userToken, required AppType appType, String? loginType}) async {
log("loginType: $loginType");
if (loginType == "3" || loginType == "4") { if (loginType == "3" || loginType == "4") {
//Utils.showLoading(context); //Utils.showLoading(context);
LoginPasswordRespModel user = await userRepo.loginV2OTP(userToken, loginType!); LoginPasswordRespModel user = await userRepo.loginV2OTP(userToken, loginType!);
@ -431,6 +433,9 @@ class UserVM extends BaseVM {
} else { } else {
Utils.showToast(LocaleKeys.onlyCustomerApp.tr()); Utils.showToast(LocaleKeys.onlyCustomerApp.tr());
} }
} else {
Utils.showToast("Please verify your credentials and role type.");
} }
} else { } else {
Utils.showToast(verifiedUser.message ?? ""); Utils.showToast(verifiedUser.message ?? "");
@ -678,9 +683,12 @@ class UserVM extends BaseVM {
AppState().getUser.data!.userInfo!.userImageUrl = null; AppState().getUser.data!.userInfo!.userImageUrl = null;
} }
AppState().setUser = null; AppState().setUser = null;
if (AppState().currentAppType == AppType.provider) {
AppState().setproviderSubscription = null; AppState().setproviderSubscription = null;
context.read<SubscriptionsVM>().mySubscriptionsBySp.clear(); context.read<SubscriptionsVM>().mySubscriptionsBySp.clear();
context.read<SubscriptionsVM>().allSubscriptions = SubscriptionModel(); context.read<SubscriptionsVM>().allSubscriptions = SubscriptionModel();
}
navigateReplaceWithNameUntilRoute(context, AppRoutes.registerSelection); navigateReplaceWithNameUntilRoute(context, AppRoutes.registerSelection);
} }
} }

@ -30,7 +30,6 @@ class AdsListWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (isAdsFragment && adsList.isEmpty) { if (isAdsFragment && adsList.isEmpty) {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -139,11 +138,7 @@ class AdCard extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
(adDetails.vehicle!.cityName ?? "").toText(color: MyColors.lightTextColor), (adDetails.vehicle!.cityName ?? "").toText(color: MyColors.lightTextColor),
adDetails.createdOn != null adDetails.createdOn != null ? DateTime.parse(adDetails.createdOn!).getTimeAgo().toText(color: MyColors.lightTextColor) : const SizedBox(),
? DateTime.parse(adDetails.createdOn!).getTimeAgo().toText(
color: MyColors.lightTextColor,
)
: const SizedBox(),
], ],
), ),
], ],

@ -26,7 +26,6 @@ class CreateRequestPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
log("AppState().getUser.data!.userInfo :${AppState().getUser.data!.userInfo.toString()}");
return Scaffold( return Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
title: LocaleKeys.createRequest.tr(), title: LocaleKeys.createRequest.tr(),
@ -223,11 +222,13 @@ class CreateRequestPage extends StatelessWidget {
), ),
8.height, 8.height,
], ],
if (requestsVM.pickedVehicleImages.isEmpty) ...[
DottedRectContainer( DottedRectContainer(
onTap: () => context.read<RequestsVM>().pickMultipleImages(), onTap: () => context.read<RequestsVM>().pickMultipleImages(),
text: LocaleKeys.attachImage.tr(), text: LocaleKeys.attachImage.tr(),
icon: MyAssets.attachmentIcon.buildSvg(), icon: MyAssets.attachmentIcon.buildSvg(),
), ),
],
if (requestsVM.vehicleImageError != "") ...[ if (requestsVM.vehicleImageError != "") ...[
10.height, 10.height,
Row( Row(

@ -48,7 +48,6 @@ Future buildSendOfferBottomSheet({required BuildContext context, required Reques
TxtField( TxtField(
value: requestsVM.serviceItem, value: requestsVM.serviceItem,
errorValue: requestsVM.offerPriceError, errorValue: requestsVM.offerPriceError,
keyboardType: TextInputType.number,
hint: LocaleKeys.serviceItem.tr(), hint: LocaleKeys.serviceItem.tr(),
onChanged: (v) => requestsVM.updateServiceItem(v), onChanged: (v) => requestsVM.updateServiceItem(v),
), ),
@ -56,7 +55,6 @@ Future buildSendOfferBottomSheet({required BuildContext context, required Reques
TxtField( TxtField(
value: requestsVM.itemManufacturer, value: requestsVM.itemManufacturer,
errorValue: requestsVM.offerPriceError, errorValue: requestsVM.offerPriceError,
keyboardType: TextInputType.number,
hint: LocaleKeys.createdBy.tr(), hint: LocaleKeys.createdBy.tr(),
onChanged: (v) => requestsVM.updateItemManufacturer(v), onChanged: (v) => requestsVM.updateItemManufacturer(v),
), ),

@ -18,19 +18,18 @@ class CardButtonWithIcon extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SizedBox( return SizedBox(
height: 110, // height: 150,
width: 110, width: 150,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
icon, icon,
// 16.height,
title.toText( title.toText(
fontSize: 11, fontSize: 11,
isBold: true, isBold: true,
textAlign: TextAlign.left, textAlign: TextAlign.left,
) ).paddingOnly(top: 10)
], ],
).toWhiteContainer(allPading: 12, width: double.infinity).onPress(onCardTapped), ).toWhiteContainer(allPading: 12, width: double.infinity).onPress(onCardTapped),
); );

@ -97,7 +97,7 @@ class _OtpDialogState extends State<OtpDialog> {
height: 1.2, height: 1.2,
), ),
), ),
Text(" " + LocaleKeys.sec.tr()), Text(" ${LocaleKeys.sec.tr()}"),
], ],
), ),
), ),

Loading…
Cancel
Save