38 lines
1.0 KiB
Dart
38 lines
1.0 KiB
Dart
// lib/main.dart
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
|
import 'package:supabase_flutter/supabase_flutter.dart';
|
|
|
|
import 'screens/splash_screen.dart';
|
|
|
|
Future<void> main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
// Load variables from .env (added as asset in pubspec.yaml)
|
|
await dotenv.load(fileName: '.env');
|
|
|
|
final supabaseUrl = dotenv.env['SUPABASE_URL'];
|
|
final supabaseAnonKey = dotenv.env['SUPABASE_ANON_KEY'];
|
|
|
|
assert(supabaseUrl != null && supabaseAnonKey != null);
|
|
|
|
// Initialise Supabase with the values from .env
|
|
await Supabase.initialize(url: supabaseUrl!, anonKey: supabaseAnonKey!);
|
|
|
|
// Launch the app
|
|
runApp(const ComplyCoreApp());
|
|
}
|
|
|
|
class ComplyCoreApp extends StatelessWidget {
|
|
const ComplyCoreApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'ComplyCore',
|
|
theme: ThemeData(useMaterial3: true, primarySwatch: Colors.blue),
|
|
home: const SplashScreen(),
|
|
);
|
|
}
|
|
}
|