123456789101112131415161718192021222324252627282930313233 |
- 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<RTFontStyle>? fontStyles = [];
- RTColor? fontColor;
- RTColor? background;
- int? lineLength;
- double? lineWidth;
- ///是否自动换行
- bool? textWrap;
- TextElement.fromJson(Map<String, dynamic> json) : super.fromJson(json) {
- fontName = json['FontName'];
- fontSize = json['FontSize'];
- List<dynamic> 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'];
- }
- }
|