Pull to refresh, Items for Sale & Offers n Discounts fixes

merge-requests/8/head
haroon amjad 3 years ago
parent 4c1927bee5
commit 866bb8a29e

@ -72,6 +72,33 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
return true; return true;
} }
void initProvider() {
isAttendanceTrackingLoading = true;
endTime = 0;
isTimeRemainingInSeconds = 0;
progress = 0.0;
attendanceTracking = null;
isWorkListLoading = true;
workListCounter = 0;
isMissingSwipeLoading = true;
missingSwipeCounter = 0;
isLeaveTicketBalanceLoading = true;
accrualList = null;
leaveBalanceAccrual = null;
ticketBalance = 0;
isServicesMenusLoading = true;
homeMenus = null;
getMenuEntriesList = null;
isOffersLoading = true;
getOffersList = [];
notifyListeners();
}
int calculateSeconds(String time) { int calculateSeconds(String time) {
int hour = int.parse(time.split(":")[0]); int hour = int.parse(time.split(":")[0]);
int mints = int.parse(time.split(":")[1]); int mints = int.parse(time.split(":")[1]);
@ -81,12 +108,6 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
void update(context) { void update(context) {
fetchAttendanceTracking(context); fetchAttendanceTracking(context);
// isAttendanceTrackingLoading = !isAttendanceTrackingLoading;
// isWorkListLoading = !isWorkListLoading;
// attendanceTracking?.pSwipeIn = "a";
// isTimeRemainingInSeconds = calculateSeconds("00:10:30");
// endTime = DateTime.now().millisecondsSinceEpoch + Duration(seconds: isTimeRemainingInSeconds).inMilliseconds;
// notifyListeners();
} }
ItgFormsModel? itgFormsModel; ItgFormsModel? itgFormsModel;

@ -23,6 +23,7 @@ import 'package:mohem_flutter_app/widgets/mark_attendance_widget.dart';
import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart'; import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart';
import 'package:mohem_flutter_app/widgets/shimmer/offers_shimmer_widget.dart'; import 'package:mohem_flutter_app/widgets/shimmer/offers_shimmer_widget.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
class DashboardScreen extends StatefulWidget { class DashboardScreen extends StatefulWidget {
DashboardScreen({Key? key}) : super(key: key); DashboardScreen({Key? key}) : super(key: key);
@ -37,12 +38,24 @@ class _DashboardScreenState extends State<DashboardScreen> {
late DashboardProviderModel data; late DashboardProviderModel data;
final GlobalKey<ScaffoldState> _scaffoldState = GlobalKey(); final GlobalKey<ScaffoldState> _scaffoldState = GlobalKey();
final RefreshController _refreshController = RefreshController(initialRefresh: false);
int currentIndex = 0; int currentIndex = 0;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
data = Provider.of<DashboardProviderModel>(context, listen: false); data = Provider.of<DashboardProviderModel>(context, listen: false);
_onRefresh();
}
@override
void dispose() {
super.dispose();
}
void _onRefresh() async {
data.initProvider();
data.fetchListMenu(); data.fetchListMenu();
data.fetchAttendanceTracking(context); data.fetchAttendanceTracking(context);
data.fetchWorkListCounter(context); data.fetchWorkListCounter(context);
@ -50,11 +63,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
data.fetchLeaveTicketBalance(context, DateTime.now()); data.fetchLeaveTicketBalance(context, DateTime.now());
data.fetchMenuEntries(); data.fetchMenuEntries();
data.getCategoryOffersListAPI(context); data.getCategoryOffersListAPI(context);
} _refreshController.refreshCompleted();
@override
void dispose() {
super.dispose();
} }
@override @override
@ -122,236 +131,243 @@ class _DashboardScreenState extends State<DashboardScreen> {
], ],
).paddingOnly(left: 21, right: 21, top: 48, bottom: 7), ).paddingOnly(left: 21, right: 21, top: 48, bottom: 7),
Expanded( Expanded(
child: SingleChildScrollView( child: SmartRefresher(
child: Column( enablePullDown: true,
children: [ enablePullUp: false,
Column( header: const MaterialClassicHeader(color: MyColors.gradiantEndColor,),
crossAxisAlignment: CrossAxisAlignment.start, controller: _refreshController,
children: [ onRefresh: _onRefresh,
LocaleKeys.goodMorning.tr().toText14(color: MyColors.grey77Color), child: SingleChildScrollView(
(AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true), child: Column(
16.height, children: [
Row( Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Expanded( children: [
child: AspectRatio( LocaleKeys.goodMorning.tr().toText14(color: MyColors.grey77Color),
aspectRatio: 159 / 159, (AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true),
child: Consumer<DashboardProviderModel>( 16.height,
builder: (context, model, child) { Row(
return (model.isAttendanceTrackingLoading children: [
? GetAttendanceTrackingShimmer() Expanded(
: Container( child: AspectRatio(
decoration: BoxDecoration( aspectRatio: 159 / 159,
borderRadius: BorderRadius.circular(15), child: Consumer<DashboardProviderModel>(
gradient: const LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [ builder: (context, model, child) {
MyColors.gradiantEndColor, return (model.isAttendanceTrackingLoading
MyColors.gradiantStartColor, ? GetAttendanceTrackingShimmer()
]), : Container(
), decoration: BoxDecoration(
child: Stack( borderRadius: BorderRadius.circular(15),
alignment: Alignment.center, gradient: const LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [
children: [ MyColors.gradiantEndColor,
if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"), MyColors.gradiantStartColor,
Column( ]),
crossAxisAlignment: CrossAxisAlignment.start, ),
children: [ child: Stack(
Expanded( alignment: Alignment.center,
child: Column( children: [
mainAxisSize: MainAxisSize.min, if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
crossAxisAlignment: CrossAxisAlignment.start, Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true), children: [
if (model.isTimeRemainingInSeconds == 0) "01-02-2022".toText12(color: Colors.white), Expanded(
if (model.isTimeRemainingInSeconds != 0) child: Column(
Column( mainAxisSize: MainAxisSize.min,
mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true),
9.height, if (model.isTimeRemainingInSeconds == 0) "01-02-2022".toText12(color: Colors.white),
CountdownTimer( if (model.isTimeRemainingInSeconds != 0)
endTime: model.endTime, Column(
onEnd: null, mainAxisSize: MainAxisSize.min,
endWidget: "00:00:00".toText14(color: Colors.white, isBold: true), crossAxisAlignment: CrossAxisAlignment.start,
textStyle: TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
),
LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
9.height,
ClipRRect(
borderRadius: BorderRadius.all(
Radius.circular(20),
),
child: LinearProgressIndicator(
value: model.progress,
minHeight: 8,
valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
backgroundColor: const Color(0xff196D73),
),
),
],
),
],
).paddingOnly(top: 12, right: 15, left: 12),
),
Row(
children: [ children: [
Expanded( 9.height,
child: Column( CountdownTimer(
mainAxisSize: MainAxisSize.min, endTime: model.endTime,
crossAxisAlignment: CrossAxisAlignment.start, onEnd: null,
children: [ endWidget: "00:00:00".toText14(color: Colors.white, isBold: true),
LocaleKeys.checkIn.tr().toText12(color: Colors.white), textStyle: TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
(model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn)
.toString()
.toText14(color: Colors.white, isBold: true),
4.height,
],
).paddingOnly(left: 12),
), ),
Container( LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
width: 45, 9.height,
height: 45, ClipRRect(
padding: const EdgeInsets.only(left: 14, right: 14), borderRadius: BorderRadius.all(
decoration: const BoxDecoration( Radius.circular(20),
color: Color(0xff259EA4),
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(15),
),
), ),
child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/play.svg" : "assets/images/stop.svg"), child: LinearProgressIndicator(
).onPress(() { value: model.progress,
showMyBottomSheet(context, child: MarkAttendanceWidget(model)); minHeight: 8,
}), valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
backgroundColor: const Color(0xff196D73),
),
),
], ],
), ),
], ],
).paddingOnly(top: 12, right: 15, left: 12),
),
Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.checkIn.tr().toText12(color: Colors.white),
(model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn)
.toString()
.toText14(color: Colors.white, isBold: true),
4.height,
],
).paddingOnly(left: 12),
), ),
Container(
width: 45,
height: 45,
padding: const EdgeInsets.only(left: 14, right: 14),
decoration: const BoxDecoration(
color: Color(0xff259EA4),
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(15),
),
),
child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/play.svg" : "assets/images/stop.svg"),
).onPress(() {
showMyBottomSheet(context, child: MarkAttendanceWidget(model));
}),
], ],
), ),
).onPress( ],
() { ),
Navigator.pushNamed(context, AppRoutes.todayAttendance); ],
}, ),
)) ).onPress(
.animatedSwither(); () {
}, Navigator.pushNamed(context, AppRoutes.todayAttendance);
},
))
.animatedSwither();
},
),
), ),
), ),
), 9.width,
9.width,
Expanded(
child: MenusWidget(),
),
],
),
],
).paddingOnly(left: 21, right: 21, top: 7),
ServicesWidget(),
// 8.height,
Container(
width: double.infinity,
padding: const EdgeInsets.only(top: 31),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.only(topRight: Radius.circular(50), topLeft: Radius.circular(50)),
border: Border.all(color: MyColors.lightGreyEDColor, width: 1),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded( Expanded(
child: Column( child: MenusWidget(),
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
LocaleKeys.offers.tr().toText12(),
Row(
children: [
LocaleKeys.discounts.tr().toText24(isBold: true),
6.width,
Container(
padding: const EdgeInsets.only(left: 8, right: 8),
decoration: BoxDecoration(
color: MyColors.yellowColor,
borderRadius: BorderRadius.circular(10),
),
child: LocaleKeys.newString.tr().toText10(isBold: true)),
],
),
],
),
), ),
LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() {
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
})
], ],
).paddingOnly(left: 21, right: 21), ),
Consumer<DashboardProviderModel>( ],
builder: (context, model, child) { ).paddingOnly(left: 21, right: 21, top: 7),
return SizedBox( ServicesWidget(),
height: 103 + 33, // 8.height,
child: ListView.separated( Container(
shrinkWrap: true, width: double.infinity,
physics: const BouncingScrollPhysics(), padding: const EdgeInsets.only(top: 31),
padding: const EdgeInsets.only(left: 21, right: 21, top: 13), decoration: BoxDecoration(
scrollDirection: Axis.horizontal, color: Colors.white,
itemBuilder: (cxt, index) { borderRadius: const BorderRadius.only(topRight: Radius.circular(50), topLeft: Radius.circular(50)),
return model.isOffersLoading border: Border.all(color: MyColors.lightGreyEDColor, width: 1),
? const OffersShimmerWidget() ),
: InkWell( child: Column(
onTap: () { mainAxisSize: MainAxisSize.min,
navigateToDetails(data.getOffersList[index]); children: [
}, Row(
child: SizedBox( crossAxisAlignment: CrossAxisAlignment.center,
width: 73, children: [
child: Column( Expanded(
crossAxisAlignment: CrossAxisAlignment.center, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Container( mainAxisSize: MainAxisSize.min,
width: 73, children: [
height: 73, LocaleKeys.offers.tr().toText12(),
decoration: BoxDecoration( Row(
borderRadius: const BorderRadius.all( children: [
Radius.circular(100), LocaleKeys.discounts.tr().toText24(isBold: true),
), 6.width,
border: Border.all(color: MyColors.lightGreyE3Color, width: 1), Container(
), padding: const EdgeInsets.only(left: 8, right: 8),
child: ClipRRect( decoration: BoxDecoration(
borderRadius: const BorderRadius.all( color: MyColors.yellowColor,
Radius.circular(50), borderRadius: BorderRadius.circular(10),
), ),
child: Hero( child: LocaleKeys.newString.tr().toText10(isBold: true)),
tag: "ItemImage" + data.getOffersList[index].rowID!, ],
transitionOnUserGestures: true, ),
child: Image.network( ],
data.getOffersList[index].bannerImage!, ),
fit: BoxFit.contain, ),
), LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() {
), Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
), })
],
).paddingOnly(left: 21, right: 21),
Consumer<DashboardProviderModel>(
builder: (context, model, child) {
return SizedBox(
height: 103 + 33,
child: ListView.separated(
shrinkWrap: true,
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.only(left: 21, right: 21, top: 13),
scrollDirection: Axis.horizontal,
itemBuilder: (cxt, index) {
return model.isOffersLoading
? const OffersShimmerWidget()
: InkWell(
onTap: () {
navigateToDetails(data.getOffersList[index]);
},
child: SizedBox(
width: 73,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 73,
height: 73,
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(
Radius.circular(100),
), ),
4.height, border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
Expanded( ),
child: AppState().isArabic(context) child: ClipRRect(
? data.getOffersList[index].titleAR!.toText12(isCenter: true, maxLine: 1) borderRadius: const BorderRadius.all(
: data.getOffersList[index].title!.toText12(isCenter: true, maxLine: 1), Radius.circular(50),
), ),
], child: Hero(
tag: "ItemImage" + data.getOffersList[index].rowID!,
transitionOnUserGestures: true,
child: Image.network(
data.getOffersList[index].bannerImage!,
fit: BoxFit.contain,
),
),
),
), ),
), 4.height,
); Expanded(
}, child: AppState().isArabic(context)
separatorBuilder: (cxt, index) => 8.width, ? data.getOffersList[index].titleAR!.toText12(isCenter: true, maxLine: 1)
itemCount: 6), : data.getOffersList[index].title!.toText12(isCenter: true, maxLine: 1),
); ),
}, ],
), ),
], ),
), );
) },
], separatorBuilder: (cxt, index) => 8.width,
itemCount: 6),
);
},
),
],
),
)
],
),
), ),
), ),
) )

@ -22,10 +22,10 @@ class ServicesWidget extends StatelessWidget {
"assets/images/monthly_attendance.svg", "assets/images/monthly_attendance.svg",
"assets/images/ticket_request.svg", "assets/images/ticket_request.svg",
"assets/images/ticket_request.svg", "assets/images/ticket_request.svg",
"assets/images/dynamic_screens.svg", "assets/images/ticket_request.svg",
"assets/images/dynamic_screens.svg", "assets/images/ticket_request.svg",
"assets/images/dynamic_screens.svg", "assets/images/ticket_request.svg",
"assets/images/dynamic_screens.svg" "assets/images/ticket_request.svg"
]; ];
return Consumer<DashboardProviderModel>( return Consumer<DashboardProviderModel>(

@ -25,6 +25,7 @@ class _ItemsForSaleFragmentState extends State<ItemsForSaleFragment> {
List<GetSaleCategoriesList> getSaleCategoriesList = []; List<GetSaleCategoriesList> getSaleCategoriesList = [];
List<GetItemsForSaleList> getItemsForSaleList = []; List<GetItemsForSaleList> getItemsForSaleList = [];
List<GetItemsForSaleList> _foundItemsForSaleList = [];
ScrollController gridScrollController = ScrollController(); ScrollController gridScrollController = ScrollController();
int currentPageNo = 1; int currentPageNo = 1;
@ -61,20 +62,10 @@ class _ItemsForSaleFragmentState extends State<ItemsForSaleFragment> {
isInputTypeNum: false, isInputTypeNum: false,
isReadOnly: false, isReadOnly: false,
onChange: (String value) { onChange: (String value) {
// _runFilter(value); _runFilter(value);
}, },
).paddingOnly(left: 21, right: 21, top: 21), ).paddingOnly(left: 21, right: 21, top: 21),
Row( LocaleKeys.browseCategories.tr().toText17().paddingOnly(left: 21, right: 21, top: 21),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
LocaleKeys.browseCategories.tr().toText17(),
// todo @haroon define the purpose of this icon button
IconButton(
icon: const Icon(Icons.filter_alt_sharp, color: MyColors.darkIconColor, size: 28.0),
onPressed: () => Navigator.pop(context),
),
],
).paddingOnly(left: 21, right: 21),
SizedBox( SizedBox(
height: 105.0, height: 105.0,
child: getSaleCategoriesList.isNotEmpty child: getSaleCategoriesList.isNotEmpty
@ -132,10 +123,22 @@ class _ItemsForSaleFragmentState extends State<ItemsForSaleFragment> {
); );
} }
void _runFilter(String enteredKeyword) {
List<GetItemsForSaleList> results = [];
if (enteredKeyword.isEmpty) {
results = getItemsForSaleList;
} else {
results = getItemsForSaleList.where((offer) => offer.title!.toLowerCase().contains(enteredKeyword.toLowerCase())).toList();
}
setState(() {
_foundItemsForSaleList = results;
});
}
List<Widget> getItemsForSaleWidgets() { List<Widget> getItemsForSaleWidgets() {
List<Widget> itemsList = []; List<Widget> itemsList = [];
getItemsForSaleList.forEach((element) { _foundItemsForSaleList.forEach((element) {
itemsList.add(getItemCard(element)); itemsList.add(getItemCard(element));
}); });
@ -200,6 +203,7 @@ class _ItemsForSaleFragmentState extends State<ItemsForSaleFragment> {
getItemsForSaleListLocal.clear(); getItemsForSaleListLocal.clear();
getItemsForSaleListLocal = await ItemsForSaleApiClient().getItemsForSale(itgPageNo, itgCategoryID); getItemsForSaleListLocal = await ItemsForSaleApiClient().getItemsForSale(itgPageNo, itgCategoryID);
getItemsForSaleList.addAll(getItemsForSaleListLocal); getItemsForSaleList.addAll(getItemsForSaleListLocal);
_foundItemsForSaleList = getItemsForSaleList;
Utils.hideLoading(context); Utils.hideLoading(context);
setState(() {}); setState(() {});
} catch (ex) { } catch (ex) {

@ -25,6 +25,7 @@ class OffersAndDiscountsHome extends StatefulWidget {
class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> { class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
List<GetCategoriesList> getCategoriesList = []; List<GetCategoriesList> getCategoriesList = [];
List<OffersListModel> getOffersList = []; List<OffersListModel> getOffersList = [];
List<OffersListModel> _foundOffersList = [];
int currentCategoryID = 0; int currentCategoryID = 0;
@ -54,18 +55,10 @@ class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
isInputTypeNum: false, isInputTypeNum: false,
isReadOnly: false, isReadOnly: false,
onChange: (String value) { onChange: (String value) {
// _runFilter(value); _runFilter(value);
}, },
).paddingOnly(left: 21, right: 21, top: 21), ).paddingOnly(left: 21, right: 21, top: 21),
Row( LocaleKeys.browseCategories.tr().toText17().paddingOnly(left: 21, right: 21, top: 21),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
LocaleKeys.browseCategories.tr().toText17(),
const Icon(Icons.filter_alt_sharp, color: MyColors.darkIconColor, size: 28.0).onPress(() {
Navigator.pop(context);
}),
],
).paddingOnly(left: 21, right: 21, top: 21),
SizedBox( SizedBox(
height: 110.0, height: 110.0,
child: getCategoriesList.isNotEmpty child: getCategoriesList.isNotEmpty
@ -81,6 +74,7 @@ class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
onTap: () { onTap: () {
setState(() { setState(() {
currentCategoryID = getCategoriesList[index].id!; currentCategoryID = getCategoriesList[index].id!;
getCategoryOffersListAPI();
// getItemsForSaleList.clear(); // getItemsForSaleList.clear();
// currentPageNo = 1; // currentPageNo = 1;
// getItemsForSale(currentPageNo, currentCategoryID); // getItemsForSale(currentPageNo, currentCategoryID);
@ -146,7 +140,7 @@ class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
List<Widget> getItemsForSaleWidgets() { List<Widget> getItemsForSaleWidgets() {
List<Widget> itemsList = []; List<Widget> itemsList = [];
for (var element in getOffersList) { for (var element in _foundOffersList) {
itemsList.add(getItemCard(element)); itemsList.add(getItemCard(element));
} }
@ -213,6 +207,18 @@ class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
); );
} }
void _runFilter(String enteredKeyword) {
List<OffersListModel> results = [];
if (enteredKeyword.isEmpty) {
results = getOffersList;
} else {
results = getOffersList.where((offer) => offer.title!.toLowerCase().contains(enteredKeyword.toLowerCase())).toList();
}
setState(() {
_foundOffersList = results;
});
}
void navigateToDetails(OffersListModel offersListModelObj) { void navigateToDetails(OffersListModel offersListModelObj) {
List<OffersListModel> getOffersDetailList = []; List<OffersListModel> getOffersDetailList = [];
getOffersDetailList.clear(); getOffersDetailList.clear();
@ -258,6 +264,7 @@ class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
getOffersList = await OffersAndDiscountsApiClient().getOffersList(currentCategoryID, 100); getOffersList = await OffersAndDiscountsApiClient().getOffersList(currentCategoryID, 100);
_foundOffersList = getOffersList;
Utils.hideLoading(context); Utils.hideLoading(context);
setState(() {}); setState(() {});
} catch (ex) { } catch (ex) {

@ -75,6 +75,7 @@ dependencies:
url_launcher: ^6.0.15 url_launcher: ^6.0.15
share: 2.0.4 share: 2.0.4
flutter_rating_bar: ^4.0.1 flutter_rating_bar: ^4.0.1
pull_to_refresh: ^2.0.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

Loading…
Cancel
Save