Update: 2026-05-06 04:02:34
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../controllers/biometric_controller.dart';
|
||||
|
||||
class BiometricSetupView extends StatelessWidget {
|
||||
BiometricSetupView({super.key});
|
||||
|
||||
final BiometricController controller = Get.put(BiometricController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('حماية التطبيق')),
|
||||
body: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(Icons.fingerprint, size: 100, color: Color(0xFF0F4C81)),
|
||||
const SizedBox(height: 32),
|
||||
const Text(
|
||||
'تسجيل الدخول بالبصمة',
|
||||
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const Text(
|
||||
'لحماية بيانات فواتيرك ومعلوماتك الحساسة، نوصي بتفعيل الدخول باستخدام البصمة أو التعرف على الوجه.',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.grey, height: 1.5),
|
||||
),
|
||||
const SizedBox(height: 48),
|
||||
Obx(() {
|
||||
if (!controller.isBiometricAvailable.value) {
|
||||
return const Text('عذراً، ميزة البصمة غير متوفرة في جهازك.', style: TextStyle(color: Colors.red));
|
||||
}
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
ElevatedButton.icon(
|
||||
style: ElevatedButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
),
|
||||
icon: const Icon(Icons.fingerprint),
|
||||
label: controller.isAuthenticating.value
|
||||
? const CircularProgressIndicator(color: Colors.white)
|
||||
: const Text('تفعيل ومتابعة', style: TextStyle(fontSize: 18)),
|
||||
onPressed: controller.isAuthenticating.value
|
||||
? null
|
||||
: () => controller.authenticateAndGoToDashboard(),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextButton(
|
||||
onPressed: () => controller.skipBiometricSetup(),
|
||||
child: const Text('تخطي في الوقت الحالي', style: TextStyle(color: Colors.grey)),
|
||||
)
|
||||
],
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user