feat: add admin page
This commit is contained in:
@@ -5,13 +5,20 @@ import 'package:crypto/crypto.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
|
||||
class PinLockService {
|
||||
PinLockService({FlutterSecureStorage? storage})
|
||||
: _storage = storage ?? const FlutterSecureStorage();
|
||||
PinLockService({
|
||||
FlutterSecureStorage? storage,
|
||||
String saltKey = _defaultSaltKey,
|
||||
String hashKey = _defaultHashKey,
|
||||
}) : _storage = storage ?? const FlutterSecureStorage(),
|
||||
_saltKey = saltKey,
|
||||
_hashKey = hashKey;
|
||||
|
||||
static const _saltKey = 'pin_salt';
|
||||
static const _hashKey = 'pin_hash';
|
||||
static const _defaultSaltKey = 'pin_salt';
|
||||
static const _defaultHashKey = 'pin_hash';
|
||||
|
||||
final FlutterSecureStorage _storage;
|
||||
final String _saltKey;
|
||||
final String _hashKey;
|
||||
|
||||
Future<bool> hasPin() async {
|
||||
final hash = await _storage.read(key: _hashKey);
|
||||
|
||||
Reference in New Issue
Block a user