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

CardField Not Initializing Correctly Using dangerouslyUpdateFullCardDetails #1928

Open
mixinDennisBarzanoffMixin opened this issue Sep 17, 2024 · 8 comments
Labels
needs triage Needs triage

Comments

@mixinDennisBarzanoffMixin
Copy link

mixinDennisBarzanoffMixin commented Sep 17, 2024

Describe the bug
When you initialize the card controller with a card number like so:

final cardController = useMemoized(
  () => CardEditController(
    initialDetails: CardFieldInputDetails(
      number: initialCardNumber,
      complete: false,
      validNumber: CardValidationState.Valid,
    ),
  ),
  [initialCardNumber],
);

where initialCardNumber is a full real card number that I got from scanning the card before that

CardField(
    dangerouslyGetFullCardDetails: true,
    dangerouslyUpdateFullCardDetails: true,
    style: context.headlineSmall,
    controller: cardController,
    onCardChanged: (card) async {
      if (card != null && card.complete) {
        final error = await onAddCard(card);
        if (error != null) {
          state.didChange(error);
        }
      }
    },
  ).padding(top: 16, bottom: 8),
),

To Reproduce
Steps to reproduce the behavior:

  1. Initialise with a full number like 4242 4242 4242 4242
  2. On Android it fills it in correctly, but then does not allow to transition to type in the date, just stays filled in, you have to delete a number and retype it to continue
  3. On iOS it doesn't even fill anything in.

Expected behavior

  1. The field should contain the number
  2. The field should transition to ask for the date and CVV

Smartphone / tablet

  • Device: Pixel 7
  • OS: Android 14
  • Package version: v11.0.0
  • Flutter version v3.22.0

Smartphone / tablet

  • Device: iPhone 8
  • OS: Android 16.6
  • Package version: v11.0.0
  • Flutter version v3.22.0

Additional context

Screen.Recording.2024-09-17.at.19.38.39.mov

It might seem that the reason is the smaller width of the phone, that is not true, it is reproduceable on larger phones as well and you can also see the date field a bit on the right, but it does not come to the left

@jonasbark I know you are busy, but we are relying on this library, would an estimate or a priority be possible for this issue?

@jonasbark
Copy link
Member

I assume on Android what you want is to auto-focus the date field when the card number is already pre-filled?

jonasbark added a commit that referenced this issue Sep 28, 2024
@mixinDennisBarzanoffMixin
Copy link
Author

yes correct

@mixinDennisBarzanoffMixin
Copy link
Author

Thanks for fixing iOS. I donated $20
Screenshot 2024-09-30 at 09 43 55

remonh87 pushed a commit that referenced this issue Oct 1, 2024
…S fix (#1942)

* Fix border radius handling, see #1933

* throw warning when incompatible com.android.application plugin is used

see #1909

* throw warning when incompatible com.android.application plugin is used

see #1909

* remove unnecessary println

* Fix iOS issue from #1928
@mixinDennisBarzanoffMixin
Copy link
Author

I'll retest this now that I see the new v11.1.0 release

@mixinDennisBarzanoffMixin
Copy link
Author

mixinDennisBarzanoffMixin commented Oct 8, 2024

I'll retest this now that I see the new v11.1.0 release

Still not appearing on iOS, on iOS it just advances to the date, not filling it in, and still not advancing on Android, I tested this commit: dac2181eb0bfc2b9ec5025237253e621c05b4cc5, which is latest main.

@jonasbark
Copy link
Member

it's not published yet, so you'll have to do a dependency override, similar to

dependency_override:
   stripe_ios: 
      git: ...

@mixinDennisBarzanoffMixin
Copy link
Author

Screenshot 2024-10-09 at 11 59 44

Got resolved to:

  stripe_android:
    dependency: "direct overridden"
    description:
      name: stripe_android
      sha256: a8faacd135084a39b379331b1c472f53f8e0559a1c78a35a87293a28a8c46a78
      url: "https://pub.dev"
    source: hosted
    version: "11.2.0"
  stripe_ios:
    dependency: "direct overridden"
    description:
      name: stripe_ios
      sha256: "87444df75265c5e5056c1043a68a27945eb10f9909ea532da8d4d894bedf0c51"
      url: "https://pub.dev"
    source: hosted
    version: "11.2.0"
Screen.Recording.2024-10-09.at.13.12.24.mov

There is a change, on iOS now it appears, but still on both it does not move forward and is confusing for users

@jonasbark
Copy link
Member

Yes, I have not fixed this one yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Needs triage
Projects
None yet
Development

No branches or pull requests

2 participants