Files
dailyou/lib/core/biometrics/biometric_service.dart
T
stefwill 78aa032c1b feat: implement settings screen with reminders, biometrics, theme, and PDF export
- Daily reminder scheduling via flutter_local_notifications (inexact, repeating at chosen time)
- Biometric lock gate on app launch with auto-prompt and manual unlock button
- Theme mode selector (System/Light/Dark) persisted to settings DB
- PDF export of full mood history shared via share_plus
- Android: POST_NOTIFICATIONS, USE_BIOMETRIC permissions; switched to FlutterFragmentActivity
2026-04-26 15:49:52 +10:00

24 lines
498 B
Dart

import 'package:local_auth/local_auth.dart';
class BiometricService {
static final _auth = LocalAuthentication();
static Future<bool> isAvailable() async {
try {
return await _auth.canCheckBiometrics || await _auth.isDeviceSupported();
} catch (_) {
return false;
}
}
static Future<bool> authenticate() async {
try {
return await _auth.authenticate(
localizedReason: 'Unlock DailyYou',
);
} catch (_) {
return false;
}
}
}