63 lines
1.6 KiB
Dart
63 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:intl/date_symbol_data_local.dart';
|
|
|
|
import 'screens/home_screen.dart';
|
|
import 'services/offline_store.dart';
|
|
import 'services/sync_service.dart';
|
|
import 'services/api_service.dart';
|
|
import 'services/security_service.dart';
|
|
import 'screens/app_lock_gate.dart';
|
|
|
|
Future<void> main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
await initializeDateFormatting('fr_FR', null);
|
|
|
|
ErrorWidget.builder = (FlutterErrorDetails details) {
|
|
return Material(
|
|
child: SafeArea(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(16),
|
|
child: SingleChildScrollView(
|
|
child: Text(
|
|
'Erreur FIN65 mobile :\n\n${details.exceptionAsString()}',
|
|
style: const TextStyle(fontSize: 14),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
};
|
|
|
|
runApp(const Fin65MobileApp());
|
|
}
|
|
|
|
class Fin65MobileApp extends StatelessWidget {
|
|
const Fin65MobileApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final store = OfflineStore.instance;
|
|
final apiService = ApiService(store: store);
|
|
final syncService = SyncService(
|
|
offlineStore: store,
|
|
apiService: apiService,
|
|
);
|
|
|
|
return MaterialApp(
|
|
title: 'FIN65',
|
|
debugShowCheckedModeBanner: false,
|
|
theme: ThemeData(
|
|
colorSchemeSeed: const Color(0xFF1F6FEB),
|
|
useMaterial3: true,
|
|
cardTheme: const CardThemeData(
|
|
margin: EdgeInsets.symmetric(vertical: 4),
|
|
),
|
|
),
|
|
home: AppLockGate(
|
|
securityService: SecurityService(store: store),
|
|
child: HomeScreen(syncService: syncService),
|
|
),
|
|
);
|
|
}
|
|
}
|