Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ffiPaymentRedirect to use compute #1048

Merged
merged 3 commits into from
Apr 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions lib/plans/checkout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Checkout extends StatefulWidget {
final Plan plan;
final bool isPro;

Checkout({
const Checkout({
required this.plan,
required this.isPro,
Key? key,
Expand All @@ -29,7 +29,7 @@ class _CheckoutState extends State<Checkout>
final emailFieldKey = GlobalKey<FormState>();
late final emailController = CustomTextEditingController(
formKey: emailFieldKey,
validator: (value) => EmailValidator.validate(value ?? '')
validator: (value) => value!.isEmpty?null: EmailValidator.validate(value ?? '')
atavism marked this conversation as resolved.
Show resolved Hide resolved
? null
: 'please_enter_a_valid_email_address'.i18n,
);
Expand Down Expand Up @@ -69,8 +69,6 @@ class _CheckoutState extends State<Checkout>

@override
void dispose() {
emailController.dispose();
refCodeController.dispose();
atavism marked this conversation as resolved.
Show resolved Hide resolved
animationController.dispose();
super.dispose();
}
Expand Down Expand Up @@ -244,8 +242,7 @@ class _CheckoutState extends State<Checkout>
}

bool enableContinueButton() {
final isEmailValid = !emailController.value.text.isEmpty &&
emailFieldKey.currentState!.validate();
final isEmailValid = EmailValidator.validate(emailController.value.text);
if (!isRefCodeFieldShowing || refCodeController.text.isEmpty) {
return isEmailValid;
}
Expand Down Expand Up @@ -409,7 +406,7 @@ class _CheckoutState extends State<Checkout>
text: 'continue'.i18n,
// for Pro users renewing their accounts, we always have an e-mail address
// so it's unnecessary to disable the continue button
disabled: !widget.isPro ? !showContinueButton : false,
disabled: !enableContinueButton(),
atavism marked this conversation as resolved.
Show resolved Hide resolved
onPressed: onContinueTapped,
),
),
Expand Down
Loading