153 lines
4.9 KiB
Dart
153 lines
4.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'core/theme/app_theme.dart';
|
|
import 'features/auth/cubit/auth_cubit.dart';
|
|
import 'features/auth/cubit/auth_state.dart';
|
|
import 'features/auth/presentation/phone_auth_screen.dart';
|
|
import 'features/membership/cubit/membership_cubit.dart';
|
|
import 'features/membership/presentation/digital_card_screen.dart';
|
|
import 'features/partners/cubit/partners_cubit.dart';
|
|
import 'features/partners/presentation/partners_directory_screen.dart';
|
|
|
|
void main() {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
runApp(const UrukPrizeApp());
|
|
}
|
|
|
|
class UrukPrizeApp extends StatelessWidget {
|
|
const UrukPrizeApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MultiBlocProvider(
|
|
providers: [
|
|
BlocProvider<AuthCubit>(
|
|
create: (context) => AuthCubit()..checkExistingSession(),
|
|
),
|
|
BlocProvider<MembershipCubit>(
|
|
create: (context) => MembershipCubit(),
|
|
),
|
|
BlocProvider<PartnersCubit>(
|
|
create: (context) => PartnersCubit(),
|
|
),
|
|
],
|
|
child: MaterialApp(
|
|
title: 'جائزة أوروك الدولية',
|
|
debugShowCheckedModeBanner: false,
|
|
theme: AppTheme.darkTheme,
|
|
home: const AppRootGate(),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class AppRootGate extends StatelessWidget {
|
|
const AppRootGate({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return BlocBuilder<AuthCubit, AuthState>(
|
|
builder: (context, state) {
|
|
if (state is Authenticated) {
|
|
return const MainNavigationShell();
|
|
}
|
|
|
|
if (state is AuthLoading || state is AuthOtpSent) {
|
|
return const PhoneAuthScreen();
|
|
}
|
|
|
|
return const PhoneAuthScreen();
|
|
},
|
|
);
|
|
}
|
|
}
|
|
|
|
class MainNavigationShell extends StatefulWidget {
|
|
const MainNavigationShell({super.key});
|
|
|
|
@override
|
|
State<MainNavigationShell> createState() => _MainNavigationShellState();
|
|
}
|
|
|
|
class _MainNavigationShellState extends State<MainNavigationShell> {
|
|
int _currentIndex = 0;
|
|
|
|
final _screens = const [
|
|
DigitalCardScreen(),
|
|
PartnersDirectoryScreen(),
|
|
_PlaceholderCoursesScreen(),
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Directionality(
|
|
textDirection: TextDirection.rtl,
|
|
child: Scaffold(
|
|
body: IndexedStack(
|
|
index: _currentIndex,
|
|
children: _screens,
|
|
),
|
|
bottomNavigationBar: NavigationBar(
|
|
selectedIndex: _currentIndex,
|
|
backgroundColor: AppTheme.primaryDark,
|
|
indicatorColor: AppTheme.goldAccent.withOpacity(0.2),
|
|
onDestinationSelected: (idx) => setState(() => _currentIndex = idx),
|
|
destinations: const [
|
|
NavigationDestination(
|
|
icon: Icon(Icons.badge_outlined, color: AppTheme.textMuted),
|
|
selectedIcon: Icon(Icons.badge, color: AppTheme.goldAccent),
|
|
label: 'الهوية الرقمية',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.medical_services_outlined, color: AppTheme.textMuted),
|
|
selectedIcon: Icon(Icons.medical_services, color: AppTheme.goldAccent),
|
|
label: 'دليل الخصومات',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.school_outlined, color: AppTheme.textMuted),
|
|
selectedIcon: Icon(Icons.school, color: AppTheme.goldAccent),
|
|
label: 'الأكاديمية',
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _PlaceholderCoursesScreen extends StatelessWidget {
|
|
const _PlaceholderCoursesScreen();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Directionality(
|
|
textDirection: TextDirection.rtl,
|
|
child: Scaffold(
|
|
appBar: AppBar(title: const Text('أكاديمية أوروك (30 تخصصاً)')),
|
|
body: Center(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(24),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
const Icon(Icons.school, color: AppTheme.goldAccent, size: 70),
|
|
const SizedBox(height: 16),
|
|
const Text(
|
|
'أكثر من 30 تخصصاً تدريبياً معتمداً',
|
|
style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.bold),
|
|
),
|
|
const SizedBox(height: 8),
|
|
const Text(
|
|
'تبدأ الدورات حضورياً في قاعات الفنادق الشريكة وأونلاين عبر منصة البث المباشر لأوروك مع بداية تفعيل العضوية في 1/1 مع شهادات معتمدة رسمياً.',
|
|
textAlign: TextAlign.center,
|
|
style: TextStyle(color: AppTheme.textMuted, fontSize: 13),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|