import 'package:fis_lib_report/report/inlineElement.dart'; import 'package:fis_lib_report/report/interfaces/textElement.dart'; import 'package:fis_lib_report/report/rt_color.dart'; abstract class TextElement extends InlineElement implements ITextElement { String? fontName; double? fontSize; List? fontStyles = []; RTColor? fontColor; RTColor? background; int? lineLength; double? lineWidth; ///是否自动换行 bool? textWrap; TextElement.fromJson(Map json) : super.fromJson(json) { fontName = json['FontName']; fontSize = json['FontSize']; List jsonStyles = json['FontStyles']; if (jsonStyles.isNotEmpty) { jsonStyles.forEach((s) { fontStyles! .add(RTFontStyle.values.firstWhere((element) => element.name == s)); }); } fontColor = RTColor.fromJson(json['FontColor']); background = RTColor.fromJson(json['Background']); lineLength = json['LineLength']; lineWidth = json['LineWidth']; textWrap = json['TextWrap']; } }