66 lines
1.8 KiB
Dart
66 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:supabase_flutter/supabase_flutter.dart';
|
|
import 'core/config/supabase_config.dart';
|
|
import 'core/theme/app_theme.dart';
|
|
import 'features/recycling_guide/presentation/screens/recycling_guide_screen.dart';
|
|
import 'features/routes/presentation/screens/routes_home_screen.dart';
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
await Supabase.initialize(
|
|
url: SUPABASE_URL,
|
|
anonKey: SUPABASE_ANON_KEY,
|
|
);
|
|
|
|
runApp(const ProviderScope(child: MyApp()));
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'Basura App - Notificación de Residuos',
|
|
theme: AppTheme.lightTheme,
|
|
home: const HomePage(),
|
|
routes: {
|
|
'/guia': (context) => const RecyclingGuideScreen(),
|
|
'/rutas': (context) => const RoutesHomeScreen(),
|
|
},
|
|
);
|
|
}
|
|
}
|
|
|
|
class HomePage extends StatelessWidget {
|
|
const HomePage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('Basura App'),
|
|
centerTitle: true,
|
|
),
|
|
body: Center(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
ElevatedButton(
|
|
onPressed: () => Navigator.pushNamed(context, '/guia'),
|
|
child: const Text('📚 Guía de Reciclaje'),
|
|
),
|
|
const SizedBox(height: 16),
|
|
ElevatedButton(
|
|
onPressed: () => Navigator.pushNamed(context, '/rutas'),
|
|
child: const Text('🚚 Rutas & ETA'),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|