Fixed the notes list

aamir_dev
Faiz Hashmi 1 year ago
parent 4fb6ee7fb5
commit bc46ee5784

@ -2,7 +2,6 @@ import 'dart:io';
import 'package:car_provider_app/config/provider_routes.dart';
import 'package:car_provider_app/views/settings/branch/dealer/widget/add_phone_num_wiget.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:http/http.dart' as http;
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart';
import 'package:mc_common_app/classes/app_state.dart';
@ -89,18 +88,17 @@ class DashboardVM extends BaseVM {
final serviceVM = context.read<ServiceVM>();
final adVm = context.read<AdVM>();
final subscriptionsVM = context.read<SubscriptionsVM>();
requestsVM.populateRequestsFilterList();
requestsVM.populateDataForRequestsFilter();
appointmentVM.populateAppointmentsFilterList();
await serviceVM.getBranchAndServices();
await appointmentVM.getMyAppointmentsForProvider({"ServiceProviderID": injector.get<AppState>().getUser.data?.userInfo?.providerId.toString() ?? "0"});
adVm.populateAdsFilterList();
await chatVM.buildHubConnection(context);
await adVm.getMyAds();
await adVm.getExploreAds();
await adVm.getVehicleTypes();
await adVm.getVehicleAdsDuration();
await requestsVM.getRequests(appType: AppType.provider);
await requestsVM.getRequests();
// await subscriptionsVM.getMySubscriptionsBySP(AppState().getUser.data?.userInfo?.providerId.toString() ?? "");
await subscriptionsVM.getSubscriptionBySP(AppState().getUser.data?.userInfo?.providerId.toString() ?? "", true);
// await subscriptionsVM.getMySubscriptionsBySP(AppState().getUser.data?.userInfo?.providerId.toString() ?? "");

@ -1,5 +1,6 @@
import 'package:car_provider_app/config/provider_routes.dart';
import 'package:car_provider_app/views/appoinments/widget/sheets.dart';
import 'package:car_provider_app/views/dashboard/widget/general_appointment_widget.dart';
import 'package:flutter/material.dart';
import 'package:mc_common_app/classes/app_state.dart';
import 'package:mc_common_app/config/dependency_injection.dart';
@ -17,7 +18,6 @@ import 'package:mc_common_app/widgets/button/show_fill_button.dart';
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
import 'package:provider/provider.dart';
import '../dashboard/widget/general_appointment_widget.dart';
import 'package:easy_localization/easy_localization.dart';
class UpdateAppointmentPage extends StatelessWidget {
@ -28,9 +28,7 @@ class UpdateAppointmentPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: CustomAppBar(
title: LocaleKeys.updateAppointment.tr(),
),
appBar: CustomAppBar(title: LocaleKeys.updateAppointment.tr()),
body: SizedBox(
width: double.infinity,
height: double.infinity,
@ -53,18 +51,20 @@ class UpdateAppointmentPage extends StatelessWidget {
onTap: () {},
),
21.height,
ShowFillButton(
title: ("+ " + LocaleKeys.addNewService.tr()),
txtColor: MyColors.darkPrimaryColor,
isFilled: false,
onPressed: () {
navigateWithName(
context,
ProviderAppRoutes.addServiceInAppointment,
arguments: appointmentListModel,
);
},
),
if (appointmentListModel.appointmentStatusEnum != AppointmentStatusEnum.confirmed) ...[
ShowFillButton(
title: ("+ ${LocaleKeys.addNewService.tr()}"),
txtColor: MyColors.darkPrimaryColor,
isFilled: false,
onPressed: () {
navigateWithName(
context,
ProviderAppRoutes.addServiceInAppointment,
arguments: appointmentListModel,
);
},
),
]
],
),
),
@ -78,14 +78,16 @@ class UpdateAppointmentPage extends StatelessWidget {
],
).paddingAll(21),
if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.confirmed && appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.defaultStatus)
if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.confirmed &&
(appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.payPartial || appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.defaultStatus))
Column(
children: [
showArrivedutton(context, appointmentsVM),
showArrivedButton(context, appointmentsVM),
],
).paddingAll(21),
if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.arrived && appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.defaultStatus)
if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.arrived &&
(appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.payPartial || appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.defaultStatus))
Column(
children: [
showPayNowButton(context, appointmentsVM),
@ -99,8 +101,7 @@ class UpdateAppointmentPage extends StatelessWidget {
LocaleKeys.waitingPaymentfromtheCustomer.tr().toText().paddingAll(21),
if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.arrived &&
(appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.paid ||
appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.payLater))
(appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.paid || appointmentListModel.appointmentPaymentStatusEnum == AppointmentPaymentStatusEnum.payLater))
Column(
children: [
showWorkStartButton(context, appointmentsVM),
@ -202,7 +203,7 @@ class UpdateAppointmentPage extends StatelessWidget {
);
}
Widget showArrivedutton(BuildContext context, AppointmentsVM appointmentsVM) {
Widget showArrivedButton(BuildContext context, AppointmentsVM appointmentsVM) {
return ShowFillButton(
title: LocaleKeys.arrived.tr(),
maxWidth: double.infinity,

@ -63,17 +63,18 @@ class HomeFragment extends StatelessWidget {
children: [
10.height,
ViewAllWidget(
title: LocaleKeys.upcoming_appointment.tr(),
subTitle: LocaleKeys.view_all.tr(),
onSubtitleTapped: () {
context.read<DashboardVM>().onNavbarTapped(1);
}).horPaddingMain(),
title: LocaleKeys.upcoming_appointment.tr(),
subTitle: LocaleKeys.view_all.tr(),
onSubtitleTapped: () {
context.read<DashboardVM>().onNavbarTapped(1);
},
).horPaddingMain(),
// const AppointmentSliderWidget().horPaddingMain(),
CommonAppointmentSliderWidget(
onAppointmentClick: (AppointmentListModel value) {
navigateWithName(context, ProviderAppRoutes.appointmentDetailList, arguments: value);
},
).toWhiteContainer(width: double.infinity,backgroundColor: Colors.transparent).margin(left: 21,right: 21),
).toWhiteContainer(width: double.infinity, backgroundColor: Colors.transparent).margin(left: 21, right: 21),
24.height,
ViewAllWidget(
title: LocaleKeys.myBranches.tr(),
@ -84,11 +85,16 @@ class HomeFragment extends StatelessWidget {
).horPaddingMain(),
const ServiceProviderWidget().horPaddingMain(),
],
).toWhiteContainer(width: double.infinity,),
).toWhiteContainer(
width: double.infinity,
),
Consumer(
builder: (BuildContext context, AdVM adVM, Widget? child) {
if (adVM.state == ViewState.busy) {
return const Center(child: CircularProgressIndicator());
return const Padding(
padding: EdgeInsets.all(30),
child: Center(child: CircularProgressIndicator()),
);
} else {
return Column(
children: [
@ -100,8 +106,9 @@ class HomeFragment extends StatelessWidget {
title: LocaleKeys.my_active_Ads.tr().toUpperCase(),
subTitle: LocaleKeys.view_all.tr(),
onSubtitleTapped: () {
// context.read<DashboardVM>().onNavbarTapped(3);
// context.read<AdVM>().updateIsExploreAds(false);
context.read<DashboardVM>().onNavbarTapped(3);
context.read<AdVM>().updateIsExploreAds(true);
context.read<AdVM>().applyFilterOnExploreAds(createdByRoleFilter: CreatedByRoleEnum.allAds);
},
).horPaddingMain(),
AdsListWidget(

@ -23,20 +23,20 @@ class ServiceProviderWidget extends StatelessWidget {
width: double.infinity,
height: 140,
child: Consumer(
builder: (BuildContext context, ServiceVM model, Widget? child) {
if (model.state == ViewState.busy) {
builder: (BuildContext context, ServiceVM serviceVM, Widget? child) {
if (serviceVM.state == ViewState.busy) {
return const Center(child: CircularProgressIndicator());
} else {
return model.branches == null || model.branches!.data == null
return serviceVM.branches == null || serviceVM.branches!.data == null
? Center(child: Text(LocaleKeys.noBranchFound.tr()))
: model.branches!.data!.serviceProviderBranch != null && model.branches!.data!.serviceProviderBranch!.isEmpty
: serviceVM.homePageBranches.isEmpty
? Center(child: Text(LocaleKeys.no_branch.tr()))
: ListView.builder(
itemCount: model.branches!.data!.serviceProviderBranch!.length,
itemCount: serviceVM.homePageBranches.length,
scrollDirection: Axis.horizontal,
shrinkWrap: true,
itemBuilder: (BuildContext context, int index) {
BranchDetailModel branchDetailModel = model.branches!.data!.serviceProviderBranch![index];
BranchDetailModel branchDetailModel = serviceVM.homePageBranches[index];
return SizedBox(
width: 90,
child: Column(
@ -50,9 +50,9 @@ class ServiceProviderWidget extends StatelessWidget {
),
).onPress(
() {
model.branches!.data!.serviceProviderBranch![index].countryID = model.branches!.data!.countryID;
model.branches!.data!.serviceProviderBranch![index].countryName = model.branches!.data!.countryName;
navigateWithName(context, ProviderAppRoutes.branchDetail, arguments: model.branches!.data!.serviceProviderBranch![index]);
serviceVM.homePageBranches[index].countryID = serviceVM.branches!.data!.countryID;
serviceVM.homePageBranches[index].countryName = serviceVM.branches!.data!.countryName;
navigateWithName(context, ProviderAppRoutes.branchDetail, arguments: serviceVM.homePageBranches[index]);
},
);
},

@ -78,7 +78,7 @@ class BranchDetailPage extends StatelessWidget {
fontSize: 12,
color: MyColors.darkTextColor,
),
8.width,
if (title.isNotEmpty) 8.width,
Flexible(
child: value.toText(
fontSize: 12,
@ -252,8 +252,7 @@ class BranchDetailPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
children: [
(branchData.branchName!).toText(fontSize: 16, color: MyColors.darkTextColor),
showData("${LocaleKeys.city.tr()}:", branchData.cityName.toString()),
showData("${LocaleKeys.country.tr()}:", branchData.countryName.toString()),
showData("", branchData.branchDescription.toString()),
],
),
),
@ -261,22 +260,16 @@ class BranchDetailPage extends StatelessWidget {
),
),
if (branchData.branchStatus != BranchStatusEnum.pending) ...[
IconButton(
onPressed: () {
navigateWithName(context, ProviderAppRoutes.defineBranch, arguments: branchData);
},
icon: SvgPicture.asset(MyAssets.icEdit),
)
SvgPicture.asset(MyAssets.icEdit).onPress(() {
navigateWithName(context, ProviderAppRoutes.defineBranch, arguments: branchData);
}),
],
],
),
Column(
children: [
// showData("${LocaleKeys.country.tr()}:", branchData.countryName.toString()),
// showData("${LocaleKeys.city.tr()}:", branchData.cityName.toString()),
showData("${LocaleKeys.branchName.tr()}:", branchData.branchName.toString()),
showData("${LocaleKeys.branchDescription.tr()}:", branchData.branchDescription.toString()),
// showData("${LocaleKeys.branchDescription.tr()}:", branchData.branchDescription.toString()),
showData("${LocaleKeys.location.tr()}:", "${branchData.cityName.toString()}, ${branchData.countryName.toString()}"),
showData("${LocaleKeys.provider.tr()}:", branchData.serviceProviderName.toString()),
showData("${LocaleKeys.time.tr()}:", "${branchData.openTime.toString()} - ${branchData.closeTime.toString()}"),
showData("${LocaleKeys.address.tr()}:", branchData.address.toString()),
],

@ -22,7 +22,6 @@ import 'package:provider/provider.dart';
import 'package:mc_common_app/widgets/bottom_sheet.dart';
import 'package:easy_localization/easy_localization.dart';
class AddSchedulesPage extends StatefulWidget {
const AddSchedulesPage({Key? key}) : super(key: key);
@ -309,7 +308,7 @@ class _AddSchedulesPageState extends State<AddSchedulesPage> {
"fromDate": startDate,
"toDate": endDate,
"startTime": startTime,
"endTime": endDate,
"endTime": endTime,
"slotDurationMinute": slotsTime,
"perSlotAppointment": appointmentPerSlot,
"deliveryServiceType": 1,
@ -319,16 +318,16 @@ class _AddSchedulesPageState extends State<AddSchedulesPage> {
Utils.showLoading(context);
GenericRespModel scheduleResponse = await model.createSchedule(map);
if (scheduleResponse.messageStatus == 1) {
List<int> services = [];
for (var element in model.selectedServicesItems) {
services.add(element.id);
}
var map1 = {
// "id": 0,
"branchAppointmentScheduleID": scheduleResponse.data,
"serviceProviderServiceID": services,
"serviceGroupDescription": "string"
"serviceGroupDescription": "string",
};
GenericRespModel servicesResponse = await model.addServicesInSchedule(map1);
@ -349,13 +348,10 @@ class _AddSchedulesPageState extends State<AddSchedulesPage> {
}
updateSchedule(BuildContext context, ScheduleVM model) async {
logger.d(scheduleData);
print("-----------");
List<int> days = [];
for (var element in model.selectedDaysItems) {
days.add(element.id);
}
var map = {
"id": scheduleData.id,
"scheduleName": name,
@ -363,7 +359,7 @@ class _AddSchedulesPageState extends State<AddSchedulesPage> {
"fromDate": startDate,
"toDate": endDate,
"startTime": startTime,
"endTime": endDate,
"endTime": endTime,
"slotDurationMinute": slotsTime,
"perSlotAppointment": appointmentPerSlot,
"deliveryServiceType": 1,
@ -379,7 +375,6 @@ class _AddSchedulesPageState extends State<AddSchedulesPage> {
services.add(element.id);
}
var map1 = {
// "id": scheduleData,
"branchAppointmentScheduleID": scheduleData.id,
"serviceProviderServiceID": services,
"serviceGroupDescription": "string",
@ -388,15 +383,15 @@ class _AddSchedulesPageState extends State<AddSchedulesPage> {
GenericRespModel servicesResponse = await model.updateServicesInSchedule(map1);
Utils.hideLoading(context);
if (servicesResponse.messageStatus == 1) {
Utils.showToast("Successfully schedule updated");
Utils.showToast(servicesResponse.message ?? "Schedule Successfully Updated");
context.read<ScheduleVM>().getSchedules(scheduleData.branchId ?? "");
pop(context);
} else {
Utils.showToast("Something went wrong while adding services in schedule");
Utils.showToast(servicesResponse.message ?? LocaleKeys.somethingWrong.tr());
}
} else {
Utils.hideLoading(context);
Utils.showToast("Something went wrong");
Utils.showToast(scheduleResponse.message ?? LocaleKeys.somethingWrong.tr());
}
}
}

@ -100,8 +100,8 @@ class _SchedulesListPageState extends State<SchedulesListPage> {
showItem("End Date:", DateHelper.formatAsDayMonthYear(value.schedule!.data![index].toDate)),
showItem("Off Days:", DateHelper.formatAsDayMonthYear(value.schedule!.data![index].fromDate)),
showItem("Shift Start Time:", value.schedule!.data![index].startTime ?? ""),
showItem("Shift End Time:", value.schedule!.data![index].startTime ?? ""),
showItem("Slots Time:", value.schedule!.data![index].slotDurationMinute.toString() + " Mins"),
showItem("Shift End Time:", value.schedule!.data![index].endTime ?? ""),
showItem("Slots Time:", "${value.schedule!.data![index].slotDurationMinute} Mins"),
showItem("Appointments Per Slot:", value.schedule!.data![index].perSlotAppointment.toString()),
showItem("Off Days", offDays(value.schedule!.data![index])),
12.height,

@ -11,9 +11,9 @@ import 'package:provider/provider.dart';
import 'package:easy_localization/easy_localization.dart';
class SelectDaysSheet extends StatefulWidget {
Function(List<PickerItem>) onSelected;
final Function(List<PickerItem>) onSelected;
SelectDaysSheet({Key? key, required this.onSelected}) : super(key: key);
const SelectDaysSheet({Key? key, required this.onSelected}) : super(key: key);
@override
State<SelectDaysSheet> createState() => _SelectDaysSheetState();

@ -1,6 +1,7 @@
import 'dart:async';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/models/general_models/generic_resp_model.dart';
import 'package:mc_common_app/utils/navigator.dart';
import 'package:mc_common_app/view_models/service_view_model.dart';
import 'package:car_provider_app/views/settings/services/services_list_page.dart';
import 'package:flutter/material.dart';
@ -269,17 +270,12 @@ class _CreateServicesPage3State extends State<CreateServicesPage3> {
model.getBranchAndServices();
Utils.hideLoading(context);
Utils.showToast(mResponse.message ?? "");
pop(context);
}
updateService(BuildContext context, ServiceVM model) async {
List<Map<String, dynamic>> map = [
{
"id": widget.branchModel!.serviceProviderService!.serviceId.toString(),
"isAllowAppointment": isAppointmentAvailable,
"isActive": true,
"customerLocationRange": serviceRage,
"rangePricePerKm": chargersPerKm
}
{"id": widget.branchModel!.serviceProviderService!.serviceId.toString(), "isAllowAppointment": isAppointmentAvailable, "isActive": true, "customerLocationRange": serviceRage, "rangePricePerKm": chargersPerKm}
];
// print(map);
@ -288,5 +284,7 @@ class _CreateServicesPage3State extends State<CreateServicesPage3> {
model.getBranchAndServices();
Utils.hideLoading(context);
Utils.showToast(mResponse.message ?? "");
pop(context);
}
}

Loading…
Cancel
Save