Issues Fixed

aamir_dev
Faiz Hashmi 1 year ago
parent 8f43c4a391
commit dd94e3678d

@ -22,11 +22,12 @@ import 'package:mc_common_app/config/routes.dart';
import 'package:flutter/material.dart';
import 'package:mc_common_app/models/appointments_models/appointment_list_model.dart';
import 'package:mc_common_app/models/provider_branches_models/branch_detail_model.dart';
import 'package:mc_common_app/utils/enums.dart';
class ProviderAppRoutes {
static final Map<String, WidgetBuilder> routes = {
//Home page
AppRoutes.dashboard: (context) => const DashboardView(),
AppRoutes.dashboard: (context) => DashboardView(dashboardRouteEnum: ModalRoute.of(context)!.settings.arguments as DashboardRouteEnum),
// defineLicense: (context) => DefineLicensePage(),
AppRoutes.dealershipSetting: (context) => const DealershipView(),

@ -130,7 +130,7 @@ class _SchedulesListPageState extends State<SchedulesListPage> {
showItem("${LocaleKeys.shiftEndTime.tr()}:", scheduleVM.schedule!.data![index].endTime ?? ""),
showItem("${LocaleKeys.slotsTime.tr()}:", "${scheduleVM.schedule!.data![index].slotDurationMinute} Mins"),
showItem("${LocaleKeys.appointmentPerSlot.tr()}:", scheduleVM.schedule!.data![index].perSlotAppointment.toString()),
showItem(LocaleKeys.serviceLocation.tr(), scheduleVM.schedule!.data![index].appointmentType == 1 ? "Company Location" : "Home Location"),
showItem(LocaleKeys.serviceLocation.tr(), scheduleVM.schedule!.data![index].appointmentType == 1 ? LocaleKeys.companyLocation.tr() : LocaleKeys.customerLocation.tr()),
showItem("${LocaleKeys.offDays.tr()}:", offDays(scheduleVM.schedule!.data![index])),
12.height,
"${LocaleKeys.services.tr()}:".toText(fontSize: 12, color: MyColors.lightTextColor),

@ -1,6 +1,8 @@
import 'dart:async';
import 'dart:developer';
import 'package:car_provider_app/views/branch_management/branch/branch_list_page.dart';
import 'package:flutter/material.dart';
import 'package:mc_common_app/utils/enums.dart';
import 'package:mc_common_app/view_models/dashboard_view_model_provider.dart';
import 'package:mc_common_app/views/common_fragments/requests_fragment.dart';
import 'package:mc_common_app/widgets/common_widgets/bottom_nav_bar.dart';
@ -10,7 +12,9 @@ import 'fragments/home_fragment.dart';
import 'package:mc_common_app/views/common_fragments/ads_fragment.dart';
class DashboardView extends StatefulWidget {
const DashboardView({Key? key}) : super(key: key);
final DashboardRouteEnum dashboardRouteEnum;
const DashboardView({Key? key, required this.dashboardRouteEnum}) : super(key: key);
@override
State<DashboardView> createState() => _DashboardViewState();
@ -22,9 +26,10 @@ class _DashboardViewState extends State<DashboardView> {
@override
void initState() {
log("widget.dashboardRouteEnum: ${widget.dashboardRouteEnum}");
super.initState();
dashboardVMProvider = Provider.of<DashboardVMProvider>(context, listen: false);
scheduleMicrotask(() => dashboardVMProvider.onRefresh(context));
scheduleMicrotask(() => dashboardVMProvider.onRefresh(context, dashboardRouteEnum: widget.dashboardRouteEnum));
}
@override

@ -17,7 +17,6 @@ import 'package:mc_common_app/views/advertisement/components/ads_list_widget.dar
import 'package:mc_common_app/views/appointments/widgets/common_appointment_slider_widget.dart';
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
import 'package:mc_common_app/widgets/common_widgets/view_all_widget.dart';
import 'package:badges/badges.dart' as b;
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
import 'package:provider/provider.dart';
import 'package:easy_localization/easy_localization.dart';

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:developer';
import 'package:car_provider_app/views/subscriptions/sheet/upgrade_package_sheet.dart';
import 'package:car_provider_app/views/subscriptions/widget/my_subscriptions_card.dart';
import 'package:flutter/material.dart';
@ -60,7 +61,6 @@ class _MySubscriptionsPageState extends State<MySubscriptionsPage> {
backgroundColor: MyColors.darkIconColor,
isMainPage: model.mySubscriptionsBySp[index].isExpired ?? false,
onRenewSubscriptionClick: () async {
print(sub.toJson());
showMyBottomSheet(
context,
child: UpgradePackageSheet(

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:mc_common_app/classes/app_state.dart';
@ -58,7 +59,7 @@ class _UpgradePackageSheetState extends State<UpgradePackageSheet> {
padding: const EdgeInsets.only(left: 21, right: 21, bottom: 21, top: 4),
child: Consumer<SubscriptionsVM>(builder: (context, model, _) {
if (model.state == ViewState.busy) {
print(model.newPrice);
log(model.newPrice);
return SizedBox(
width: double.infinity,
height: MediaQuery.of(context).size.height / 2,
@ -79,7 +80,7 @@ class _UpgradePackageSheetState extends State<UpgradePackageSheet> {
12.height,
packageItem(
LocaleKeys.nowVar.tr(),
("${LocaleKeys.yourSubscriptionUpgradeAffectingFrom.tr()} ${DateHelper.formatAsLongDate(widget.subscription.dateEnd ?? DateTime.now())}"),
("${LocaleKeys.yourSubscriptionUpgradeAffectingFrom.tr()} ${widget.subscription.dateEnd == null ? DateHelper.formatAsDayMonthYear(DateTime.now()) : DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(widget.subscription.dateEnd!)))}"),
double.parse(model.newPrice).toStringAsFixed(2),
isNowSelected,
).onPress(() {
@ -92,7 +93,7 @@ class _UpgradePackageSheetState extends State<UpgradePackageSheet> {
if (AppState().getproviderSubscription.isNotEmpty && !AppState().getproviderSubscription.first.isExpired!)
packageItem(
LocaleKeys.upgradeAfterCurrentExpiry.tr(),
("${LocaleKeys.yourSubscriptionUpgradeCurrentSubscriptionAffectingFrom.tr()} ${DateHelper.formatAsLongDate(widget.subscription.dateEnd ?? DateTime.now())}"),
("${LocaleKeys.yourSubscriptionUpgradeCurrentSubscriptionAffectingFrom.tr()} ${AppState().getproviderSubscription.first.dateEnd == null ? "" : AppState().getproviderSubscription.first.dateEnd == null ? DateHelper.formatAsDayMonthYear(DateTime.now()) : DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(AppState().getproviderSubscription.first.dateEnd!)))}"),
widget.subscription.price.toString(),
isNowSelected ? false : true,
).onPress(() {
@ -174,11 +175,11 @@ class _UpgradePackageSheetState extends State<UpgradePackageSheet> {
fontWeight: FontWeight.bold,
),
4.height,
if (widget.subscription.dateEnd != null)
description.toText(
fontSize: 12,
color: MyColors.lightTextColor,
),
// if (widget.subscription.dateEnd != null)
description.toText(
fontSize: 12,
color: MyColors.lightTextColor,
),
10.height,
Row(
crossAxisAlignment: CrossAxisAlignment.end,

@ -101,7 +101,7 @@ class MySubscriptionsCard extends StatelessWidget {
),
Row(
children: [
"${pvm.isExpired! ? "Expired" : "Expires"} on ${DateHelper.formatAsDayMonthYear(pvm.dateEnd)}".toText(fontSize: 14, letterSpacing: -0.56, color: textColor, fontWeight: MyFonts.Medium),
"${pvm.isExpired! ? "Expired" : "Expires"} on ${DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(pvm.dateEnd ?? "")))}".toText(fontSize: 14, letterSpacing: -0.56, color: textColor, fontWeight: MyFonts.Medium),
if (pvm.isRenewable!)
Row(
children: [

Loading…
Cancel
Save