Skip to content

Commit

Permalink
Use a more streamlined pipeline for the result stream
Browse files Browse the repository at this point in the history
  • Loading branch information
JlUgia committed Oct 10, 2024
1 parent 8c54031 commit 55d340c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pay/lib/src/widgets/google_pay_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ class _GooglePayButtonState extends _PayButtonState {
void _startListeningForPaymentResults() {
_paymentResultSubscription = eventChannel
.receiveBroadcastStream()
.map((result) => jsonDecode(result as String) as Map<String, dynamic>)
.cast<String>()
.map(jsonDecode)
.cast<Map<String, dynamic>>()
.listen(widget._deliverPaymentResult, onError: widget._deliverError);
}

Expand Down

0 comments on commit 55d340c

Please sign in to comment.