Skip to content

Instantly share code, notes, and snippets.

@fabiojansenbr
Created June 14, 2021 16:37
Show Gist options
  • Save fabiojansenbr/499ec293022264d58b5c1f2d0f8bd6c5 to your computer and use it in GitHub Desktop.
Save fabiojansenbr/499ec293022264d58b5c1f2d0f8bd6c5 to your computer and use it in GitHub Desktop.
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