SimformSolutionsPvtLtd / flutter_credit_card

A credit card widget for Flutter application.
https://pub.dev/packages/flutter_credit_card
MIT License
418 stars 241 forks source link

Exception when closing the page with the CreditCardWidget (Bad state: Cannot add new events after calling close) #157

Closed orangeyong closed 7 months ago

orangeyong commented 9 months ago

When pop/closing the page with the CreditCardWidget, my Crashlytics is able to catch this error.

flutter: Bad state: Cannot add new events after calling close flutter:

0 _BroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:243:24)

1 _CreditCardWidgetState._processFloatingEvent (package:flutter_credit_card/src/credit_card_widget.dart:366:24)

2 _rootRunUnary (dart:async/zone.dart:1407:47)

To Reproduce Steps to reproduce the behavior:

  1. Go to the page with CreditCardWidget
  2. Pop the page with the widget
  3. See error

Expected behavior close the stream properly on dispose, maybe we need a controller to call for inside dispose?