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

import '../../router/app_router.gr.dart';
import 'widgets/bottom_navbar.dart';

@RoutePage()
class MainPage extends StatelessWidget {
  const MainPage({super.key});

  @override
  Widget build(BuildContext context) {
    return AutoTabsRouter.pageView(
      routes: [HomeRoute(), VoucherRoute(), OrderRoute(), ProfileRoute()],
      physics: const NeverScrollableScrollPhysics(),
      builder: (context, child, pageController) => Scaffold(
        body: child,
        bottomNavigationBar: MainBottomNavbar(
          tabsRouter: AutoTabsRouter.of(context),
        ),
      ),
    );
  }
}
