40 lines
1.0 KiB
Dart
40 lines
1.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'core/api/api_config.dart';
|
|
import 'core/router/app_router.dart';
|
|
import 'core/storage/secure_storage.dart';
|
|
import 'core/theme/app_theme.dart';
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
// Load custom API Base URL if previously configured in Settings
|
|
final storage = SecureStorage();
|
|
final customUrl = await storage.getCustomBaseUrl();
|
|
if (customUrl != null && customUrl.isNotEmpty) {
|
|
ApiConfig.customBaseUrl = customUrl;
|
|
}
|
|
|
|
runApp(
|
|
const ProviderScope(
|
|
child: MetatronStudentApp(),
|
|
),
|
|
);
|
|
}
|
|
|
|
class MetatronStudentApp extends ConsumerWidget {
|
|
const MetatronStudentApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
final router = ref.watch(appRouterProvider);
|
|
|
|
return MaterialApp.router(
|
|
title: 'Metatron Student ERP',
|
|
debugShowCheckedModeBanner: false,
|
|
theme: AppTheme.lightTheme,
|
|
routerConfig: router,
|
|
);
|
|
}
|
|
}
|