Issues Fixed

aamir_dev
Faiz Hashmi 1 year ago
parent 4370f36ab2
commit e2a1ee7f58

@ -41,43 +41,48 @@ class _FavoriteListViewState extends State<FavoriteListView> {
title: LocaleKeys.favoriteList.tr(),
isRemoveBackButton: false,
),
body: SizedBox(
width: double.infinity,
height: double.infinity,
child: Column(
children: [
Expanded(
child: Container(
width: double.infinity,
child: appointmentsVM.state == ViewState.busy
? const Center(child: CircularProgressIndicator())
: appointmentsVM.myFavProvidersList.isEmpty
? Center(
child: (LocaleKeys.noProvidersInFav.tr()).toText(
fontSize: 16,
color: MyColors.lightTextColor,
body: RefreshIndicator(
onRefresh: () async {
await context.read<AppointmentsVM>().getMyFavoriteProviders();
},
child: SizedBox(
width: double.infinity,
height: double.infinity,
child: Column(
children: [
Expanded(
child: Container(
width: double.infinity,
child: appointmentsVM.state == ViewState.busy
? const Center(child: CircularProgressIndicator())
: appointmentsVM.myFavProvidersList.isEmpty
? Center(
child: (LocaleKeys.noProvidersInFav.tr()).toText(
fontSize: 16,
color: MyColors.lightTextColor,
),
)
: ListView.separated(
itemCount: appointmentsVM.myFavProvidersList.length,
itemBuilder: (context, index) {
ProviderProfileModel providerProfileModel = appointmentsVM.myFavProvidersList[index];
return ProviderDetailCard(
onCardTapped: () => navigateWithName(context, AppRoutes.providerProfileView, arguments: providerProfileModel.providerID),
providerImageUrl: MyAssets.bnCar,
title: providerProfileModel.name ?? "",
description: providerProfileModel.companyDescription ?? "",
startedSince: DateHelper.formatAsMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(providerProfileModel.memberSince ?? ""))),
branches: providerProfileModel.serviceProviderBranch ?? [],
totalBranches: (providerProfileModel.noOfBranches ?? 0).toString(),
);
},
separatorBuilder: (context, index) => 12.height,
padding: const EdgeInsets.all(12),
),
)
: ListView.separated(
itemCount: appointmentsVM.myFavProvidersList.length,
itemBuilder: (context, index) {
ProviderProfileModel providerProfileModel = appointmentsVM.myFavProvidersList[index];
return ProviderDetailCard(
onCardTapped: () => navigateWithName(context, AppRoutes.providerProfileView, arguments: providerProfileModel.providerID),
providerImageUrl: MyAssets.bnCar,
title: providerProfileModel.name ?? "",
description: providerProfileModel.companyDescription ?? "",
startedSince: DateHelper.formatAsMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(providerProfileModel.memberSince ?? ""))),
branches: providerProfileModel.serviceProviderBranch ?? [],
totalBranches: (providerProfileModel.noOfBranches ?? 0).toString(),
);
},
separatorBuilder: (context, index) => 12.height,
padding: const EdgeInsets.all(12),
),
).paddingOnly(left: 10, right: 10),
),
],
).paddingOnly(left: 10, right: 10),
),
],
),
),
),
);

Loading…
Cancel
Save