// GENERATED CODE - DO NOT MODIFY BY HAND

// **************************************************************************
// RouterCenterGenerator
// **************************************************************************

//MainRouterImpl is resign : true
//FindRouterImpl is resign : true
//BuriedImpl is resign : true
//AlbumRouterImpl is resign : true
//NewMessageRouterImpl is resign : true
//UserRouterImpl is resign : true
//WebRouterImpl is resign : true
//AskRouterImpl is resign : true

import "package:gmalpha_flutter/MainModel/MainRouterImpl.dart";
import "package:gmalpha_flutter/MainModel/MainRouter.dart";
import "package:gmalpha_flutter/FindModel/FindRouterImpl.dart";
import "package:gmalpha_flutter/FindModel/FindRouter.dart";
import "package:gmalpha_flutter/BuriedLib/BuriedImpl.dart";
import "package:gmalpha_flutter/BuriedLib/BuriedRouter.dart";
import "package:gmalpha_flutter/AlbumModel/AlbumRouterImpl.dart";
import "package:gmalpha_flutter/AlbumModel/AlbumRouter.dart";
import "package:gmalpha_flutter/MessageModel/NewMessageRouterImpl.dart";
import "package:gmalpha_flutter/MessageModel/NewMessageRouter.dart";
import "package:gmalpha_flutter/UserModel/UserRouterImpl.dart";
import "package:gmalpha_flutter/UserModel/UserRouter.dart";
import "package:gmalpha_flutter/WebModel/WebRouterImpl.dart";
import "package:gmalpha_flutter/WebModel/WebRouter.dart";
import "package:gmalpha_flutter/AskModel/AskRouterImpl.dart";
import "package:gmalpha_flutter/AskModel/AskRouter.dart";

import "package:gmalpha_flutter/Annotations/RouterCenterRestore.dart";
import "package:gmalpha_flutter/Annotations/RouterBaser.dart";

class RouterCenterImpl {
  Map<String, RouterBaser> map;

  factory RouterCenterImpl() => _sharedInstance();

  static RouterCenterImpl _instance;

  RouterCenterImpl._() {
    if (map == null) {
      map = new Map();
      init();
    } else {
      throw Exception("too many RouterCenter instance!!!  fix it ");
    }
  }

  static RouterCenterImpl _sharedInstance() {
    if (_instance == null) {
      _instance = RouterCenterImpl._();
    }
    return _instance;
  }

  void init() {
    map.putIfAbsent("MainModel", () => MainRouterImpl());
    map.putIfAbsent("FindModel", () => FindRouterImpl());
    map.putIfAbsent("buried_router", () => BuriedImpl());
    map.putIfAbsent("albumModel", () => AlbumRouterImpl());
    map.putIfAbsent("MessageModel", () => NewMessageRouterImpl());
    map.putIfAbsent("UserModel", () => UserRouterImpl());
    map.putIfAbsent("WebModel", () => WebRouterImpl());
    map.putIfAbsent("AskRouter", () => AskRouterImpl());
  }

  RouterBaser getModel(String modelName) {
    return map[modelName];
  }

  MainRouter findMainRouter() {
    if (map["MainModel"] == null) {
      return null;
    }
    return map["MainModel"] as MainRouter;
  }

  FindRouter findFindRouter() {
    if (map["FindModel"] == null) {
      return null;
    }
    return map["FindModel"] as FindRouter;
  }

  BuriedRouter findBuriedRouter() {
    if (map["buried_router"] == null) {
      return null;
    }
    return map["buried_router"] as BuriedRouter;
  }

  AlbumRouter findAlbumRouter() {
    if (map["albumModel"] == null) {
      return null;
    }
    return map["albumModel"] as AlbumRouter;
  }

  NewMessageRouter findNewMessageRouter() {
    if (map["MessageModel"] == null) {
      return null;
    }
    return map["MessageModel"] as NewMessageRouter;
  }

  UserRouter findUserRouter() {
    if (map["UserModel"] == null) {
      return null;
    }
    return map["UserModel"] as UserRouter;
  }

  WebRouter findWebRouter() {
    if (map["WebModel"] == null) {
      return null;
    }
    return map["WebModel"] as WebRouter;
  }

  AskRouter findAskRouter() {
    if (map["AskRouter"] == null) {
      return null;
    }
    return map["AskRouter"] as AskRouter;
  }
}
