input_text_info.dart 930 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import 'package:fis_lib_report/converts/event_type.dart';
  2. import 'package:fis_lib_report/report/inputText.dart';
  3. import 'package:fis_lib_report/report_info/text_element_info.dart';
  4. class InputTextInfo extends TextElementInfo {
  5. ///是否只读
  6. bool? isReadOnly;
  7. ///当前输入框是否已经监听
  8. bool? isListening;
  9. ///UI绑定的文本
  10. String get text => _text;
  11. set text(String v) {
  12. _text = v;
  13. onTextChange.emit(this, v);
  14. }
  15. ///文本改变通知UI变化
  16. FEventHandler<String> onTextChange = FEventHandler<String>();
  17. String _text = '';
  18. InputTextInfo.fromElement(InputText element) : super.fromElement(element) {
  19. isReadOnly = element.isReadOnly;
  20. isListening = false;
  21. text = '';
  22. }
  23. @override
  24. Map<String, dynamic> toJson() {
  25. final map = <String, dynamic>{};
  26. map.addAll(super.toJson());
  27. map['IsReadOnly'] = isReadOnly;
  28. map['Text'] = text;
  29. return map;
  30. }
  31. }