
import 'package:fluro/fluro.dart';
import 'package:liftmanager/routers/router_init.dart';
import 'package:liftmanager/internal/search/page/search_page.dart';
import 'package:liftmanager/internal/search/page/search_index.dart';
import 'package:liftmanager/internal/search/page/search_brand.dart';

class SearchRouter implements IRouterProvider{

  static String searchPage = "/search";
  static String searchIndex= "/search/index";
  static String searchBrand= "/search/brand";

  @override
  void initRouter(Router router) {
    router.define(searchPage, handler: Handler(handlerFunc: (_, params) => SearchPage()));
    router.define(searchIndex, handler: Handler(handlerFunc: (_, params){
        String type = params["type"].first;
        String text = params["text"].first;
        
        return SearchIndex(type,text);
      }));
    router.define(searchBrand, handler: Handler(handlerFunc: (_, params) => SearchBrand()));
    
  }
}
