cofounderella/lib/main.dart

48 lines
1.3 KiB
Dart
Raw Normal View History

2024-05-15 13:35:01 +02:00
import '../constants.dart';
import '../services/auth/auth_gate.dart';
import '../themes/theme_provider.dart';
2024-04-29 14:36:25 +02:00
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:provider/provider.dart';
2024-04-29 14:36:25 +02:00
import 'firebase_options.dart';
2024-06-07 16:58:29 +02:00
import 'pages/conversations_page.dart';
import 'pages/liked_users_page.dart';
import 'pages/user_matching_page.dart';
import 'pages/user_profile_page.dart';
2024-04-29 14:36:25 +02:00
void main() async {
// Firebase stuff
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
// Standard stuff
runApp(
ChangeNotifierProvider(
create: (context) => ThemeProvider(),
child: const MyApp(),
),
);
2024-04-29 14:36:25 +02:00
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
2024-05-05 10:26:49 +02:00
title: Constants.appTitle,
theme: Provider.of<ThemeProvider>(context).themeData,
2024-04-29 14:36:25 +02:00
home: const AuthGate(),
2024-06-07 16:58:29 +02:00
routes: {
'/discover': (context) => const UserMatchingPage(),
'/favorites': (context) => const LikedUsersPage(),
'/chats': (context) => ConversationsPage(),
'/profile': (context) => const UserProfilePage(),
},
2024-04-29 14:36:25 +02:00
);
}
}