// GENERATED CODE - DO NOT MODIFY BY HAND // ************************************************************************** // RouterCenterGenerator // ************************************************************************** import "package:gmalpha_flutter/AlbumModel/AlbumRouterImpl.dart"; import "package:gmalpha_flutter/AlbumModel/AlbumRouter.dart"; import "package:gmalpha_flutter/messageModel/MessageRouterImpl.dart"; import "package:gmalpha_flutter/messageModel/MessageRouter.dart"; import "package:gmalpha_flutter/userModel/UserRouterImpl.dart"; import "package:gmalpha_flutter/userModel/UserRouter.dart"; import "package:gmalpha_flutter/questionModel/QuestionRouterImpl.dart"; import "package:gmalpha_flutter/questionModel/QuestionRouter.dart"; import "package:gmalpha_flutter/Annotations/RouterCenterRestore.dart"; import "package:gmalpha_flutter/Annotations/RouterBaser.dart"; class RouterCenterImpl { Map 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("albumModel", () => AlbumRouterImpl()); map.putIfAbsent("messageModel", () => MessageRouterImpl()); map.putIfAbsent("userModel", () => UserRouterImpl()); map.putIfAbsent("questionModel", () => QuestionRouterImpl()); } RouterBaser getModel(String modelName) { return map[modelName]; } AlbumRouter findAlbumRouter() { if (map["albumModel"] == null) { return null; } return map["albumModel"] as AlbumRouter; } MessageRouter findMessageRouter() { if (map["messageModel"] == null) { return null; } return map["messageModel"] as MessageRouter; } UserRouter findUserRouter() { if (map["userModel"] == null) { return null; } return map["userModel"] as UserRouter; } QuestionRouter findQuestionRouter() { if (map["questionModel"] == null) { return null; } return map["questionModel"] as QuestionRouter; } }