mirror of
https://github.com/supabase/supabase.git
synced 2026-10-11 20:35:07 +03:00
40 lines
1.0 KiB
Dart
40 lines
1.0 KiB
Dart
import 'package:flutter/foundation.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'configure_nonweb.dart' if (dart.library.html) 'configure_web.dart';
|
|
import 'screens/profile_screen.dart';
|
|
import 'screens/signin_screen.dart';
|
|
import 'screens/splash_screen.dart';
|
|
import 'screens/web_home_screen.dart';
|
|
|
|
void main() {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
configureApp();
|
|
runApp(MyApp());
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
// This widget is the root of your application.
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'Supabase Demo',
|
|
theme: ThemeData.dark(),
|
|
initialRoute: '/',
|
|
routes: <String, WidgetBuilder>{
|
|
'/signIn': (_) => SignInScreen(),
|
|
'/profile': (_) => ProfileScreen(),
|
|
},
|
|
onGenerateRoute: generateRoute,
|
|
);
|
|
}
|
|
}
|
|
|
|
Route<dynamic> generateRoute(RouteSettings settings) {
|
|
switch (settings.name) {
|
|
default:
|
|
return MaterialPageRoute(
|
|
builder: (_) => kIsWeb ? WebHomeScreen() : SplashScreen());
|
|
}
|
|
}
|