import 'package:flutter/material.dart';
import 'package:llswidget/llswidget.dart';
import 'ui/pages/pages.dart';

class RouteGenerator {
  static Route<dynamic> generateRoute(RouteSettings settings) {
    //final args = settings.arguments;

    switch (settings.name) {
      case MainPage.routeName:
        return MaterialPageRoute(builder: (_) => MainPage());
      case ButtonsPage.routeName:
        return MaterialPageRoute(builder: (_) => ButtonsPage());
      case StandardsButtonPage.routeName:
        return MaterialPageRoute(builder: (_) => StandardsButtonPage());
      case LabelPage.routeName:
        return MaterialPageRoute(builder: (_) => LabelPage());
      case TilesPage.routeName:
        return MaterialPageRoute(builder: (_) => TilesPage());
      case RoundedButtonPage.routeName:
        return MaterialPageRoute(builder: (_) => RoundedButtonPage());
      case SquareButtonPage.routeName:
        return MaterialPageRoute(builder: (_) => SquareButtonPage());
      case ButtonsPageDynamic.routeName:
        return MaterialPageRoute(builder: (_) => ButtonsPageDynamic());
      case AccordionPage.routeName:
        return MaterialPageRoute(builder: (_) => AccordionPage());
      case AlertPage.routeName:
        return MaterialPageRoute(builder: (_) => AlertPage());
      case AppbarHomePage.routeName:
        return MaterialPageRoute(builder: (_) => AppbarHomePage());
      case AvatarPage.routeName:
        return MaterialPageRoute(builder: (_) => AvatarPage());
      case BadgesPage.routeName:
        return MaterialPageRoute(builder: (_) => BadgesPage());
      case IconsButtonsPage.routeName:
        return MaterialPageRoute(builder: (_) => IconsButtonsPage());
      case CardPage.routeName:
        return MaterialPageRoute(builder: (_) => CardPage());
      case TestStatePage.routeName:
        return MaterialPageRoute(builder: (_) => TestStatePage());
      case TabsPage.routeName:
        return MaterialPageRoute(builder: (_) => TabsPage());
      case SegmentedTabPage.routeName:
        return MaterialPageRoute(builder: (_) => SegmentedTabPage());
      case IconTabPage.routeName:
        return MaterialPageRoute(builder: (_) => IconTabPage());
      case LabeledTabPage.routeName:
        return MaterialPageRoute(builder: (_) => LabeledTabPage());
      case BottomIconTabPage.routeName:
        return MaterialPageRoute(builder: (_) => BottomIconTabPage());
      case BottomLabeledTabPage.routeName:
        return MaterialPageRoute(builder: (_) => BottomLabeledTabPage());
      case CarouselPage.routeName:
        return MaterialPageRoute(builder: (_) => CarouselPage());
      case ToastPage.routeName:
        return MaterialPageRoute(builder: (_) => ToastPage());
      case TogglePage.routeName:
        return MaterialPageRoute(builder: (_) => TogglePage());
      default:
        // If there is no such named route in the switch statement
        return MaterialPageRoute(builder: (context) {
          return Scaffold(
            body: Center(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: <Widget>[
                  Text(
                    'In Progress. Sabar yah :)',
                    style: TextStyle(fontSize: 20),
                  ),
                  const SizedBox(
                    height: 15
                  ),
                  LLSButton(
                    onPressed: () {
                      Navigator.of(context).pop();
                    },
                    child: const Text(
                      'Back',
                      style: TextStyle(fontSize: 16),
                    ),
                    type: LLSButtonType.outline,
                    color: LLSColors.SUCCESS,
                  ),
                ]
              ),
            )
          );
        });
    }
  }
}
