|
@@ -22,6 +22,8 @@ import 'package:fis_lib_report/report/line.dart';
|
|
|
import 'package:fis_lib_report/report/multiSelected.dart';
|
|
|
import 'package:fis_lib_report/report/page_number.dart';
|
|
|
import 'package:fis_lib_report/report/paragraph.dart';
|
|
|
+import 'package:fis_lib_report/report/rt_Cell.dart';
|
|
|
+import 'package:fis_lib_report/report/rt_table.dart';
|
|
|
import 'package:fis_lib_report/report/singleSelected.dart';
|
|
|
import 'package:fis_lib_report/report/space.dart';
|
|
|
import 'package:fis_lib_report/report/static_text.dart';
|
|
@@ -55,6 +57,53 @@ class _ParagraphState extends State<ParagraphPage> {
|
|
|
_itemCount = _elements!.length;
|
|
|
if (_itemCount == 0) {
|
|
|
return const SizedBox();
|
|
|
+ } else if (_itemCount == 2 &&
|
|
|
+ _elements![0].elementType!.name == ElementType.staticText!.name &&
|
|
|
+ (_elements![1].elementType!.name == ElementType.singleSelected!.name ||
|
|
|
+ _elements![1].elementType!.name ==
|
|
|
+ ElementType.multiSelected!.name ||
|
|
|
+ _elements![1].elementType!.name == ElementType.inputText!.name)) {
|
|
|
+ try {
|
|
|
+ final staticText = _elements![0];
|
|
|
+ if (staticText.parent != null) {
|
|
|
+ final paragraph = staticText.parent as Paragraph;
|
|
|
+ if (paragraph.parent != null) {
|
|
|
+ final cell = paragraph.parent as RTCell;
|
|
|
+ if (cell.parent != null) {
|
|
|
+ final table = cell.parent as RTTable;
|
|
|
+ final values = table.cells!.values.toList();
|
|
|
+ for (var i = 0; i < values.length; i++) {
|
|
|
+ if (values[i] == cell) {
|
|
|
+ final key = table.cells!.keys.toList()[i];
|
|
|
+ final column = key.column;
|
|
|
+ final width = table.columnDefinitions![column!].width;
|
|
|
+ var valueWidth = 0.0;
|
|
|
+ if (_elements![1].elementType!.name ==
|
|
|
+ ElementType.inputText!.name) {
|
|
|
+ final input = _elements![1] as InputText;
|
|
|
+ valueWidth = input.lineWidth!;
|
|
|
+ }
|
|
|
+ if (_elements![1].elementType!.name ==
|
|
|
+ ElementType.singleSelected!.name) {
|
|
|
+ final input = _elements![1] as SingleSelected;
|
|
|
+ valueWidth = input.lineWidth!;
|
|
|
+ }
|
|
|
+ if (_elements![1].elementType!.name ==
|
|
|
+ ElementType.multiSelected!.name) {
|
|
|
+ final input = _elements![1] as MultiSelected;
|
|
|
+ valueWidth = input.lineWidth!;
|
|
|
+ }
|
|
|
+ final textWidth = width! - valueWidth;
|
|
|
+ final textElement = staticText as StaticText;
|
|
|
+ textElement.lineWidth = textWidth;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ print(e);
|
|
|
+ }
|
|
|
}
|
|
|
final margin = widget.paragraph.margin!;
|
|
|
return Container(
|
|
@@ -76,9 +125,6 @@ class _ParagraphState extends State<ParagraphPage> {
|
|
|
} else if (element.elementType!.name ==
|
|
|
ElementType.staticText!.name) {
|
|
|
StaticText staticText = element as StaticText;
|
|
|
- if (staticText.lineWidth == 0) {
|
|
|
- staticText.lineWidth = staticText.lineLength! * 10.5;
|
|
|
- }
|
|
|
return RStaticText(staticText);
|
|
|
} else if (element.elementType!.name ==
|
|
|
ElementType.singleSelected!.name) {
|