mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 06:25:15 +00:00
chore: Follow up app lock
This commit is contained in:
parent
48a278b0ea
commit
c7ea797f34
1 changed files with 5 additions and 2 deletions
|
@ -24,12 +24,15 @@ class AppLockWidget extends StatefulWidget {
|
|||
class AppLock extends State<AppLockWidget> with WidgetsBindingObserver {
|
||||
String? _pincode;
|
||||
bool _isLocked = false;
|
||||
bool get isActive => _pincode != null;
|
||||
bool get isActive =>
|
||||
_pincode != null &&
|
||||
int.tryParse(_pincode!) != null &&
|
||||
_pincode!.length == 4;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_pincode = widget.pincode;
|
||||
_isLocked = widget.pincode != null;
|
||||
_isLocked = isActive;
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue