This commit is contained in:
Patrick Alvin Alcala 2025-01-23 12:24:08 +08:00
parent b6b7ab6e84
commit 3e6781a0bd
5 changed files with 17 additions and 6 deletions

6
.fvmrc Normal file
View file

@ -0,0 +1,6 @@
{
"flutter": "3.27.3",
"runPubGetOnSdkChanges": true,
"updateVscodeSettings": true,
"updateGitIgnore": true
}

3
.gitignore vendored
View file

@ -43,3 +43,6 @@ app.*.map.json
/android/app/debug /android/app/debug
/android/app/profile /android/app/profile
/android/app/release /android/app/release
# FVM Version Cache
.fvm/

3
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"dart.flutterSdkPath": ".fvm/versions/3.27.3"
}

View file

@ -1,6 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pharmacy_mobile/auth/auth_gate.dart'; // import 'package:pharmacy_mobile/auth/auth_gate.dart';
// import 'package:pharmacy_mobile/pages/index_page.dart'; import 'package:pharmacy_mobile/pages/index_page.dart';
import 'package:pharmacy_mobile/pages/login_page.dart'; import 'package:pharmacy_mobile/pages/login_page.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:pharmacy_mobile/pages/main_page.dart'; import 'package:pharmacy_mobile/pages/main_page.dart';
@ -26,15 +26,13 @@ Future<void> main() async {
runApp(MyApp()); runApp(MyApp());
} }
final supabase = Supabase.instance.client;
final _router = GoRouter( final _router = GoRouter(
initialLocation: '/', initialLocation: '/',
routes: [ routes: [
GoRoute( GoRoute(
name: 'index', // Optional, add name to your routes. Allows you navigate by name instead of path name: 'index', // Optional, add name to your routes. Allows you navigate by name instead of path
path: '/', path: '/',
builder: (context, state) => AuthGate(), builder: (context, state) => IndexPage(),
), ),
GoRoute( GoRoute(
name: 'login', name: 'login',
@ -61,6 +59,7 @@ class MyApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp.router( return MaterialApp.router(
debugShowCheckedModeBanner: false,
// initialRoute: '/', // initialRoute: '/',
// routes: { // routes: {
// '/': (context) => const IndexPage(), // '/': (context) => const IndexPage(),

View file

@ -54,7 +54,7 @@ class MainPage extends StatelessWidget {
const Gap(16), const Gap(16),
MenuWidget( MenuWidget(
icon: FontAwesomeIcons.squarePlus, icon: FontAwesomeIcons.squarePlus,
text: 'Add Medicine', text: 'Add Generics',
), ),
TextButton(onPressed: () => {signOut()}, child: const Text('Logout')) TextButton(onPressed: () => {signOut()}, child: const Text('Logout'))
], ],