|
|
|
@ -2,6 +2,7 @@ import 'dart:async';
|
|
|
|
|
|
|
|
|
|
import 'package:mc_common_app/generated/locale_keys.g.dart';
|
|
|
|
|
import 'package:mc_common_app/models/services_models/item_model.dart';
|
|
|
|
|
import 'package:mc_common_app/utils/date_helper.dart';
|
|
|
|
|
import 'package:mc_common_app/utils/enums.dart';
|
|
|
|
|
import 'package:mc_common_app/view_models/appointments_view_model.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
@ -14,9 +15,9 @@ import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
|
|
|
|
|
|
class ItemsListSheet extends StatefulWidget {
|
|
|
|
|
final int serviceId;
|
|
|
|
|
final int serviceProviderServiceId;
|
|
|
|
|
|
|
|
|
|
ItemsListSheet(this.serviceId);
|
|
|
|
|
ItemsListSheet(this.serviceProviderServiceId);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
State<ItemsListSheet> createState() => _ItemsListSheetState();
|
|
|
|
@ -26,7 +27,7 @@ class _ItemsListSheetState extends State<ItemsListSheet> {
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
scheduleMicrotask(() {
|
|
|
|
|
context.read<AppointmentsVM>().getServiceItems(widget.serviceId);
|
|
|
|
|
context.read<AppointmentsVM>().getServiceItems(widget.serviceProviderServiceId);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -57,7 +58,11 @@ class _ItemsListSheetState extends State<ItemsListSheet> {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
serviceItemModel.name.toString().toText(fontSize: 16, isBold: true),
|
|
|
|
|
4.height,
|
|
|
|
|
serviceItemModel.description.toString().toText(fontSize: 12, color: MyColors.lightTextColor),
|
|
|
|
|
8.height,
|
|
|
|
|
if (serviceItemModel.manufactureDate != null && serviceItemModel.manufactureDate!.isNotEmpty) ...[
|
|
|
|
|
showItem(LocaleKeys.manufacturedOn.tr() + ":", (DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(serviceItemModel.manufactureDate!))), valueColor: MyColors.darkTextColor),
|
|
|
|
|
],
|
|
|
|
|
showItem(LocaleKeys.availableforAppointment.tr() + ":", (serviceItemModel.isAllowAppointment ?? false) ? "Yes" : "No", valueColor: Colors.green),
|
|
|
|
|
showItem(LocaleKeys.allowingWorkshopService.tr() + ":", (serviceItemModel.isAppointmentCompanyLoc ?? false) ? "Yes" : "No", valueColor: Colors.green),
|
|
|
|
|
showItem(LocaleKeys.allowingHomeService.tr() + ":", (serviceItemModel.isAppointmentCustomerLoc ?? false) ? "Yes" : "No", valueColor: Colors.green),
|
|
|
|
@ -104,7 +109,7 @@ class _ItemsListSheetState extends State<ItemsListSheet> {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
item.toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
|
|
|
|
|
item.toText(fontSize: 12, color: MyColors.lightTextColor),
|
|
|
|
|
4.width,
|
|
|
|
|
value.toText(fontSize: 12, color: valueColor, isBold: true),
|
|
|
|
|
],
|
|
|
|
|