common.dart 783 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import 'dart:convert';
  2. typedef PluginId = String;
  3. // ui location
  4. const String kLocationHostMainPlugin = 'host|main|settings|plugin';
  5. const String kLocationClientRemoteToolbarDisplay =
  6. 'client|remote|toolbar|display';
  7. class MsgFromUi {
  8. String id;
  9. String name;
  10. String location;
  11. String key;
  12. String value;
  13. String action;
  14. MsgFromUi({
  15. required this.id,
  16. required this.name,
  17. required this.location,
  18. required this.key,
  19. required this.value,
  20. required this.action,
  21. });
  22. Map<String, dynamic> toJson() {
  23. return <String, dynamic>{
  24. 'id': id,
  25. 'name': name,
  26. 'location': location,
  27. 'key': key,
  28. 'value': value,
  29. 'action': action,
  30. };
  31. }
  32. @override
  33. String toString() {
  34. return jsonEncode(toJson());
  35. }
  36. }