From 0035c652e2bd41570ac18fb22ac1315d287e842a Mon Sep 17 00:00:00 2001 From: atavism Date: Fri, 17 Nov 2023 04:53:47 -0800 Subject: [PATCH] clean-ups --- lib/plans/play_checkout.dart | 96 +++++++++++++++++------------------- 1 file changed, 45 insertions(+), 51 deletions(-) diff --git a/lib/plans/play_checkout.dart b/lib/plans/play_checkout.dart index 4cd4967fc..18925c1a9 100644 --- a/lib/plans/play_checkout.dart +++ b/lib/plans/play_checkout.dart @@ -41,59 +41,54 @@ class _PlayCheckoutState extends State return BaseScreen( resizeToAvoidBottomInset: false, title: 'lantern_pro_checkout'.i18n, - body: sessionModel.countryCode((context, countryCode, child) { - return sessionModel.emailAddress(( - BuildContext context, - String emailAddress, - Widget? child, - ) { - return Container( + body: sessionModel.emailAddress(( + BuildContext context, + String emailAddress, + Widget? child, + ) { + return Container( + padding: const EdgeInsetsDirectional.only( + start: 16, + end: 16, + top: 24, + bottom: 32, + ), + child: Column( + children: [ + // * Email field + Container( padding: const EdgeInsetsDirectional.only( - start: 16, - end: 16, - top: 24, - bottom: 32, + top: 8, + bottom: 8, ), - child: Column( - children: [ - // * Email field - Container( - padding: const EdgeInsetsDirectional.only( - top: 8, - bottom: 8, - ), - child: Form( - key: emailFieldKey, - child: CTextField( - initialValue: widget.isPro ? emailAddress : '', - controller: emailController, - autovalidateMode: widget.isPro - ? AutovalidateMode.always - : AutovalidateMode.disabled, - label: 'email'.i18n, - keyboardType: TextInputType.emailAddress, - prefixIcon: - const CAssetImage(path: ImagePaths.email), - ), - ), - ), - // * Price summary, unused pro time disclaimer, Continue button - Center( - child: Tooltip( - message: AppKeys.continueCheckout, - child: Button( - text: 'submit'.i18n, - disabled: emailController.value.text.isEmpty || - emailFieldKey.currentState?.validate() == - false, - onPressed: submitPayment, - ), - ), - ), - ], + child: Form( + key: emailFieldKey, + child: CTextField( + initialValue: widget.isPro ? emailAddress : '', + controller: emailController, + autovalidateMode: widget.isPro + ? AutovalidateMode.always + : AutovalidateMode.disabled, + label: 'email'.i18n, + keyboardType: TextInputType.emailAddress, + prefixIcon: const CAssetImage(path: ImagePaths.email), + ), ), - ); - }, + ), + // * Price summary, unused pro time disclaimer, Continue button + Center( + child: Tooltip( + message: AppKeys.continueCheckout, + child: Button( + text: 'submit'.i18n, + disabled: emailController.value.text.isEmpty || + emailFieldKey.currentState?.validate() == false, + onPressed: submitPayment, + ), + ), + ), + ], + ), ); })); } @@ -119,7 +114,6 @@ class _PlayCheckoutState extends State ); } - void submitPayment() { Future.wait( [