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

import 'package:{{ name }}/repository/AuthenticationRepository.dart';

import 'package:{{ name }}/views/Welcome.dart';
import 'package:{{ name }}/views/Auth/AuthLogin.dart';
import 'package:{{ name }}/views/Auth/AuthOtp.dart';
import 'package:{{ name }}/views/Auth/AuthResetLink.dart';

class Router {
  static Route<dynamic> generateRoute(RouteSettings settings, AuthenticationRepository authenticationRepository) {
    switch (settings.name) {
      case '/':
        return CupertinoPageRoute(builder: (_) => WelcomePage());
      case '/login':
        return CupertinoPageRoute(builder: (_) =>LoginPage(authenticationRepository: authenticationRepository));
      case '/register':
        return CupertinoPageRoute(builder: (_) => WelcomePage());
      case '/reset':
        return CupertinoPageRoute(builder: (_) => AuthResetLink(authenticationRepository: authenticationRepository));
      case '/otp':
        return CupertinoPageRoute(builder: (_) => AuthOtp(authenticationRepository: authenticationRepository));
      default:
        return CupertinoPageRoute(
            builder: (_) => Scaffold(
                  body: Center(
                      child: Text('No route defined for ${settings.name}')),
                ));
    }
  }
}
