Merge branch 'faiz_development_common' into master_new_changes
# Conflicts: # lib/models/subscriptions_models/subscription_model.dartmaster_new_changes
commit
5267d4292a
@ -1,170 +1,170 @@
|
|||||||
import 'package:flutter/material.dart';
|
// import 'package:flutter/material.dart';
|
||||||
import 'package:mc_common_app/classes/consts.dart';
|
// import 'package:mc_common_app/classes/consts.dart';
|
||||||
import 'package:mc_common_app/extensions/int_extensions.dart';
|
// import 'package:mc_common_app/extensions/int_extensions.dart';
|
||||||
import 'package:mc_common_app/extensions/string_extensions.dart';
|
// import 'package:mc_common_app/extensions/string_extensions.dart';
|
||||||
import 'package:mc_common_app/generated/locale_keys.g.dart';
|
// import 'package:mc_common_app/generated/locale_keys.g.dart';
|
||||||
import 'package:mc_common_app/theme/colors.dart';
|
// import 'package:mc_common_app/theme/colors.dart';
|
||||||
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
|
// 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/common_widgets/app_bar.dart';
|
||||||
import 'package:mc_common_app/widgets/common_widgets/branch_details_card.dart';
|
// import 'package:mc_common_app/widgets/common_widgets/branch_details_card.dart';
|
||||||
import 'package:mc_common_app/widgets/common_widgets/time_slots.dart';
|
// import 'package:mc_common_app/widgets/common_widgets/time_slots.dart';
|
||||||
import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart';
|
// import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart';
|
||||||
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
// import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
// import 'package:easy_localization/easy_localization.dart';
|
||||||
|
//
|
||||||
class BookProviderAppView extends StatefulWidget {
|
// class BookProviderAppView extends StatefulWidget {
|
||||||
const BookProviderAppView({Key? key}) : super(key: key);
|
// const BookProviderAppView({Key? key}) : super(key: key);
|
||||||
|
//
|
||||||
@override
|
// @override
|
||||||
State<BookProviderAppView> createState() => _BookProviderAppViewState();
|
// State<BookProviderAppView> createState() => _BookProviderAppViewState();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
class _BookProviderAppViewState extends State<BookProviderAppView> {
|
// class _BookProviderAppViewState extends State<BookProviderAppView> {
|
||||||
bool isReview = false;
|
// bool isReview = false;
|
||||||
|
//
|
||||||
@override
|
// @override
|
||||||
Widget build(BuildContext context) {
|
// Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
// return Scaffold(
|
||||||
appBar: CustomAppBar(
|
// appBar: CustomAppBar(
|
||||||
title: LocaleKeys.appointment.tr(),
|
// title: LocaleKeys.appointment.tr(),
|
||||||
profileImageUrl: MyAssets.bnCar,
|
// profileImageUrl: MyAssets.bnCar,
|
||||||
isRemoveBackButton: false,
|
// isRemoveBackButton: false,
|
||||||
isDrawerEnabled: false,
|
// isDrawerEnabled: false,
|
||||||
),
|
// ),
|
||||||
body: Container(
|
// body: Container(
|
||||||
color: MyColors.backgroundColor,
|
// color: MyColors.backgroundColor,
|
||||||
width: double.infinity,
|
// width: double.infinity,
|
||||||
height: double.infinity,
|
// height: double.infinity,
|
||||||
child: Column(
|
// child: Column(
|
||||||
children: [
|
// children: [
|
||||||
Expanded(
|
// Expanded(
|
||||||
child: ListView(
|
// child: ListView(
|
||||||
children: [
|
// children: [
|
||||||
BranchDetailCard(
|
// BranchDetailCard(
|
||||||
onCardTapped: () {},
|
// onCardTapped: () {},
|
||||||
providerImageUrl: MyAssets.bnCar,
|
// providerImageUrl: MyAssets.bnCar,
|
||||||
providerLocation: "3km",
|
// providerLocation: "3km",
|
||||||
title: "Al Ahmed Maintenance",
|
// title: "Al Ahmed Maintenance",
|
||||||
providerRatings: 4.9,
|
// providerRatings: 4.9,
|
||||||
),
|
// ),
|
||||||
12.height,
|
// 12.height,
|
||||||
isReview ? const ReviewAppointmentSection() : const ServicesSelectionSection(),
|
// isReview ? const ReviewAppointmentSection() : const ServicesSelectionSection(),
|
||||||
10.height,
|
// 10.height,
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
10.height,
|
// 10.height,
|
||||||
Padding(
|
// Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 10, left: 21, right: 21),
|
// padding: const EdgeInsets.only(bottom: 10, left: 21, right: 21),
|
||||||
child: ShowFillButton(
|
// child: ShowFillButton(
|
||||||
title: LocaleKeys.bookAppointment.tr(),
|
// title: LocaleKeys.bookAppointment.tr(),
|
||||||
maxWidth: double.infinity,
|
// maxWidth: double.infinity,
|
||||||
onPressed: () {
|
// onPressed: () {
|
||||||
isReview = !isReview;
|
// isReview = !isReview;
|
||||||
setState(() {});
|
// setState(() {});
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
class ServicesSelectionSection extends StatelessWidget {
|
// class ServicesSelectionSection extends StatelessWidget {
|
||||||
const ServicesSelectionSection({Key? key}) : super(key: key);
|
// const ServicesSelectionSection({Key? key}) : super(key: key);
|
||||||
|
//
|
||||||
@override
|
// @override
|
||||||
Widget build(BuildContext context) {
|
// Widget build(BuildContext context) {
|
||||||
List<DropValue> dropList = [
|
// List<DropValue> dropList = [
|
||||||
DropValue(0, "Maintenance", ""),
|
// DropValue(0, "Maintenance", ""),
|
||||||
DropValue(1, "Car Wash", ""),
|
// DropValue(1, "Car Wash", ""),
|
||||||
DropValue(2, "Monthly Checkup", ""),
|
// DropValue(2, "Monthly Checkup", ""),
|
||||||
DropValue(3, "Friendly Visit", ""),
|
// DropValue(3, "Friendly Visit", ""),
|
||||||
DropValue(4, "Muftaa", ""),
|
// DropValue(4, "Muftaa", ""),
|
||||||
];
|
// ];
|
||||||
return Container(
|
// return Container(
|
||||||
padding: const EdgeInsets.only(bottom: 10, left: 21, right: 21),
|
// padding: const EdgeInsets.only(bottom: 10, left: 21, right: 21),
|
||||||
child: Column(
|
// child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
// children: [
|
||||||
LocaleKeys.selectServicesYouWant.tr().toText(fontSize: 18, isBold: true),
|
// LocaleKeys.selectServicesYouWant.tr().toText(fontSize: 18, isBold: true),
|
||||||
8.height,
|
// 8.height,
|
||||||
DropdownField(
|
// DropdownField(
|
||||||
(DropValue value) {},
|
// (DropValue value) {},
|
||||||
list: dropList,
|
// list: dropList,
|
||||||
hint: LocaleKeys.selectServiceType.tr(),
|
// hint: LocaleKeys.selectServiceType.tr(),
|
||||||
),
|
// ),
|
||||||
8.height,
|
// 8.height,
|
||||||
DropdownField(
|
// DropdownField(
|
||||||
(DropValue value) {},
|
// (DropValue value) {},
|
||||||
list: dropList,
|
// list: dropList,
|
||||||
hint: LocaleKeys.selectServiceType.tr(),
|
// hint: LocaleKeys.selectServiceType.tr(),
|
||||||
),
|
// ),
|
||||||
8.height,
|
// 8.height,
|
||||||
DropdownField(
|
// DropdownField(
|
||||||
(DropValue value) {},
|
// (DropValue value) {},
|
||||||
list: dropList,
|
// list: dropList,
|
||||||
hint: LocaleKeys.selectServiceType.tr(),
|
// hint: LocaleKeys.selectServiceType.tr(),
|
||||||
),
|
// ),
|
||||||
22.height,
|
// 22.height,
|
||||||
LocaleKeys.selectDateAndTime.tr().toText(fontSize: 18, isBold: true),
|
// LocaleKeys.selectDateAndTime.tr().toText(fontSize: 18, isBold: true),
|
||||||
8.height,
|
// 8.height,
|
||||||
DropdownField(
|
// DropdownField(
|
||||||
(DropValue value) {},
|
// (DropValue value) {},
|
||||||
list: dropList,
|
// list: dropList,
|
||||||
hint: LocaleKeys.selectServiceType.tr(),
|
// hint: LocaleKeys.selectServiceType.tr(),
|
||||||
),
|
// ),
|
||||||
22.height,
|
// 22.height,
|
||||||
LocaleKeys.availableSlots.tr().toText(fontSize: 15, isBold: true),
|
// LocaleKeys.availableSlots.tr().toText(fontSize: 15, isBold: true),
|
||||||
8.height,
|
// 8.height,
|
||||||
BuildTimeSlots(onPressed: (index) {}, timeSlots: []),
|
// BuildTimeSlots(onPressed: (index) {}, timeSlots: []),
|
||||||
22.height,
|
// 22.height,
|
||||||
LocaleKeys.totalAmount.tr().toText(fontSize: 18, isBold: true),
|
// LocaleKeys.totalAmount.tr().toText(fontSize: 18, isBold: true),
|
||||||
Row(
|
// Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
children: [
|
// children: [
|
||||||
"3000".toText(fontSize: 20, isBold: true),
|
// "3000".toText(fontSize: 20, isBold: true),
|
||||||
LocaleKeys.sar.tr().toText(fontSize: 10, isBold: true, color: MyColors.lightTextColor),
|
// LocaleKeys.sar.tr().toText(fontSize: 10, isBold: true, color: MyColors.lightTextColor),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
10.height,
|
// 10.height,
|
||||||
],
|
// ],
|
||||||
).toWhiteContainer(width: double.infinity, allPading: 12),
|
// ).toWhiteContainer(width: double.infinity, allPading: 12),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
class ReviewAppointmentSection extends StatelessWidget {
|
// class ReviewAppointmentSection extends StatelessWidget {
|
||||||
const ReviewAppointmentSection({Key? key}) : super(key: key);
|
// const ReviewAppointmentSection({Key? key}) : super(key: key);
|
||||||
|
//
|
||||||
@override
|
// @override
|
||||||
Widget build(BuildContext context) {
|
// Widget build(BuildContext context) {
|
||||||
return Container(
|
// return Container(
|
||||||
padding: const EdgeInsets.only(bottom: 10, left: 21, right: 21),
|
// padding: const EdgeInsets.only(bottom: 10, left: 21, right: 21),
|
||||||
child: Column(
|
// child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
// children: [
|
||||||
LocaleKeys.reviewAppointment.tr().toText(fontSize: 18, isBold: true),
|
// LocaleKeys.reviewAppointment.tr().toText(fontSize: 18, isBold: true),
|
||||||
15.height,
|
// 15.height,
|
||||||
LocaleKeys.services.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
// LocaleKeys.services.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
||||||
LocaleKeys.carEngineCheck.tr().toText(fontSize: 18, isBold: true),
|
// LocaleKeys.carEngineCheck.tr().toText(fontSize: 18, isBold: true),
|
||||||
13.height,
|
// 13.height,
|
||||||
LocaleKeys.dateAndTime.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
// LocaleKeys.dateAndTime.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
||||||
"2 Feb, 2023 at 09:00am".toText(fontSize: 18, isBold: true),
|
// "2 Feb, 2023 at 09:00am".toText(fontSize: 18, isBold: true),
|
||||||
13.height,
|
// 13.height,
|
||||||
LocaleKeys.totalAmount.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
// LocaleKeys.totalAmount.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
|
||||||
Row(
|
// Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
children: [
|
// children: [
|
||||||
"3000".toText(fontSize: 20, isBold: true),
|
// "3000".toText(fontSize: 20, isBold: true),
|
||||||
LocaleKeys.sar.tr().toText(fontSize: 10, isBold: true, color: MyColors.lightTextColor),
|
// LocaleKeys.sar.tr().toText(fontSize: 10, isBold: true, color: MyColors.lightTextColor),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
100.height,
|
// 100.height,
|
||||||
],
|
// ],
|
||||||
).toWhiteContainer(width: double.infinity, allPading: 12),
|
// ).toWhiteContainer(width: double.infinity, allPading: 12),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|||||||
@ -0,0 +1,127 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mc_common_app/config/routes.dart';
|
||||||
|
import 'package:mc_common_app/extensions/int_extensions.dart';
|
||||||
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
||||||
|
import 'package:mc_common_app/generated/locale_keys.g.dart';
|
||||||
|
import 'package:mc_common_app/models/chat_models/chat_message_model.dart';
|
||||||
|
import 'package:mc_common_app/models/setting_utils_models/app_info_model.dart';
|
||||||
|
import 'package:mc_common_app/theme/colors.dart';
|
||||||
|
import 'package:mc_common_app/utils/enums.dart';
|
||||||
|
import 'package:mc_common_app/utils/navigator.dart';
|
||||||
|
import 'package:mc_common_app/view_models/setting_options_view_model.dart';
|
||||||
|
import 'package:mc_common_app/views/advertisement/components/picked_images_container_widget.dart';
|
||||||
|
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
|
||||||
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class SettingOptionsTermsAndConditions extends StatefulWidget {
|
||||||
|
const SettingOptionsTermsAndConditions({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<SettingOptionsTermsAndConditions> createState() => _SettingOptionsTermsAndConditionsState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SettingOptionsTermsAndConditionsState extends State<SettingOptionsTermsAndConditions> {
|
||||||
|
late SettingOptionsVM settingsOptionsVM;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
settingsOptionsVM = context.read<SettingOptionsVM>();
|
||||||
|
scheduleMicrotask(() async {
|
||||||
|
await settingsOptionsVM.getTermsAndConditions();
|
||||||
|
});
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget showData(String title, String value) {
|
||||||
|
return Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
title.toText(
|
||||||
|
fontSize: 13,
|
||||||
|
color: MyColors.darkTextColor,
|
||||||
|
),
|
||||||
|
if (title.isNotEmpty) 5.width,
|
||||||
|
Flexible(
|
||||||
|
child: value.toText(
|
||||||
|
fontSize: 13,
|
||||||
|
color: MyColors.lightTextColor,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: CustomAppBar(
|
||||||
|
title: LocaleKeys.termPrivacy.tr(),
|
||||||
|
isRemoveBackButton: false,
|
||||||
|
isDrawerEnabled: false,
|
||||||
|
onBackButtonTapped: () => Navigator.pop(context),
|
||||||
|
),
|
||||||
|
body: Consumer(
|
||||||
|
builder: (BuildContext context, SettingOptionsVM settingsOptionsVM, Widget? child) {
|
||||||
|
return Container(
|
||||||
|
color: MyColors.backgroundColor,
|
||||||
|
width: double.infinity,
|
||||||
|
height: double.infinity,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
16.height,
|
||||||
|
Expanded(
|
||||||
|
child: RefreshIndicator(
|
||||||
|
onRefresh: () async => await settingsOptionsVM.getTermsAndConditions(),
|
||||||
|
child: (settingsOptionsVM.state == ViewState.busy)
|
||||||
|
? const Center(child: CircularProgressIndicator())
|
||||||
|
: settingsOptionsVM.termsAndConditionsList.isEmpty
|
||||||
|
? Padding(
|
||||||
|
padding: const EdgeInsets.all(21),
|
||||||
|
child: Center(child: LocaleKeys.somethingWrong.tr().toText(textAlign: TextAlign.center, fontSize: 16, color: MyColors.lightTextColor)),
|
||||||
|
)
|
||||||
|
: ListView.separated(
|
||||||
|
itemCount: settingsOptionsVM.termsAndConditionsList.length,
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
AppInfoModel appInfoModel = settingsOptionsVM.termsAndConditionsList[index];
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
(appInfoModel.header ?? "").toString().toText(fontSize: 16),
|
||||||
|
5.height,
|
||||||
|
(appInfoModel.content ?? "").toString().toText(fontSize: 14, color: MyColors.lightTextColor),
|
||||||
|
if (appInfoModel.images != null && appInfoModel.images!.isNotEmpty) ...[
|
||||||
|
PickedFilesContainer(
|
||||||
|
pickedFiles: appInfoModel.images ?? [],
|
||||||
|
isReview: true,
|
||||||
|
onAddFilePressed: () {},
|
||||||
|
).onPress(() {
|
||||||
|
List<MessageImageModel> images = [];
|
||||||
|
for (var image in appInfoModel.images!) {
|
||||||
|
images.add(MessageImageModel(
|
||||||
|
id: image.id,
|
||||||
|
isFromNetwork: true,
|
||||||
|
imageUrl: image.filePath,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
navigateWithName(context, AppRoutes.mediaViewerScreen, arguments: images);
|
||||||
|
}),
|
||||||
|
]
|
||||||
|
],
|
||||||
|
).toContainer(isShadowEnabled: true);
|
||||||
|
},
|
||||||
|
separatorBuilder: (context, index) => 16.height,
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue