From 850278462fe32f59fbb9a466f21560b4a675a05a Mon Sep 17 00:00:00 2001 From: Rahul Dev Garg <34365102+rahuldevgarg@users.noreply.github.com> Date: Fri, 27 Oct 2023 03:56:17 +0530 Subject: [PATCH] PFM-4658 --- .../common/consumer_collect_payment.dart | 2 +- frontend/mgramseva/lib/utils/loaders.dart | 53 ++++++++++++++++--- 2 files changed, 48 insertions(+), 7 deletions(-) diff --git a/frontend/mgramseva/lib/screeens/common/consumer_collect_payment.dart b/frontend/mgramseva/lib/screeens/common/consumer_collect_payment.dart index 7509c6e21..486571aa9 100644 --- a/frontend/mgramseva/lib/screeens/common/consumer_collect_payment.dart +++ b/frontend/mgramseva/lib/screeens/common/consumer_collect_payment.dart @@ -711,7 +711,7 @@ class _ConsumerCollectPaymentViewState extends State { return ValueListenableBuilder( valueListenable: clickedStatus, builder: (context,bool isClicked,_) { - return isClicked?Loaders.loaderBox(context,text: ""):Align( + return isClicked?Loaders.loaderBoxCircularLoader(context,text: ""):Align( alignment: Alignment.center, child: ConfirmationPopUp( textString: i18.payment.CORE_AMOUNT_CONFIRMATION, diff --git a/frontend/mgramseva/lib/utils/loaders.dart b/frontend/mgramseva/lib/utils/loaders.dart index af9eaff74..242314651 100644 --- a/frontend/mgramseva/lib/utils/loaders.dart +++ b/frontend/mgramseva/lib/utils/loaders.dart @@ -54,7 +54,7 @@ class Loaders { }); } - static void showLoader(BuildContext context, {String? text}) { + static void showLoader(BuildContext context, {String? text, Color? loaderColor , Color? textColor}) { showDialog( context: context, barrierColor: Colors.black.withOpacity(0.2), @@ -77,14 +77,14 @@ class Loaders { alignment: WrapAlignment.center, children: [ SpinKitCircle( - color: Colors.white, + color: loaderColor??Colors.white, size: 50.0, ), Text( text ?? ' Getting image data \n Please check the values once done. ', textAlign: TextAlign.center, - style: TextStyle(color: Colors.white), + style: TextStyle(color: textColor??Colors.white), ), ], )), @@ -93,7 +93,7 @@ class Loaders { ); }); } - static Widget loaderBox(BuildContext context, {String? text}){ + static Widget loaderBox(BuildContext context, {String? text, Color? loaderColor , Color? textColor}){ return WillPopScope( onWillPop: () async => false, child: Dialog( @@ -120,14 +120,55 @@ class Loaders { alignment: WrapAlignment.center, children: [ SpinKitCircle( - color: Colors.white, + color: loaderColor??Colors.white, size: 50.0, ), Text( text ?? ' Getting image data \n Please check the values once done. ', textAlign: TextAlign.center, - style: TextStyle(color: Colors.white), + style: TextStyle(color: textColor??Colors.white), + ), + ], + )), + ), + ), + ); + } + static Widget loaderBoxCircularLoader(BuildContext context, {String? text, Color? loaderColor , Color? textColor}){ + return WillPopScope( + onWillPop: () async => false, + child: Dialog( + // backgroundColor:CustomColors.BLACK, + shape: RoundedRectangleBorder( + borderRadius: new BorderRadius.circular(15)), + child: WillPopScope( + onWillPop: () async { + return true; + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle + ), + alignment: Alignment.center, + constraints: BoxConstraints( + minHeight: 160, + maxHeight: 180 + ), + width: MediaQuery.of(context).size.width > 720 ? MediaQuery.of(context).size.width / 3.5 : MediaQuery.of(context).size.width , + padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), + child: Wrap( + runSpacing: 15, + alignment: WrapAlignment.center, + children: [ + CircularProgressIndicator( + color: loaderColor??Theme.of(context).primaryColor, + ), + Text( + text ?? + ' Getting image data \n Please check the values once done. ', + textAlign: TextAlign.center, + style: TextStyle(color: textColor??Colors.white), ), ], )),