import 'package:flutter/material.dart'; import 'package:pharmacy_mobile/pages/index_page.dart'; import 'package:pharmacy_mobile/pages/login_page.dart'; import 'package:go_router/go_router.dart'; import 'package:supabase_flutter/supabase_flutter.dart'; // void main() { // runApp(const MyApp()); // } Future main() async { await Supabase.initialize( url: 'https://lijihnvjlucyvxfhghqd.supabase.co', anonKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImxpamlobnZqbHVjeXZ4ZmhnaHFkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MjQ1NjEyODYsImV4cCI6MjA0MDEzNzI4Nn0.N3_FLKm02OdprL9m3P0CzuV8kdbCrrJKaVdtgVR3PSk', ); runApp(MyApp()); } final supabase = Supabase.instance.client; final _router = GoRouter( initialLocation: '/', routes: [ GoRoute( name: 'index', // Optional, add name to your routes. Allows you navigate by name instead of path path: '/', builder: (context, state) => IndexPage(), ), GoRoute( name: 'login', path: '/login', builder: (context, state) => LoginPage(), ), ], ); class MyApp extends StatelessWidget { const MyApp({super.key}); // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp.router( // initialRoute: '/', // routes: { // '/': (context) => const IndexPage(), // '/login': (context) => const LoginPage(), // }, // debugShowCheckedModeBanner: false, // theme: ThemeData( // colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), // useMaterial3: true, // ) routerConfig: _router, ); } }