flutter-otp-autofill icon indicating copy to clipboard operation
flutter-otp-autofill copied to clipboard

[BUG] Unhandled Exception on iOS if no additional strategies are provided

Open khoadng opened this issue 3 months ago • 0 comments

Expected behavior

Should handle empty strategies

Actual behavior

Throwing exception

Logs and stacktrace

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: On iOS OTP autofill is built in TextField. Code from sms stores for 3 minutes.(see Readme)
#0      OTPInteractor.startListenRetriever (package:otp_autofill/src/otp_interactor.dart:89:7)
#1      OTPTextEditController.startListenRetriever (package:otp_autofill/src/otp_text_edit_controller.dart:110:37)
#2     <REDACTED>
#3      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:5602:55)
#4      ComponentElement.mount (package:flutter/src/widgets/framework.dart:5447:5)
#5      Element.inflateWidget (package:flutter/src/widgets/framework.dart:4326:16)
#6      Element.updateChild (package:flutter/src/widgets/framework.dart:3837:18)
#7      SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6736:14)
#8      Element.inflateWidget (package:flutter/src/widgets/framework.dart:4326:16)
#9      Element.updateC<…>
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Exception: Unexpected error: Bad state: No element
#0      OTPTextEditController.startListenRetriever.<anonymous closure> (package:otp_autofill/src/otp_text_edit_controller.dart:136:11)
#1      _FutureListener.handleError (dart:async/future_impl.dart:180:22)
#2      Future._propagateToListeners.handleError (dart:async/future_impl.dart:858:47)
#3      Future._propagateToListeners (dart:async/future_impl.dart:879:13)
#4      Future._completeError (dart:async/future_impl.dart:655:5)
#5      _completeWithErrorCallback (dart:async/future.dart:1334:10)
#6      Stream.first.<anonymous closure> (dart:async/stream.dart:1585:9)
#7      _RootZone.runGuarded (dart:async/zone.dart:1582:10)
#8      _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:392:13)
#9      _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402:7)
#10     _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
#<…>

khoadng avatar Mar 13 '24 06:03 khoadng