Skip to content

Commit

Permalink
clean-ups
Browse files Browse the repository at this point in the history
  • Loading branch information
atavism committed Nov 17, 2023
1 parent c73de2c commit 0035c65
Showing 1 changed file with 45 additions and 51 deletions.
96 changes: 45 additions & 51 deletions lib/plans/play_checkout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,59 +41,54 @@ class _PlayCheckoutState extends State<PlayCheckout>
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,
),
),
),
],
),
);
}));
}
Expand All @@ -119,7 +114,6 @@ class _PlayCheckoutState extends State<PlayCheckout>
);
}


void submitPayment() {
Future.wait(
[
Expand Down

0 comments on commit 0035c65

Please sign in to comment.