Merge branch 'faiz_development' into aamir_dev

aamir_dev
Aamir 1 year ago
commit 957407a7ab

@ -2,6 +2,7 @@ import 'dart:io';
import 'package:car_customer_app/config/customer_dependencies.dart'; import 'package:car_customer_app/config/customer_dependencies.dart';
import 'package:car_customer_app/config/customer_routes.dart'; import 'package:car_customer_app/config/customer_routes.dart';
import 'package:flutter/services.dart';
import 'package:mc_common_app/repositories/branch_repo.dart'; import 'package:mc_common_app/repositories/branch_repo.dart';
import 'package:mc_common_app/repositories/chat_repo.dart'; import 'package:mc_common_app/repositories/chat_repo.dart';
import 'package:mc_common_app/repositories/appointment_repo.dart'; import 'package:mc_common_app/repositories/appointment_repo.dart';
@ -62,7 +63,8 @@ Future<void> main() async {
injector.get<Location>().handleLocationPermission(); injector.get<Location>().handleLocationPermission();
}); });
CustomerAppRoutes.routes.addAll(AppRoutes.routes); CustomerAppRoutes.routes.addAll(AppRoutes.routes);
initializeDateFormatting().then((_) => runApp( initializeDateFormatting().then(
(_) => runApp(
MultiProvider( MultiProvider(
providers: <SingleChildWidget>[ providers: <SingleChildWidget>[
ChangeNotifierProvider<BaseVM>( ChangeNotifierProvider<BaseVM>(
@ -122,7 +124,8 @@ Future<void> main() async {
], ],
child: MyApp(), child: MyApp(),
).setupLocale(), ).setupLocale(),
)); ),
);
} }
// todo terminal command to generate translation files // todo terminal command to generate translation files
@ -136,6 +139,10 @@ class MyApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
return Sizer( return Sizer(
builder: (context, orientation, deviceType) { builder: (context, orientation, deviceType) {
injector.get<AppState>().setAppType(AppType.customer); injector.get<AppState>().setAppType(AppType.customer);
@ -160,3 +167,12 @@ class MyApp extends StatelessWidget {
); );
} }
} }
//Latitude: 24.708741, Longitude: 46.6657643,
//Longitude=24.708741&Latitude=46.6657643
//update I/flutter ( 5035): "latitude": "37.421998",
// I/flutter ( 5035): "longitude": "-122.0839",

@ -46,6 +46,15 @@ class _ProviderProfileViewState extends State<ProviderProfileView> {
body: Center(child: CircularProgressIndicator()), body: Center(child: CircularProgressIndicator()),
); );
} }
String providerBannerImageUrl = "";
if (appointmentsVM.providerProfileModel!.serviceProviderBranch!.isNotEmpty) {
if (appointmentsVM.providerProfileModel!.serviceProviderBranch!.first.branchImages!.isNotEmpty) {
providerBannerImageUrl = appointmentsVM.providerProfileModel!.serviceProviderBranch!.first.branchImages!.first.imageUrl ?? "";
}
}
return Scaffold( return Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
title: LocaleKeys.providerDetails.tr(), title: LocaleKeys.providerDetails.tr(),
@ -59,6 +68,7 @@ class _ProviderProfileViewState extends State<ProviderProfileView> {
bool status = await appointmentsVM.removeProviderFromFavorite(serviceProviderID: appointmentsVM.providerProfileModel!.id!, context: context); bool status = await appointmentsVM.removeProviderFromFavorite(serviceProviderID: appointmentsVM.providerProfileModel!.id!, context: context);
if (status) { if (status) {
appointmentsVM.providerProfileModel!.isFavorite = false; appointmentsVM.providerProfileModel!.isFavorite = false;
appointmentsVM.getMyFavoriteProviders();
setState(() {}); setState(() {});
} }
} else { } else {
@ -76,29 +86,39 @@ class _ProviderProfileViewState extends State<ProviderProfileView> {
body: Container( body: Container(
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
padding: EdgeInsets.all(21), padding: EdgeInsets.symmetric(horizontal: 21),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
//TODO: company logo/banner not added form provider app yet Center(child: providerBannerImageUrl.buildNetworkImage(height: 250, width: double.infinity, fit: BoxFit.cover)),
Image.asset(MyAssets.bnCar),
12.height, 12.height,
(appointmentsVM.providerProfileModel!.name ?? appointmentsVM.providerProfileModel!.companyName).toString().toText( if (appointmentsVM.providerProfileModel!.memberSince!.isNotEmpty) ...[
Row(
children: [
("${LocaleKeys.companyName.tr()}:").toText(color: MyColors.lightTextColor, fontSize: 12),
4.width,
(appointmentsVM.providerProfileModel!.companyName ?? appointmentsVM.providerProfileModel!.name).toString().toText(
fontSize: 16, fontSize: 16,
isBold: true, isBold: true,
), ),
],
),
],
if (appointmentsVM.providerProfileModel!.memberSince!.isNotEmpty) ...[ if (appointmentsVM.providerProfileModel!.memberSince!.isNotEmpty) ...[
Row( Row(
children: [ children: [
("${LocaleKeys.memberSince.tr()}:").toText(color: MyColors.lightTextColor, fontSize: 12), ("${LocaleKeys.memberSince.tr()}:").toText(color: MyColors.lightTextColor, fontSize: 12),
4.width, 4.width,
"${DateHelper.formatAsMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT( "${DateHelper.formatAsMonthYear(
DateHelper.parseStringToDate(
DateHelper.formatDateT(
appointmentsVM.providerProfileModel!.memberSince ?? "", appointmentsVM.providerProfileModel!.memberSince ?? "",
)))}" ),
),
)}"
.toText(fontSize: 12, isBold: true), .toText(fontSize: 12, isBold: true),
], ],
), ),
@ -124,7 +144,7 @@ class _ProviderProfileViewState extends State<ProviderProfileView> {
onCardTapped: () { onCardTapped: () {
navigateWithName(context, AppRoutes.branchDetailView, arguments: branchModel); navigateWithName(context, AppRoutes.branchDetailView, arguments: branchModel);
}, },
providerImageUrl: MyAssets.bnCar, providerImageUrl: (branchModel.branchImages != null && branchModel.branchImages!.isNotEmpty) ? (branchModel.branchImages!.first.imageUrl ?? "") : "",
title: branchModel.branchName ?? "", title: branchModel.branchName ?? "",
providerLocation: branchModel.distanceKm.toString() + " KM", providerLocation: branchModel.distanceKm.toString() + " KM",
providerName: branchModel.serviceProviderName ?? "", providerName: branchModel.serviceProviderName ?? "",

Loading…
Cancel
Save