Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit e74111b

Browse files
committed
Fix _checkInitialLockStatus is called twice
1 parent 2bb3c6d commit e74111b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/src/presentation/authenticator_widget.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,17 @@ class _AuthenticatorWidgetState extends State<AuthenticatorWidget> {
7070
late final StreamSubscription lockSubscription;
7171
OverlayEntry? overlayEntry;
7272
bool _isShowingSplashScreen = true;
73+
late final Stream<LockState> lockState ;
7374

7475
@override
7576
void initState() {
7677
super.initState();
78+
lockState = widget.authenticator.lockState;
7779
PinLock.setHideAppContent(
7880
preference: widget.hideAppContent,
7981
iosAssetImage: widget.iosImageAsset,
8082
);
81-
lockSubscription = widget.authenticator.lockState.listen((event) {
83+
lockSubscription = lockState.listen((event) {
8284
if (event is Unlocked) {
8385
overlayEntry?.remove();
8486
overlayEntry = null;
@@ -120,7 +122,7 @@ class _AuthenticatorWidgetState extends State<AuthenticatorWidget> {
120122
@override
121123
Widget build(BuildContext context) {
122124
return StreamBuilder<LockState>(
123-
stream: widget.authenticator.lockState,
125+
stream: lockState,
124126
builder: (context, snapshot) {
125127
if (snapshot.hasData && !_isShowingSplashScreen) {
126128
return widget.child;

0 commit comments

Comments
 (0)