mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-01 01:21:06 +03:00
28
flutter/lib/plugin/model.dart
Normal file
28
flutter/lib/plugin/model.dart
Normal file
@@ -0,0 +1,28 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import './common.dart';
|
||||
import './desc.dart';
|
||||
|
||||
// ui location
|
||||
// host|main|settings|display|others
|
||||
// client|remote|toolbar|display
|
||||
|
||||
final Map<PluginId, Map<String, LocationModel>> locationModels = {};
|
||||
|
||||
class LocationModel with ChangeNotifier {
|
||||
final List<UiType> uiList = [];
|
||||
|
||||
void add(UiType ui) {
|
||||
uiList.add(ui);
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
void addLocation(PluginId id, String location, UiType ui) {
|
||||
if (!locationModels.containsKey(id)) {
|
||||
locationModels[id] = {};
|
||||
}
|
||||
if (!locationModels[id]!.containsKey(location)) {
|
||||
locationModels[id]![location] = LocationModel();
|
||||
}
|
||||
locationModels[id]![location]!.add(ui);
|
||||
}
|
||||
Reference in New Issue
Block a user