76 lines
2.6 KiB
Dart
76 lines
2.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:android_intent_plus/android_intent.dart'; // استيراد المكتبة
|
|
import 'package:android_intent_plus/flag.dart'; // لاستخدام الـ Flags إذا لزم
|
|
|
|
void main() {
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
//
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
debugShowCheckedModeBanner: false,
|
|
home: Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text("ShamCash Robot 🤖"),
|
|
backgroundColor: Colors.teal,
|
|
),
|
|
body: Center(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(20.0),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
const Icon(
|
|
Icons.accessibility_new,
|
|
size: 80,
|
|
color: Colors.teal,
|
|
),
|
|
const SizedBox(height: 20),
|
|
const Text(
|
|
"تفعيل الخدمة ضروري لعمل البوت",
|
|
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
|
textAlign: TextAlign.center,
|
|
),
|
|
const SizedBox(height: 10),
|
|
const Text(
|
|
"اضغط الزر أدناه، ثم ابحث عن 'Sham Robot' وقم بتفعيله.",
|
|
textAlign: TextAlign.center,
|
|
style: TextStyle(color: Colors.grey),
|
|
),
|
|
const SizedBox(height: 30),
|
|
ElevatedButton.icon(
|
|
style: ElevatedButton.styleFrom(
|
|
padding: const EdgeInsets.symmetric(
|
|
horizontal: 30,
|
|
vertical: 15,
|
|
),
|
|
backgroundColor: Colors.teal,
|
|
),
|
|
onPressed: () async {
|
|
// ✅ هذا هو الكود الذي كان ناقصاً
|
|
const intent = AndroidIntent(
|
|
action: 'android.settings.ACCESSIBILITY_SETTINGS',
|
|
flags: <int>[Flag.FLAG_ACTIVITY_NEW_TASK],
|
|
);
|
|
await intent.launch();
|
|
},
|
|
icon: const Icon(Icons.settings, color: Colors.white),
|
|
label: const Text(
|
|
"فتح إعدادات الوصول",
|
|
style: TextStyle(color: Colors.white, fontSize: 16),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|