| 1234567891011121314151617181920212223242526272829303132 |
- import 'package:common_pub/service/controller.dart';
- import 'package:common_pub/ui/map_view/map_view.dart';
- import '../service/api.dart';
- import 'package:fixnum/fixnum.dart';
- typedef MapId = Int64;
- class MapWatchService extends PlugController{
- static final Rx<MapWatchService?> _instance = Rx(null);
- static MapWatchService? get instance => _instance.value;
- static Future<void> setMapById(MapId id)async{
- final info = await ApiService.to.stub.toMapDetailV2(IdRequest()
- ..id = id);
- final thisInstance = MapWatchService(
- id: id)
- ..name = info.mapName
- ..plugMap.gameMap = info.zipImage.toGameMap() ;
- thisInstance.addPlugs([thisInstance.plugMap]);
- _instance.value = thisInstance;
- thisInstance.init();
- }
- MapWatchService({required this.id});
- final MapId id;
- String name= '';
- final plugMap = PlugMap();
- }
|