first commit
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'services/database_service.dart';
|
||||
import 'services/gps_service.dart';
|
||||
import 'services/sync_service.dart';
|
||||
import 'services/analytics_service.dart';
|
||||
import 'controllers/workout_controller.dart';
|
||||
import 'screens/home_screen.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
// 1. تهيئة الخدمات (Services Initialization)
|
||||
// بالترتيب: قاعدة البيانات -> الـ GPS -> المزامنة -> التحليل
|
||||
await Get.putAsync(
|
||||
() => DatabaseService().onInit().then((_) => DatabaseService()));
|
||||
Get.put(GpsService());
|
||||
await Get.putAsync(() => SyncService().onInit().then((_) => SyncService()));
|
||||
Get.put(AnalyticsService());
|
||||
|
||||
// 2. تهيئة المتحكمات (Controllers)
|
||||
Get.put(WorkoutController());
|
||||
|
||||
runApp(const SportPathApp());
|
||||
}
|
||||
|
||||
class SportPathApp extends StatelessWidget {
|
||||
const SportPathApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetMaterialApp(
|
||||
title: 'SportPath Tracker',
|
||||
debugShowCheckedModeBanner: false,
|
||||
locale: const Locale('ar', 'SA'), // دعم اللغة العربية افتراضياً
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
fontFamily: 'Inter', // التأكد من وجود الخط في pubspec
|
||||
colorScheme: ColorScheme.fromSeed(
|
||||
seedColor: const Color(0xFFFF5722), // اللون البرتقالي الأساسي
|
||||
primary: const Color(0xFFFF5722),
|
||||
secondary: const Color(0xFF263238),
|
||||
brightness: Brightness.dark, // وضع ليلي متميز
|
||||
),
|
||||
scaffoldBackgroundColor: const Color(0xFF121212),
|
||||
cardTheme: CardThemeData(
|
||||
color: const Color(0xFF1E1E1E),
|
||||
elevation: 0,
|
||||
shape:
|
||||
RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
||||
),
|
||||
),
|
||||
home: const HomeScreen(),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user