import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

import 'core/firebase/firebase_config.dart';
import 'core/router/app_router.dart';
import 'core/tema/tema.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await iniciarFirebase();
  runApp(const ProviderScope(child: BolaoApp()));
}

class BolaoApp extends ConsumerWidget {
  const BolaoApp({super.key});

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    return MaterialApp.router(
      title: 'Bolão',
      debugShowCheckedModeBanner: false,
      routerConfig: ref.watch(routerProvider),
      theme: temaDoApp(),
    );
  }
}
