feat: N1d/N2/N3 + قانون فلاتر وإعادة ضبط تطبيق السائق
الباك إند: - تعيين أول أدمن صار يُنشئ المستخدم إن لم يوجد — كان يشترط دخولاً سابقاً، وهي بيضة ودجاجة تمنع الدخول إلى لوحة أي مستأجر جديد أصلاً. - OTP_DEV_MODE كان يفشل مفتوحاً (`!== 'false'`): غياب المتغيّر أو خطأ مطبعي يترك الإنتاج برمز ثابت يفتح كل حساب، ويحرس السحب المالي كذلك. صار `=== 'true'` في الإعداد وفي قارئَيه، مع تحذير عند الإقلاع. - N2: التحقّق من اللوغو عند الرفع (PNG/JPEG · 512+ · مربّع · سقف 5MB) عبر قراءة الترويسة بلا اعتمادية — بدل اكتشاف أيقونة ممطوطة بعد النشر. N3: السكربت يولّد build_config.dart بأعلام const (طبقات docs/22 §1.5)، ويضبط bundle IDs واسم التطبيق والأيقونات/splash، و--build يشغّل Shorebird. فلاتر: - docs/23: قانون مُلزِم للتطبيقين (البنية · Cubit · طبقة الشبكة · الأعلام). - السائق: أُزيل Dart القديم (GetX) مع الإبقاء على الأصيل والإضافات وشهادات التوقيع وShorebird وFirebase الخاص به، وأُعيد هيكلته مطابقاً للراكب. - طبقة الشبكة ترسل x-device-id وتجدّد التوكن عند 401 مرة واحدة فقط. - الحزم موحّدة بين التطبيقين، والـAPI https حصراً في الاثنين. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
3ab74a13a8
commit
de4bbd00ac
@@ -1,39 +0,0 @@
|
||||
import 'package:battery_plus/battery_plus.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class BatteryNotifier {
|
||||
static final Battery _battery = Battery();
|
||||
static int? _lastNotifiedLevel;
|
||||
|
||||
static Future<void> checkBatteryAndNotify() async {
|
||||
try {
|
||||
final int batteryLevel = await _battery.batteryLevel;
|
||||
|
||||
// ✅ لا تكرر الإشعار إذا الفرق قليل
|
||||
if (_lastNotifiedLevel != null &&
|
||||
(batteryLevel >= _lastNotifiedLevel! - 2)) return;
|
||||
|
||||
if (batteryLevel <= 30) {
|
||||
Color backgroundColor = Colors.yellow;
|
||||
if (batteryLevel <= 20) {
|
||||
backgroundColor = Colors.red;
|
||||
}
|
||||
|
||||
Get.snackbar(
|
||||
"⚠️ تنبيه البطارية", // العنوان
|
||||
"مستوى البطارية: $batteryLevel٪", // النص
|
||||
snackPosition: SnackPosition.TOP,
|
||||
backgroundColor: backgroundColor,
|
||||
colorText: Colors.white,
|
||||
duration: const Duration(seconds: 10), // مدة الظهور
|
||||
margin: const EdgeInsets.all(10),
|
||||
);
|
||||
|
||||
_lastNotifiedLevel = batteryLevel;
|
||||
}
|
||||
} catch (e) {
|
||||
print('Battery check error: $e');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user