32 lines
829 B
Dart
32 lines
829 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:supabase_flutter/supabase_flutter.dart';
|
|
import 'login/login_screen.dart';
|
|
import 'Screens/home_screen.dart';
|
|
import 'supabase_config.dart';
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
await SupabaseConfig.initialize();
|
|
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final session = Supabase.instance.client.auth.currentSession;
|
|
return MaterialApp(
|
|
title: 'DayMaker',
|
|
theme: ThemeData(
|
|
colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF0066CC)),
|
|
useMaterial3: true,
|
|
),
|
|
home: session != null ? const HomeScreen() : const LoginScreen(),
|
|
debugShowCheckedModeBanner: false,
|
|
);
|
|
}
|
|
}
|