import 'package:flutter/material.dart';
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
import 'package:wyatt_ui_layout_example/components/custom_app_bar.dart';
import 'package:wyatt_ui_layout_example/components/custom_bottom_navigation_bar.dart';
import 'package:wyatt_ui_layout_example/pages/bottom_navigation_bar_layout_page_1.dart';
import 'package:wyatt_ui_layout_example/pages/bottom_navigation_bar_layout_page_2.dart';

class AppThemeComponent {
  static ComponentThemeData get components => ComponentThemeData.raw(
        appBar: const CustomAppBar(),
        bottomNavigationBar: CustomBottomNavigationBar(
          onTap: (context, index) {
            switch (index) {
              case 0:
                Navigator.pushReplacement(
                  context,
                  // ignore: inference_failure_on_instance_creation
                  PageRouteBuilder(
                    pageBuilder: (context, animation1, animation2) =>
                        const BottomNavigationBarLayoutPage1(),
                    transitionDuration: Duration.zero,
                    reverseTransitionDuration: Duration.zero,
                  ),
                );
                break;
              case 1:
                Navigator.pushReplacement(
                  context,
                  // ignore: inference_failure_on_instance_creation
                  PageRouteBuilder(
                    pageBuilder: (context, animation1, animation2) =>
                        const BottomNavigationBarLayoutPage2(),
                    transitionDuration: Duration.zero,
                    reverseTransitionDuration: Duration.zero,
                  ),
                );
                break;
            }
          },
        ),
      );
}
