@ -10,7 +10,7 @@ import 'package:easy_localization/easy_localization.dart';
import ' package:mc_common_app/widgets/extensions/extensions_widget.dart ' ;
class MySubscriptionsCard extends StatelessWidget {
Subscription pvm ;
Subscription subscriptionVM ;
bool isSubscribed ;
Color ? backgroundColor ;
late Color textColor ;
@ -18,7 +18,7 @@ class MySubscriptionsCard extends StatelessWidget {
Function onUpgradeSubscriptionClick ;
bool isMainPage ;
MySubscriptionsCard ( this . pvm, { Key ? key , this . isSubscribed = false , this . backgroundColor , required this . onRenewSubscriptionClick , required this . onUpgradeSubscriptionClick , this . isMainPage = true } ) : super ( key: key ) ;
MySubscriptionsCard ( this . subscriptionVM, { super . key , this . isSubscribed = false , this . backgroundColor , required this . onRenewSubscriptionClick , required this . onUpgradeSubscriptionClick , this . isMainPage = true } ) ;
@ override
Widget build ( BuildContext context ) {
@ -30,13 +30,13 @@ class MySubscriptionsCard extends StatelessWidget {
Row (
children: [
Expanded (
child: pvm . name . toString ( ) . toText ( fontSize: 18 , color: textColor , letterSpacing: - 0.43 ) ,
child: subscriptionVM . name . toString ( ) . toText ( fontSize: 18 , color: textColor , letterSpacing: - 0.43 ) ,
) ,
/ / if ( providerSubscriptionModel . isActive ! ) " Current Package " . toText ( color: MyColors . primaryColor , fontWeight: FontWeight . bold ) ,
5. width ,
Row (
children: [
pvm . isExpired !
subscriptionVM . isExpired !
? const SizedBox ( )
: Container (
height: 15 ,
@ -53,16 +53,16 @@ class MySubscriptionsCard extends StatelessWidget {
) ,
) ,
5. width ,
( pvm . isExpired ! ? " Expired " : " Subscribed " ) . toText ( color: pvm . isExpired ! ? MyColors . darkTextColor : MyColors . white )
( subscriptionVM . isExpired ! ? " Expired " : " Subscribed " ) . toText ( color: subscriptionVM . isExpired ! ? MyColors . darkTextColor : MyColors . white )
] ,
)
. toContainer (
backgroundColor: pvm . isExpired ! ? MyColors . greyButtonColor : MyColors . primaryColor ,
backgroundColor: subscriptionVM . isExpired ! ? MyColors . greyButtonColor : MyColors . primaryColor ,
borderRadius: 30 ,
padding: const EdgeInsets . symmetric ( horizontal: 8 , vertical: 7 ) ,
)
. onPress ( ( ) {
pvm . isExpired ! ? onRenewSubscriptionClick ( ) : onUpgradeSubscriptionClick ( ) ;
subscriptionVM . isExpired ! ? onRenewSubscriptionClick ( ) : onUpgradeSubscriptionClick ( ) ;
} )
] ,
) ,
@ -71,9 +71,9 @@ class MySubscriptionsCard extends StatelessWidget {
/ / showItem ( " Users: " , " ${ pvm . subUsersRemaining . toString ( ) } of ${ pvm . totalSubUsers . toString ( ) } remaining " ) ,
/ / showItem ( " Branches: " , " ${ pvm . branchesRemaining . toString ( ) } of ${ pvm . totalBranches . toString ( ) } remaining " ) ,
showItem ( " Ads: " , " ${ pvm . adsRemaining . toString ( ) } remaining " ) ,
showItem ( " Users: " , " ${ pvm . subUsersRemaining . toString ( ) } remaining " ) ,
showItem ( " Branches: " , " ${ pvm . branchesRemaining . toString ( ) } remaining " ) ,
showItem ( " Ads: " , " ${ subscriptionVM . adsRemaining . toString ( ) } remaining " ) ,
showItem ( " Users: " , " ${ subscriptionVM . subUsersRemaining . toString ( ) } remaining " ) ,
showItem ( " Branches: " , " ${ subscriptionVM . branchesRemaining . toString ( ) } remaining " ) ,
14. height ,
Row (
@ -85,7 +85,7 @@ class MySubscriptionsCard extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . end ,
children: [
pvm . price . toString ( ) . toText (
subscriptionVM . price . toString ( ) . toText (
fontSize: 29 ,
isBold: true ,
letterSpacing: - 1.77 ,
@ -101,8 +101,8 @@ class MySubscriptionsCard extends StatelessWidget {
) ,
Row (
children: [
" ${ pvm . isExpired ! ? " Expired " : " Expires " } on ${ DateHelper . formatAsDayMonthYear ( DateHelper . parseStringToDate ( DateHelper . formatDateT ( pvm . dateEnd ? ? " " ) ) ) } " . toText ( fontSize: 14 , letterSpacing: - 0.56 , color: textColor , fontWeight: MyFonts . Medium ) ,
if ( pvm . isRenewable ! )
" ${ subscriptionVM . isExpired ! ? " Expired " : " Expires " } on ${ DateHelper . formatAsDayMonthYear ( DateHelper . parseStringToDate ( DateHelper . formatDateT ( subscriptionVM . dateEnd ? ? " " ) ) ) } " . toText ( fontSize: 14 , letterSpacing: - 0.56 , color: textColor , fontWeight: MyFonts . Medium ) ,
if ( subscriptionVM . isRenewable ! )
Row (
children: [
6. width ,