mirror of
https://github.com/koloideal/Casha.git
synced 2026-06-10 10:25:28 +03:00
update
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import '../../core/services/biometric_service.dart';
|
||||
|
||||
class SplashScreen extends StatefulWidget {
|
||||
const SplashScreen({super.key});
|
||||
@@ -28,9 +30,17 @@ class _SplashScreenState extends State<SplashScreen> with SingleTickerProviderSt
|
||||
|
||||
_controller.forward();
|
||||
|
||||
_controller.addStatusListener((status) {
|
||||
_controller.addStatusListener((status) async {
|
||||
if (status == AnimationStatus.completed) {
|
||||
if (mounted) {
|
||||
final isEnabled = await BiometricService.isEnabled();
|
||||
if (isEnabled) {
|
||||
final authenticated = await BiometricService.authenticate();
|
||||
if (!authenticated) {
|
||||
SystemNavigator.pop();
|
||||
return;
|
||||
}
|
||||
}
|
||||
context.go('/dashboard');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user