-
-
Save fabiojansenbr/499ec293022264d58b5c1f2d0f8bd6c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
title="main.dart" | |
import 'package:flutter/material.dart'; | |
import 'package:get_it/get_it.dart'; | |
import 'package:supabase/supabase.dart'; | |
import 'package:supabase_flutter/views/home_view.dart'; | |
import 'package:supabase_flutter/views/login_view.dart'; | |
import 'package:supabase_flutter/views/register_view.dart'; | |
import 'package:supabase_flutter/views/splash_view.dart'; | |
void main() { | |
GetIt locator = GetIt.instance; | |
locator.registerSingleton<SupabaseClient>(SupabaseClient( | |
'SUPABASE_URL', | |
'SUPABASE_ANON_KEY')); | |
runApp( | |
MyApp(), | |
); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Material App', | |
debugShowCheckedModeBanner: false, | |
initialRoute: '/', | |
routes: { | |
'/': (_) => const SplashView(), | |
'/login': (_) => const LoginView(), | |
'/register': (_) => const RegisterView(), | |
'/home': (_) => const HomeView(), | |
}, | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment