1d3ee69c6d
App Flutter de programme de fidélité : login staff, clients (nom/prénom), scan QR, factures (€→points), récompenses, réglages. Backend Supabase (schéma SQL + RLS anti-triche dans supabase/). Icône incluse. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
49 lines
1.3 KiB
Dart
49 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:intl/date_symbol_data_local.dart';
|
|
import 'package:supabase_flutter/supabase_flutter.dart';
|
|
|
|
import 'screens/auth_gate.dart';
|
|
import 'supabase_config.dart';
|
|
import 'theme.dart';
|
|
|
|
Future<void> main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
// Formatage des dates en français (« 2 juil. 2026 »).
|
|
await initializeDateFormatting('fr_FR', null);
|
|
|
|
// App verrouillée en portrait (tablette).
|
|
await SystemChrome.setPreferredOrientations([
|
|
DeviceOrientation.portraitUp,
|
|
DeviceOrientation.portraitDown,
|
|
]);
|
|
|
|
// Connexion au backend Supabase (partagé avec l'app client).
|
|
if (SupabaseConfig.estConfigure) {
|
|
await Supabase.initialize(
|
|
url: SupabaseConfig.url,
|
|
// Accepte la clé « anon public » (ou « publishable ») du projet.
|
|
publishableKey: SupabaseConfig.anonKey,
|
|
);
|
|
}
|
|
|
|
runApp(const MonApp());
|
|
}
|
|
|
|
class MonApp extends StatelessWidget {
|
|
const MonApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'Fidélité — Magasin',
|
|
debugShowCheckedModeBanner: false,
|
|
theme: AppTheme.clair(),
|
|
darkTheme: AppTheme.sombre(),
|
|
themeMode: ThemeMode.light,
|
|
home: const AuthGate(),
|
|
);
|
|
}
|
|
}
|