-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from SandroMaglione/1_environment_variables
Routing (`auto_route`) + Environmental variables
- Loading branch information
Showing
7 changed files
with
329 additions
and
6 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_supabase_complete/core/routes/app_router.dart'; | ||
|
||
/// Entry widget of the app | ||
class App extends StatelessWidget { | ||
const App({Key? key}) : super(key: key); | ||
App({Key? key}) : super(key: key); | ||
final _appRouter = AppRouter(); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const MaterialApp( | ||
title: 'Flutter Supabase Complete', | ||
home: Placeholder(), | ||
return MaterialApp.router( | ||
routerDelegate: _appRouter.delegate(), | ||
routeInformationParser: _appRouter.defaultRouteParser(), | ||
); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class HomePage extends StatelessWidget { | ||
const HomePage({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Scaffold( | ||
body: Placeholder(), | ||
); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/// Make sure to import `auto_route` and `material` (required) | ||
import 'package:auto_route/auto_route.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_supabase_complete/app/home_page.dart'; | ||
|
||
part 'app_router.gr.dart'; | ||
|
||
@MaterialAutoRouter( | ||
replaceInRouteName: 'Page,Route', | ||
routes: <AutoRoute>[ | ||
AutoRoute(page: HomePage, initial: true), | ||
], | ||
) | ||
class AppRouter extends _$AppRouter {} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,5 @@ Future<void> mainCommon() async { | |
anonKey: Constants.supabaseAnnonKey, | ||
); | ||
|
||
runApp(const App()); | ||
runApp(App()); | ||
} |
Oops, something went wrong.