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(), title: LocaleKeys.favoriteList.tr(),
isRemoveBackButton: false, isRemoveBackButton: false,
), ),
body: SizedBox( body: RefreshIndicator(
width: double.infinity, onRefresh: () async {
height: double.infinity, await context.read<AppointmentsVM>().getMyFavoriteProviders();
child: Column( },
children: [ child: SizedBox(
Expanded( width: double.infinity,
child: Container( height: double.infinity,
width: double.infinity, child: Column(
child: appointmentsVM.state == ViewState.busy children: [
? const Center(child: CircularProgressIndicator()) Expanded(
: appointmentsVM.myFavProvidersList.isEmpty child: Container(
? Center( width: double.infinity,
child: (LocaleKeys.noProvidersInFav.tr()).toText( child: appointmentsVM.state == ViewState.busy
fontSize: 16, ? const Center(child: CircularProgressIndicator())
color: MyColors.lightTextColor, : 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),
), ),
) ).paddingOnly(left: 10, right: 10),
: 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),
),
],
), ),
), ),
); );

Loading…
Cancel
Save