74 lines
2.3 KiB
Dart
74 lines
2.3 KiB
Dart
import 'package:CCTV_App/auth_wrapper.dart';
|
|
import 'package:CCTV_App/provider.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
|
import 'package:intl/date_symbol_data_local.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'package:supabase_flutter/supabase_flutter.dart';
|
|
|
|
// =================================================================
|
|
// MAIN.DART & SETUP
|
|
// =================================================================
|
|
|
|
Future<void> main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
await dotenv.load(fileName: ".env");
|
|
|
|
await Supabase.initialize(
|
|
url: dotenv.env['SUPABASE_URL']!,
|
|
anonKey: dotenv.env['SUPABASE_ANON_KEY']!,
|
|
);
|
|
|
|
await initializeDateFormatting('id_ID', null);
|
|
|
|
runApp(
|
|
ChangeNotifierProvider(
|
|
create: (context) => AppState(),
|
|
child: const MyApp(),
|
|
),
|
|
);
|
|
}
|
|
|
|
final supabase = Supabase.instance.client;
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'Security Monitor',
|
|
theme: ThemeData(
|
|
brightness: Brightness.dark,
|
|
primaryColor: Colors.tealAccent,
|
|
scaffoldBackgroundColor: const Color(0xFF1a1a1a),
|
|
cardColor: const Color(0xFF2c2c2c),
|
|
colorScheme: const ColorScheme.dark(
|
|
primary: Colors.tealAccent,
|
|
secondary: Colors.teal,
|
|
surface: Color(0xFF2c2c2c),
|
|
onSurface: Colors.white,
|
|
error: Colors.redAccent,
|
|
),
|
|
textTheme: const TextTheme(
|
|
bodyLarge: TextStyle(color: Colors.white70),
|
|
bodyMedium: TextStyle(color: Colors.white70),
|
|
titleLarge:
|
|
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
|
|
titleMedium: TextStyle(color: Colors.white),
|
|
),
|
|
inputDecorationTheme: InputDecorationTheme(
|
|
filled: true,
|
|
fillColor: Colors.black.withOpacity(0.3),
|
|
border: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
borderSide: BorderSide.none),
|
|
labelStyle: const TextStyle(color: Colors.white54)),
|
|
useMaterial3: true,
|
|
),
|
|
home: const AuthWrapper(),
|
|
debugShowCheckedModeBanner: false,
|
|
);
|
|
}
|
|
}
|