diff --git a/lib/domain/premium_introduction/premium_introduction_sheet.dart b/lib/domain/premium_introduction/premium_introduction_sheet.dart index 6cf2308c5c..95f76238a8 100644 --- a/lib/domain/premium_introduction/premium_introduction_sheet.dart +++ b/lib/domain/premium_introduction/premium_introduction_sheet.dart @@ -31,87 +31,89 @@ class PremiumIntroductionSheet extends HookConsumerWidget { return Indicator(); } - return DraggableScrollableSheet( - initialChildSize: 0.9, - maxChildSize: 0.9, - builder: (context, scrollController) { - return HUD( - shown: state.isLoading, - child: UniversalErrorPage( - error: null, - reload: () => store.reset(), - child: Container( - width: MediaQuery.of(context).size.width, - color: PilllColors.white, - child: Stack( - children: [ - Container( - decoration: BoxDecoration( - color: Colors.transparent, - image: !state.isPremium && !isOverDiscountDeadline - ? DecorationImage( - image: - AssetImage("images/premium_background.png"), - fit: BoxFit.cover, - ) - : null, - ), - padding: EdgeInsets.only(left: 40, right: 40, bottom: 40), - width: MediaQuery.of(context).size.width, - ), - SingleChildScrollView( - controller: scrollController, - padding: EdgeInsets.only(bottom: 100), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - PremiumIntroductionHeader(), - if (state.isPremium) ...[ - SizedBox(height: 32), - PremiumUserThanksRow(), - ], - if (!state.isPremium) ...[ - if (state.hasDiscountEntitlement) - PremiumIntroductionDiscountRow( - discountEntitlementDeadlineDate: - discountEntitlementDeadlineDate, - ), - if (offerings != null) ...[ - SizedBox(height: 32), - PurchaseButtons( - offerings: offerings, - store: store, - ), - ], - ], - SizedBox(height: 24), - AlertButton( - onPressed: () async { - analytics.logEvent( - name: "pressed_premium_functions_on_sheet"); - await launch(preimumLink); - }, - text: "プレミアム機能を見る"), - SizedBox(height: 24), - PremiumIntroductionFotter(), + return HUD( + shown: state.isLoading, + child: UniversalErrorPage( + error: null, + reload: () => store.reset(), + child: Container( + padding: const EdgeInsets.only(top: 20), + width: MediaQuery.of(context).size.width, + color: PilllColors.white, + child: Stack( + children: [ + Container( + decoration: BoxDecoration( + color: Colors.transparent, + image: !state.isPremium && !isOverDiscountDeadline + ? DecorationImage( + image: AssetImage("images/premium_background.png"), + fit: BoxFit.cover, + ) + : null, + ), + padding: EdgeInsets.only(left: 40, right: 40, bottom: 40), + width: MediaQuery.of(context).size.width, + ), + SingleChildScrollView( + padding: EdgeInsets.only(bottom: 100), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + PremiumIntroductionHeader(), + if (state.isPremium) ...[ + SizedBox(height: 32), + PremiumUserThanksRow(), + ], + if (!state.isPremium) ...[ + if (state.hasDiscountEntitlement) + PremiumIntroductionDiscountRow( + discountEntitlementDeadlineDate: + discountEntitlementDeadlineDate, + ), + if (offerings != null) ...[ + SizedBox(height: 32), + PurchaseButtons( + offerings: offerings, + store: store, + ), ], - ), - ), - ], + ], + SizedBox(height: 24), + AlertButton( + onPressed: () async { + analytics.logEvent( + name: "pressed_premium_functions_on_sheet"); + await launch(preimumLink); + }, + text: "プレミアム機能を見る"), + SizedBox(height: 24), + PremiumIntroductionFotter(), + ], + ), + ), + Positioned( + left: 7, + top: 20, + child: IconButton( + icon: Icon(Icons.close, color: Colors.black), + onPressed: () => Navigator.of(context).pop(), + ), ), - )), - ); - }, + ], + ), + )), ); } } showPremiumIntroductionSheet(BuildContext context) { analytics.setCurrentScreen(screenName: "PremiumIntroductionSheet"); + showModalBottomSheet( context: context, builder: (_) => PremiumIntroductionSheet(), - isScrollControlled: true, backgroundColor: Colors.transparent, + isScrollControlled: true, ); }