Fix fingerprint toggle: fallback to device credentials, clearer error messages
This commit is contained in:
@@ -64,13 +64,14 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
|
||||
Future<void> _toggleBiometric(bool value) async {
|
||||
if (value && !_biometricAvailable) {
|
||||
setState(() => _msg = 'Perangkat tidak mendukung sidik jari');
|
||||
setState(() => _msg = 'Perangkat tidak mendukung biometrik');
|
||||
return;
|
||||
}
|
||||
if (value) {
|
||||
final ok = await widget.auth.authenticateWithBiometrics();
|
||||
String? err;
|
||||
final ok = await widget.auth.authenticateWithBiometrics(errorOut: err);
|
||||
if (!ok) {
|
||||
setState(() => _msg = 'Verifikasi sidik jari gagal');
|
||||
setState(() => _msg = 'Verifikasi biometrik gagal: ${err ?? "dibatalkan"}');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user