import 'package:fluro/fluro.dart';
import 'package:liftmanager/internal/heavy/page/heavy_create_page.dart';
import 'package:liftmanager/internal/heavy/page/heavy_detail_page.dart';
import 'package:liftmanager/internal/heavy/page/heavy_end_page.dart';
import 'package:liftmanager/internal/heavy/page/heavy_lift_list_page.dart';
import 'package:liftmanager/internal/heavy/page/heavy_list_page.dart';
import 'package:liftmanager/internal/heavy/page/heavy_sign_page.dart';
import 'package:liftmanager/internal/heavy/page/heavy_user_page.dart';
import 'package:liftmanager/routers/router_init.dart';

class HeavyRouter implements IRouterProvider{

  static String heavyListPage = "/heavy/list";
  static String heavyCreatePage = "/heavy/create";
  static String heavyDetailPage = "/heavy/detail";
  static String heavyLiftListPage = "/heavy/lift/list";
  static String heavySignPage = "/heavy/sign/home";
  static String heavyUserPage = "/heavy/sign/users";
  static String heavyEndPage = "/heavy/end";

  @override
  void initRouter(Router router) {
    router.define(heavyListPage, handler: Handler(handlerFunc: (_, params){
      String topInto = params["top_into"]?.first??"0";
      return HeavyListPage(topInto: topInto=="1"?true:false,);
    }));
    router.define(heavyCreatePage, handler: Handler(handlerFunc: (_, params) => HeavyCreatePage()));
    router.define(heavyDetailPage, handler: Handler(handlerFunc: (_,params){
      String id = params['id']?.first;
      String status = params['status']?.first;
      return HeavyDetailPage(id,status);
    }));
    router.define(heavyLiftListPage, handler: Handler(handlerFunc: (_,params){
      String id = params['id']?.first;
      return HeavyLiftListPage(id);
    }));
    router.define(heavySignPage, handler: Handler(handlerFunc: (_, params){
      String id = params['id']?.first;
      return HeavySignPage(id);
    }));

    router.define(heavyUserPage, handler: Handler(handlerFunc: (_, params){
      String id = params['id']?.first;
      return HeavyUserPage(id);
    }));
    router.define(heavyEndPage, handler: Handler(handlerFunc: (_, params){
      String id = params['id']?.first;
      return HeavyEndPage(id);
    }));
  }
}