import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:prosappco/src/authentication/authentication_repository.dart';
import 'package:prosappco/src/screens/city.dart';
import 'package:prosappco/src/screens/login.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:prosappco/src/screens/login_email.dart';
import 'package:prosappco/src/screens/new_number.dart';
import 'package:prosappco/src/screens/profession.dart';
import 'package:prosappco/src/screens/professional_profile.dart';
import 'package:prosappco/src/screens/professional_revision.dart';
import 'package:prosappco/src/screens/profile.dart';
import 'package:prosappco/src/screens/register.dart';
import 'package:prosappco/src/screens/request_sent.dart';
import 'package:prosappco/src/screens/welcome.dart';
import 'firebase_options.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(
    options: DefaultFirebaseOptions.currentPlatform,
  ).then((value) => Get.put(AuthenticationRepository()));
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      theme: ThemeData(fontFamily: 'Poppins'),
      debugShowCheckedModeBanner: false,
      title: 'ProsApp',
      initialRoute: '/',
      routes: {
        '/': (context) => LoginScreen(),
        '/login': (context) => LoginEmailScreen(),
        '/welcome': (context) => WelcomeScreen(),
        '/profile': (context) => ProfileScreen(),
        '/register': (context) => RegisterScreen(),
        '/city': (context) => CityScreen(),
        '/profession': (context) => ProfessionScreen(),
        '/newNumber': (context) => NewNumberScreen(),
        '/profesionalRevision': (context) => ProfessionalRevisionScreen(),
        '/profesionalProfile': (context) => ProfessionalProfileScreen(),
        '/solicitudEnviada': (context) => RequestSentScreen()
      },
      onGenerateRoute: (settings) {
        throw Exception('Ruta desconocida: ${settings.name}');
      },
    );
  }
}
