issues fixed

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

@ -583,11 +583,11 @@
"addNewAppointment": "Add New Appointment",
"myNearbyBranches": "My Nearby Branches",
"myRecentBranches": "My Recent Branches",
"favoriteList": "Favourite List",
"favoriteList": "Favorite List",
"noReviewsBranch": "This branch has no reviews.",
"readLess": "Read Less",
"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.",
"totalBranches": "Total Branches",
"memberSince": "Member Since",
@ -681,7 +681,7 @@
"adsRemaining": "Ads Remaining",
"attachPDF": "Attach PDF",
"noItemsToShow": "No Items to show.",
"serviceItem" : "Service Item",
"createdBy" : "Created By",
"serviceItem": "Service Item",
"createdBy": "Created By",
"createGroupServices": "Create Group Services"
}

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

@ -1288,11 +1288,11 @@ static const Map<String,dynamic> en_US = {
"addNewAppointment": "Add New Appointment",
"myNearbyBranches": "My Nearby Branches",
"myRecentBranches": "My Recent Branches",
"favoriteList": "Favourite List",
"favoriteList": "Favorite List",
"noReviewsBranch": "This branch has no reviews.",
"readLess": "Read Less",
"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.",
"totalBranches": "Total Branches",
"memberSince": "Member Since",

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

@ -28,7 +28,13 @@ class Utils {
static bool get isLoading => _isLoadingVisible;
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 {
@ -71,7 +77,11 @@ class Utils {
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) {
@ -512,7 +522,7 @@ class Utils {
border: Border.all(
width: w, //
color: color // <--- border width here
),
),
borderRadius: BorderRadius.circular(radius),
);
}
@ -535,7 +545,7 @@ class Utils {
border: Border.all(
width: 1, //
color: color // <--- border width here
),
),
borderRadius: BorderRadius.circular(radius),
);
}
@ -553,7 +563,8 @@ class Utils {
}
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
@ -577,15 +588,27 @@ class Utils {
);
}
static Widget buildStatusContainer(String text) {
static Widget buildStatusContainer(String text, {double marginAll = 8, double fontSize = 14}) {
return Center(
child: text.toText(color: MyColors.lightTextColor, fontSize: 14),
child: text.toText(color: MyColors.lightTextColor, fontSize: fontSize),
).toContainer(
marginAll: 8,
marginAll: marginAll,
paddingAll: 15,
borderRadius: 8,
width: double.infinity,
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);
} else {
Utils.showToast(LocaleKeys.appointmentBookedSuccessfully.tr());
getMyAppointments();
getMyAppointmentsForCustomer();
navigateReplaceWithNameUntilRoute(context, AppRoutes.dashboard);
}
}
@ -181,9 +181,9 @@ class AppointmentsVM extends BaseVM {
context.read<DashboardVmCustomer>().onNavbarTapped(1);
applyFilterOnAppointmentsVM(appointmentStatusEnum: AppointmentStatusEnum.cancelled);
Utils.showToast(genericRespModel.message.toString());
await getMyAppointments();
await getMyAppointmentsForCustomer();
Utils.hideLoading(context);
getMyAppointments();
getMyAppointmentsForCustomer();
navigateReplaceWithNameUntilRoute(context, AppRoutes.dashboard);
}
} catch (e) {
@ -350,7 +350,7 @@ class AppointmentsVM extends BaseVM {
// notifyListeners();
// }
Future<void> getMyAppointments({bool isNeedToRebuild = false}) async {
Future<void> getMyAppointmentsForCustomer({bool isNeedToRebuild = false}) async {
if (isNeedToRebuild) setState(ViewState.busy);
myAppointments = await appointmentRepo.getMyAppointmentsForCustomersByFilters();
@ -383,7 +383,9 @@ class AppointmentsVM extends BaseVM {
setState(ViewState.busy);
myAppointments = await appointmentRepo.getMyAppointmentsForProvider(map);
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);
setState(ViewState.idle);
}
@ -802,7 +804,7 @@ class AppointmentsVM extends BaseVM {
context.read<DashboardVmCustomer>().onNavbarTapped(1);
applyFilterOnAppointmentsVM(appointmentStatusEnum: AppointmentStatusEnum.cancelled);
Utils.showToast(genericRespModel.message.toString());
getMyAppointments();
getMyAppointmentsForCustomer();
Utils.hideLoading(context);
navigateReplaceWithNameUntilRoute(context, AppRoutes.dashboard);
}
@ -1419,7 +1421,7 @@ class AppointmentsVM extends BaseVM {
appointmentFilterBranchSearchHistory.clear();
appointmentFiltersCounter = 0;
clearAppointmentFilterSelections();
getMyAppointments();
getMyAppointmentsForCustomer();
notifyListeners();
}

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

@ -626,7 +626,7 @@ class RequestsVM extends BaseVM {
bool isCountryFetching = false;
//Request Management
String price = "0.0";
String price = "1.0";
String description = "";
String address = "";
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!) {
categories.add(
CategoryData(

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

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

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

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

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

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

Loading…
Cancel
Save