import 'package:fluro/fluro.dart';
import 'package:liftmanager/internal/account/page/account_page.dart';
import 'package:liftmanager/internal/account/page/certificate_page.dart';
import 'package:liftmanager/internal/account/page/certificate_upload_page.dart';
import 'package:liftmanager/internal/account/page/login_page.dart';
import 'package:liftmanager/internal/account/page/register_page.dart';
import 'package:liftmanager/internal/account/page/reset_password_page.dart';
import 'package:liftmanager/routers/router_init.dart';

class AccountRouter implements IRouterProvider{

  static String loginPage       = "/login";
  static String registerPage    = "/register";
  static String resetPasswordPage    = "/resetPasswordPage";

  static String accountPage     = "/account";
  static String certificatePage     = "/certificate/detail";
  static String certificateUploadPage     = "/certificate/upload";
  @override
  void initRouter(FluroRouter router) {
    router.define(loginPage, handler: Handler(handlerFunc: (_,params)=>LoginPage()));
    router.define(registerPage, handler: Handler(handlerFunc: (_,params){
      String authCode = params['authCode'].first;
      return RegisterPage(authCode: authCode);
    }));
    router.define(resetPasswordPage, handler: Handler(handlerFunc: (_,params)=>ResetPasswordPage()));
    router.define(accountPage, handler: Handler(handlerFunc: (_,params)=>AccountPage()));
    router.define(certificatePage, handler: Handler(handlerFunc: (_,params)=>CertificatePage()));
    router.define(certificateUploadPage, handler: Handler(handlerFunc: (_,params)=>CertificateUploadPage()));
  }

}