Skip to content
Open
Changes from all commits
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
4 changes: 1 addition & 3 deletions packages/stripe/lib/src/widgets/card_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,7 @@ class _MethodChannelCardFieldState extends State<_MethodChannelCardField>
void _handleCardChanged(dynamic arguments) {
try {
final map = Map<String, dynamic>.from(arguments);
final update = CardFieldInputDetails.fromJson(
Map<String, dynamic>.from(map['card']),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this nesting is still necesarry tested it with latest sdk on android

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the map doesn't have the 'card' value, it creates an exception and crashes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the UI works for you?.
We had to fork the package in PROD as it was throwing an eception

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested both android and ios and for the ui works. Can you give me some more details of the version of the package that you are using?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I've been very busy, I'll send a demo ASAP.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

card is not a valid value in the map

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

It keeps the pay button in grey button as the issue throws the exception

);
final update = CardFieldInputDetails.fromJson(map);
updateCardDetails(update, controller);
widget.onCardChanged?.call(update);
// ignore: avoid_catches_without_on_clauses
Expand Down