Showing
20 changed files
with
68 additions
and
68 deletions
| @@ -10,6 +10,7 @@ analyzer: | @@ -10,6 +10,7 @@ analyzer: | ||
| 10 | todo: ignore | 10 | todo: ignore |
| 11 | constant_identifier_names: ignore | 11 | constant_identifier_names: ignore |
| 12 | avoid_print: ignore | 12 | avoid_print: ignore |
| 13 | + no_leading_underscores_for_local_identifiers: ignore | ||
| 13 | 14 | ||
| 14 | linter: | 15 | linter: |
| 15 | rules: | 16 | rules: |
| @@ -43,7 +43,7 @@ String logicalToVisual(String input) { | @@ -43,7 +43,7 @@ String logicalToVisual(String input) { | ||
| 43 | final buffer = StringBuffer(); | 43 | final buffer = StringBuffer(); |
| 44 | final paragraphs = bidi.splitStringToParagraphs(input); | 44 | final paragraphs = bidi.splitStringToParagraphs(input); |
| 45 | for (final paragraph in paragraphs) { | 45 | for (final paragraph in paragraphs) { |
| 46 | - final endsWithNewLine = paragraph.paragraphSeparator == 10; | 46 | + final endsWithNewLine = paragraph.separator == 10; |
| 47 | final endIndex = paragraph.bidiText.length - (endsWithNewLine ? 1 : 0); | 47 | final endIndex = paragraph.bidiText.length - (endsWithNewLine ? 1 : 0); |
| 48 | final visual = String.fromCharCodes(paragraph.bidiText, 0, endIndex); | 48 | final visual = String.fromCharCodes(paragraph.bidiText, 0, endIndex); |
| 49 | buffer.write(visual.split(' ').reversed.join(' ')); | 49 | buffer.write(visual.split(' ').reversed.join(' ')); |
| @@ -127,7 +127,7 @@ class PdfGraphicState { | @@ -127,7 +127,7 @@ class PdfGraphicState { | ||
| 127 | if (blendMode != null) { | 127 | if (blendMode != null) { |
| 128 | final bm = blendMode.toString(); | 128 | final bm = blendMode.toString(); |
| 129 | params['/BM'] = | 129 | params['/BM'] = |
| 130 | - PdfName('/' + bm.substring(13, 14).toUpperCase() + bm.substring(14)); | 130 | + PdfName('/${bm.substring(13, 14).toUpperCase()}${bm.substring(14)}'); |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | if (softMask != null) { | 133 | if (softMask != null) { |
| @@ -63,7 +63,7 @@ class PdfBorder extends PdfObjectDict { | @@ -63,7 +63,7 @@ class PdfBorder extends PdfObjectDict { | ||
| 63 | super.prepare(); | 63 | super.prepare(); |
| 64 | 64 | ||
| 65 | params['/S'] = | 65 | params['/S'] = |
| 66 | - PdfName('/' + 'SDBIU'.substring(style.index, style.index + 1)); | 66 | + PdfName('/${'SDBIU'.substring(style.index, style.index + 1)}'); |
| 67 | params['/W'] = PdfNum(width); | 67 | params['/W'] = PdfNum(width); |
| 68 | 68 | ||
| 69 | if (dash != null) { | 69 | if (dash != null) { |
| @@ -37,7 +37,7 @@ class PdfFontDescriptor extends PdfObjectDict { | @@ -37,7 +37,7 @@ class PdfFontDescriptor extends PdfObjectDict { | ||
| 37 | void prepare() { | 37 | void prepare() { |
| 38 | super.prepare(); | 38 | super.prepare(); |
| 39 | 39 | ||
| 40 | - params['/FontName'] = PdfName('/' + ttfFont.fontName); | 40 | + params['/FontName'] = PdfName('/${ttfFont.fontName}'); |
| 41 | params['/FontFile2'] = file.ref(); | 41 | params['/FontFile2'] = file.ref(); |
| 42 | params['/Flags'] = PdfNum(ttfFont.font.unicode ? 4 : 32); | 42 | params['/Flags'] = PdfNum(ttfFont.font.unicode ? 4 : 32); |
| 43 | params['/FontBBox'] = PdfArray.fromNum(<int>[ | 43 | params['/FontBBox'] = PdfArray.fromNum(<int>[ |
| @@ -89,7 +89,7 @@ class PdfTtfFont extends PdfFont { | @@ -89,7 +89,7 @@ class PdfTtfFont extends PdfFont { | ||
| 89 | file.buf.putBytes(font.bytes.buffer.asUint8List()); | 89 | file.buf.putBytes(font.bytes.buffer.asUint8List()); |
| 90 | file.params['/Length1'] = PdfNum(font.bytes.lengthInBytes); | 90 | file.params['/Length1'] = PdfNum(font.bytes.lengthInBytes); |
| 91 | 91 | ||
| 92 | - params['/BaseFont'] = PdfName('/' + fontName); | 92 | + params['/BaseFont'] = PdfName('/$fontName'); |
| 93 | params['/FontDescriptor'] = descriptor.ref(); | 93 | params['/FontDescriptor'] = descriptor.ref(); |
| 94 | charMin = 32; | 94 | charMin = 32; |
| 95 | charMax = 255; | 95 | charMax = 255; |
| @@ -113,7 +113,7 @@ class PdfTtfFont extends PdfFont { | @@ -113,7 +113,7 @@ class PdfTtfFont extends PdfFont { | ||
| 113 | 113 | ||
| 114 | final descendantFont = PdfDict({ | 114 | final descendantFont = PdfDict({ |
| 115 | '/Type': const PdfName('/Font'), | 115 | '/Type': const PdfName('/Font'), |
| 116 | - '/BaseFont': PdfName('/' + fontName), | 116 | + '/BaseFont': PdfName('/$fontName'), |
| 117 | '/FontFile2': file.ref(), | 117 | '/FontFile2': file.ref(), |
| 118 | '/FontDescriptor': descriptor.ref(), | 118 | '/FontDescriptor': descriptor.ref(), |
| 119 | '/W': PdfArray([ | 119 | '/W': PdfArray([ |
| @@ -130,7 +130,7 @@ class PdfTtfFont extends PdfFont { | @@ -130,7 +130,7 @@ class PdfTtfFont extends PdfFont { | ||
| 130 | }) | 130 | }) |
| 131 | }); | 131 | }); |
| 132 | 132 | ||
| 133 | - params['/BaseFont'] = PdfName('/' + fontName); | 133 | + params['/BaseFont'] = PdfName('/$fontName'); |
| 134 | params['/Encoding'] = const PdfName('/Identity-H'); | 134 | params['/Encoding'] = const PdfName('/Identity-H'); |
| 135 | params['/DescendantFonts'] = PdfArray([descendantFont]); | 135 | params['/DescendantFonts'] = PdfArray([descendantFont]); |
| 136 | params['/ToUnicode'] = unicodeCMap.ref(); | 136 | params['/ToUnicode'] = unicodeCMap.ref(); |
| @@ -59,7 +59,7 @@ class PdfType1Font extends PdfFont { | @@ -59,7 +59,7 @@ class PdfType1Font extends PdfFont { | ||
| 59 | void prepare() { | 59 | void prepare() { |
| 60 | super.prepare(); | 60 | super.prepare(); |
| 61 | 61 | ||
| 62 | - params['/BaseFont'] = PdfName('/' + fontName); | 62 | + params['/BaseFont'] = PdfName('/$fontName'); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | @override | 65 | @override |
| @@ -51,11 +51,8 @@ class PdfUnicodeCmap extends PdfObjectStream { | @@ -51,11 +51,8 @@ class PdfUnicodeCmap extends PdfObjectStream { | ||
| 51 | 51 | ||
| 52 | for (var key = 0; key < cmap.length; key++) { | 52 | for (var key = 0; key < cmap.length; key++) { |
| 53 | final value = cmap[key]; | 53 | final value = cmap[key]; |
| 54 | - buf.putString('<' + | ||
| 55 | - key.toRadixString(16).toUpperCase().padLeft(4, '0') + | ||
| 56 | - '> <' + | ||
| 57 | - value.toRadixString(16).toUpperCase().padLeft(4, '0') + | ||
| 58 | - '>\n'); | 54 | + buf.putString( |
| 55 | + '<${key.toRadixString(16).toUpperCase().padLeft(4, '0')}> <${value.toRadixString(16).toUpperCase().padLeft(4, '0')}>\n'); | ||
| 59 | } | 56 | } |
| 60 | 57 | ||
| 61 | buf.putString('endbfchar\n' | 58 | buf.putString('endbfchar\n' |
| @@ -50,10 +50,7 @@ class PdfXref { | @@ -50,10 +50,7 @@ class PdfXref { | ||
| 50 | 50 | ||
| 51 | /// The xref in the format of the xref section in the Pdf file | 51 | /// The xref in the format of the xref section in the Pdf file |
| 52 | String ref() { | 52 | String ref() { |
| 53 | - return offset.toString().padLeft(10, '0') + | ||
| 54 | - ' ' + | ||
| 55 | - generation.toString().padLeft(5, '0') + | ||
| 56 | - (type == PdfCrossRefEntryType.inUse ? ' n ' : ' f '); | 53 | + return '${offset.toString().padLeft(10, '0')} ${generation.toString().padLeft(5, '0')}${type == PdfCrossRefEntryType.inUse ? ' n ' : ' f '}'; |
| 57 | } | 54 | } |
| 58 | 55 | ||
| 59 | PdfIndirect? get container => object == null ? null : PdfIndirect(object!, 0); | 56 | PdfIndirect? get container => object == null ? null : PdfIndirect(object!, 0); |
| @@ -62,19 +62,19 @@ enum VerticalDirection { | @@ -62,19 +62,19 @@ enum VerticalDirection { | ||
| 62 | 62 | ||
| 63 | typedef _ChildSizingFunction = double? Function(Widget child, double? extent); | 63 | typedef _ChildSizingFunction = double? Function(Widget child, double? extent); |
| 64 | 64 | ||
| 65 | -class _FlexContext extends WidgetContext { | 65 | +class FlexContext extends WidgetContext { |
| 66 | int firstChild = 0; | 66 | int firstChild = 0; |
| 67 | int lastChild = 0; | 67 | int lastChild = 0; |
| 68 | 68 | ||
| 69 | @override | 69 | @override |
| 70 | - void apply(_FlexContext other) { | 70 | + void apply(FlexContext other) { |
| 71 | firstChild = other.firstChild; | 71 | firstChild = other.firstChild; |
| 72 | lastChild = other.lastChild; | 72 | lastChild = other.lastChild; |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | @override | 75 | @override |
| 76 | WidgetContext clone() { | 76 | WidgetContext clone() { |
| 77 | - return _FlexContext()..apply(this); | 77 | + return FlexContext()..apply(this); |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | @override | 80 | @override |
| @@ -101,7 +101,7 @@ class Flex extends MultiChildWidget with SpanningWidget { | @@ -101,7 +101,7 @@ class Flex extends MultiChildWidget with SpanningWidget { | ||
| 101 | 101 | ||
| 102 | final VerticalDirection verticalDirection; | 102 | final VerticalDirection verticalDirection; |
| 103 | 103 | ||
| 104 | - final _FlexContext _context = _FlexContext(); | 104 | + final FlexContext _context = FlexContext(); |
| 105 | 105 | ||
| 106 | double _getIntrinsicSize( | 106 | double _getIntrinsicSize( |
| 107 | {Axis? sizingDirection, | 107 | {Axis? sizingDirection, |
| @@ -502,7 +502,7 @@ class Flex extends MultiChildWidget with SpanningWidget { | @@ -502,7 +502,7 @@ class Flex extends MultiChildWidget with SpanningWidget { | ||
| 502 | bool get hasMoreWidgets => true; | 502 | bool get hasMoreWidgets => true; |
| 503 | 503 | ||
| 504 | @override | 504 | @override |
| 505 | - void restoreContext(_FlexContext context) { | 505 | + void restoreContext(FlexContext context) { |
| 506 | _context.firstChild = context.lastChild; | 506 | _context.firstChild = context.lastChild; |
| 507 | } | 507 | } |
| 508 | 508 |
| @@ -24,7 +24,7 @@ import 'geometry.dart'; | @@ -24,7 +24,7 @@ import 'geometry.dart'; | ||
| 24 | import 'multi_page.dart'; | 24 | import 'multi_page.dart'; |
| 25 | import 'widget.dart'; | 25 | import 'widget.dart'; |
| 26 | 26 | ||
| 27 | -class _GridViewContext extends WidgetContext { | 27 | +class GridViewContext extends WidgetContext { |
| 28 | int firstChild = 0; | 28 | int firstChild = 0; |
| 29 | int lastChild = 0; | 29 | int lastChild = 0; |
| 30 | 30 | ||
| @@ -32,7 +32,7 @@ class _GridViewContext extends WidgetContext { | @@ -32,7 +32,7 @@ class _GridViewContext extends WidgetContext { | ||
| 32 | double? childMainAxis; | 32 | double? childMainAxis; |
| 33 | 33 | ||
| 34 | @override | 34 | @override |
| 35 | - void apply(_GridViewContext other) { | 35 | + void apply(GridViewContext other) { |
| 36 | firstChild = other.firstChild; | 36 | firstChild = other.firstChild; |
| 37 | lastChild = other.lastChild; | 37 | lastChild = other.lastChild; |
| 38 | childCrossAxis = other.childCrossAxis ?? childCrossAxis; | 38 | childCrossAxis = other.childCrossAxis ?? childCrossAxis; |
| @@ -41,7 +41,7 @@ class _GridViewContext extends WidgetContext { | @@ -41,7 +41,7 @@ class _GridViewContext extends WidgetContext { | ||
| 41 | 41 | ||
| 42 | @override | 42 | @override |
| 43 | WidgetContext clone() { | 43 | WidgetContext clone() { |
| 44 | - return _GridViewContext()..apply(this); | 44 | + return GridViewContext()..apply(this); |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | @override | 47 | @override |
| @@ -67,7 +67,7 @@ class GridView extends MultiChildWidget with SpanningWidget { | @@ -67,7 +67,7 @@ class GridView extends MultiChildWidget with SpanningWidget { | ||
| 67 | final double crossAxisSpacing; | 67 | final double crossAxisSpacing; |
| 68 | final double childAspectRatio; | 68 | final double childAspectRatio; |
| 69 | 69 | ||
| 70 | - final _GridViewContext _context = _GridViewContext(); | 70 | + final GridViewContext _context = GridViewContext(); |
| 71 | 71 | ||
| 72 | int? _mainAxisCount; | 72 | int? _mainAxisCount; |
| 73 | 73 | ||
| @@ -331,7 +331,7 @@ class GridView extends MultiChildWidget with SpanningWidget { | @@ -331,7 +331,7 @@ class GridView extends MultiChildWidget with SpanningWidget { | ||
| 331 | bool get hasMoreWidgets => true; | 331 | bool get hasMoreWidgets => true; |
| 332 | 332 | ||
| 333 | @override | 333 | @override |
| 334 | - void restoreContext(_GridViewContext context) { | 334 | + void restoreContext(GridViewContext context) { |
| 335 | _context.apply(context); | 335 | _context.apply(context); |
| 336 | _context.firstChild = context.lastChild; | 336 | _context.firstChild = context.lastChild; |
| 337 | } | 337 | } |
| @@ -77,14 +77,14 @@ class Partition extends Widget with SpanningWidget { | @@ -77,14 +77,14 @@ class Partition extends Widget with SpanningWidget { | ||
| 77 | bool get hasMoreWidgets => child.hasMoreWidgets; | 77 | bool get hasMoreWidgets => child.hasMoreWidgets; |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | -class _PartitionsContext extends WidgetContext { | ||
| 81 | - _PartitionsContext(int count) | 80 | +class PartitionsContext extends WidgetContext { |
| 81 | + PartitionsContext(int count) | ||
| 82 | : partitionContext = List<WidgetContext?>.filled(count, null); | 82 | : partitionContext = List<WidgetContext?>.filled(count, null); |
| 83 | 83 | ||
| 84 | final List<WidgetContext?> partitionContext; | 84 | final List<WidgetContext?> partitionContext; |
| 85 | 85 | ||
| 86 | @override | 86 | @override |
| 87 | - void apply(_PartitionsContext other) { | 87 | + void apply(PartitionsContext other) { |
| 88 | for (var index = 0; index < partitionContext.length; index++) { | 88 | for (var index = 0; index < partitionContext.length; index++) { |
| 89 | partitionContext[index]?.apply(other.partitionContext[index]!); | 89 | partitionContext[index]?.apply(other.partitionContext[index]!); |
| 90 | } | 90 | } |
| @@ -92,7 +92,7 @@ class _PartitionsContext extends WidgetContext { | @@ -92,7 +92,7 @@ class _PartitionsContext extends WidgetContext { | ||
| 92 | 92 | ||
| 93 | @override | 93 | @override |
| 94 | WidgetContext clone() { | 94 | WidgetContext clone() { |
| 95 | - final context = _PartitionsContext(partitionContext.length); | 95 | + final context = PartitionsContext(partitionContext.length); |
| 96 | for (var index = 0; index < partitionContext.length; index++) { | 96 | for (var index = 0; index < partitionContext.length; index++) { |
| 97 | context.partitionContext[index] = partitionContext[index]?.clone(); | 97 | context.partitionContext[index] = partitionContext[index]?.clone(); |
| 98 | } | 98 | } |
| @@ -105,12 +105,12 @@ class Partitions extends Widget with SpanningWidget { | @@ -105,12 +105,12 @@ class Partitions extends Widget with SpanningWidget { | ||
| 105 | Partitions({ | 105 | Partitions({ |
| 106 | required this.children, | 106 | required this.children, |
| 107 | this.mainAxisSize = MainAxisSize.max, | 107 | this.mainAxisSize = MainAxisSize.max, |
| 108 | - }) : _context = _PartitionsContext(children.length), | 108 | + }) : _context = PartitionsContext(children.length), |
| 109 | super(); | 109 | super(); |
| 110 | 110 | ||
| 111 | final List<Partition> children; | 111 | final List<Partition> children; |
| 112 | 112 | ||
| 113 | - final _PartitionsContext _context; | 113 | + final PartitionsContext _context; |
| 114 | 114 | ||
| 115 | final MainAxisSize mainAxisSize; | 115 | final MainAxisSize mainAxisSize; |
| 116 | 116 | ||
| @@ -218,7 +218,7 @@ class Partitions extends Widget with SpanningWidget { | @@ -218,7 +218,7 @@ class Partitions extends Widget with SpanningWidget { | ||
| 218 | } | 218 | } |
| 219 | 219 | ||
| 220 | @override | 220 | @override |
| 221 | - void restoreContext(_PartitionsContext context) { | 221 | + void restoreContext(PartitionsContext context) { |
| 222 | _context.apply(context); | 222 | _context.apply(context); |
| 223 | var index = 0; | 223 | var index = 0; |
| 224 | for (final child in children) { | 224 | for (final child in children) { |
| @@ -121,7 +121,7 @@ class LoremText { | @@ -121,7 +121,7 @@ class LoremText { | ||
| 121 | } | 121 | } |
| 122 | wordList.add(w); | 122 | wordList.add(w); |
| 123 | } | 123 | } |
| 124 | - final text = wordList.join(' ') + '.'; | 124 | + final text = '${wordList.join(' ')}.'; |
| 125 | return text[0].toUpperCase() + text.substring(1); | 125 | return text[0].toUpperCase() + text.substring(1); |
| 126 | } | 126 | } |
| 127 | 127 |
| @@ -136,27 +136,27 @@ class TableBorder extends Border { | @@ -136,27 +136,27 @@ class TableBorder extends Border { | ||
| 136 | } | 136 | } |
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | -class _TableContext extends WidgetContext { | 139 | +class TableContext extends WidgetContext { |
| 140 | int firstLine = 0; | 140 | int firstLine = 0; |
| 141 | int lastLine = 0; | 141 | int lastLine = 0; |
| 142 | 142 | ||
| 143 | @override | 143 | @override |
| 144 | - void apply(_TableContext other) { | 144 | + void apply(TableContext other) { |
| 145 | firstLine = other.firstLine; | 145 | firstLine = other.firstLine; |
| 146 | lastLine = other.lastLine; | 146 | lastLine = other.lastLine; |
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | @override | 149 | @override |
| 150 | WidgetContext clone() { | 150 | WidgetContext clone() { |
| 151 | - return _TableContext()..apply(this); | 151 | + return TableContext()..apply(this); |
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | @override | 154 | @override |
| 155 | String toString() => '$runtimeType firstLine: $firstLine lastLine: $lastLine'; | 155 | String toString() => '$runtimeType firstLine: $firstLine lastLine: $lastLine'; |
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | -class _ColumnLayout { | ||
| 159 | - _ColumnLayout(this.width, this.flex); | 158 | +class ColumnLayout { |
| 159 | + ColumnLayout(this.width, this.flex); | ||
| 160 | 160 | ||
| 161 | final double? width; | 161 | final double? width; |
| 162 | final double? flex; | 162 | final double? flex; |
| @@ -165,7 +165,7 @@ class _ColumnLayout { | @@ -165,7 +165,7 @@ class _ColumnLayout { | ||
| 165 | abstract class TableColumnWidth { | 165 | abstract class TableColumnWidth { |
| 166 | const TableColumnWidth(); | 166 | const TableColumnWidth(); |
| 167 | 167 | ||
| 168 | - _ColumnLayout layout( | 168 | + ColumnLayout layout( |
| 169 | Widget child, Context context, BoxConstraints constraints); | 169 | Widget child, Context context, BoxConstraints constraints); |
| 170 | } | 170 | } |
| 171 | 171 | ||
| @@ -175,10 +175,10 @@ class IntrinsicColumnWidth extends TableColumnWidth { | @@ -175,10 +175,10 @@ class IntrinsicColumnWidth extends TableColumnWidth { | ||
| 175 | final double? flex; | 175 | final double? flex; |
| 176 | 176 | ||
| 177 | @override | 177 | @override |
| 178 | - _ColumnLayout layout( | 178 | + ColumnLayout layout( |
| 179 | Widget child, Context context, BoxConstraints constraints) { | 179 | Widget child, Context context, BoxConstraints constraints) { |
| 180 | if (flex != null) { | 180 | if (flex != null) { |
| 181 | - return _ColumnLayout(0, flex); | 181 | + return ColumnLayout(0, flex); |
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | child.layout(context, const BoxConstraints()); | 184 | child.layout(context, const BoxConstraints()); |
| @@ -189,7 +189,7 @@ class IntrinsicColumnWidth extends TableColumnWidth { | @@ -189,7 +189,7 @@ class IntrinsicColumnWidth extends TableColumnWidth { | ||
| 189 | (child is Expanded | 189 | (child is Expanded |
| 190 | ? child.flex.toDouble() | 190 | ? child.flex.toDouble() |
| 191 | : (child.box!.width == double.infinity ? 1 : 0)); | 191 | : (child.box!.width == double.infinity ? 1 : 0)); |
| 192 | - return _ColumnLayout(calculatedWidth, childFlex); | 192 | + return ColumnLayout(calculatedWidth, childFlex); |
| 193 | } | 193 | } |
| 194 | } | 194 | } |
| 195 | 195 | ||
| @@ -199,9 +199,9 @@ class FixedColumnWidth extends TableColumnWidth { | @@ -199,9 +199,9 @@ class FixedColumnWidth extends TableColumnWidth { | ||
| 199 | final double width; | 199 | final double width; |
| 200 | 200 | ||
| 201 | @override | 201 | @override |
| 202 | - _ColumnLayout layout( | 202 | + ColumnLayout layout( |
| 203 | Widget child, Context context, BoxConstraints? constraints) { | 203 | Widget child, Context context, BoxConstraints? constraints) { |
| 204 | - return _ColumnLayout(width, 0); | 204 | + return ColumnLayout(width, 0); |
| 205 | } | 205 | } |
| 206 | } | 206 | } |
| 207 | 207 | ||
| @@ -211,9 +211,9 @@ class FlexColumnWidth extends TableColumnWidth { | @@ -211,9 +211,9 @@ class FlexColumnWidth extends TableColumnWidth { | ||
| 211 | final double flex; | 211 | final double flex; |
| 212 | 212 | ||
| 213 | @override | 213 | @override |
| 214 | - _ColumnLayout layout( | 214 | + ColumnLayout layout( |
| 215 | Widget child, Context context, BoxConstraints? constraints) { | 215 | Widget child, Context context, BoxConstraints? constraints) { |
| 216 | - return _ColumnLayout(0, flex); | 216 | + return ColumnLayout(0, flex); |
| 217 | } | 217 | } |
| 218 | } | 218 | } |
| 219 | 219 | ||
| @@ -223,9 +223,9 @@ class FractionColumnWidth extends TableColumnWidth { | @@ -223,9 +223,9 @@ class FractionColumnWidth extends TableColumnWidth { | ||
| 223 | final double value; | 223 | final double value; |
| 224 | 224 | ||
| 225 | @override | 225 | @override |
| 226 | - _ColumnLayout layout( | 226 | + ColumnLayout layout( |
| 227 | Widget child, Context context, BoxConstraints? constraints) { | 227 | Widget child, Context context, BoxConstraints? constraints) { |
| 228 | - return _ColumnLayout(constraints!.maxWidth * value, 0); | 228 | + return ColumnLayout(constraints!.maxWidth * value, 0); |
| 229 | } | 229 | } |
| 230 | } | 230 | } |
| 231 | 231 | ||
| @@ -412,7 +412,7 @@ class Table extends Widget with SpanningWidget { | @@ -412,7 +412,7 @@ class Table extends Widget with SpanningWidget { | ||
| 412 | final List<double?> _widths = <double?>[]; | 412 | final List<double?> _widths = <double?>[]; |
| 413 | final List<double> _heights = <double>[]; | 413 | final List<double> _heights = <double>[]; |
| 414 | 414 | ||
| 415 | - final _TableContext _context = _TableContext(); | 415 | + final TableContext _context = TableContext(); |
| 416 | 416 | ||
| 417 | final TableColumnWidth defaultColumnWidth; | 417 | final TableColumnWidth defaultColumnWidth; |
| 418 | final Map<int, TableColumnWidth>? columnWidths; | 418 | final Map<int, TableColumnWidth>? columnWidths; |
| @@ -423,7 +423,7 @@ class Table extends Widget with SpanningWidget { | @@ -423,7 +423,7 @@ class Table extends Widget with SpanningWidget { | ||
| 423 | } | 423 | } |
| 424 | 424 | ||
| 425 | @override | 425 | @override |
| 426 | - void restoreContext(_TableContext context) { | 426 | + void restoreContext(TableContext context) { |
| 427 | _context.apply(context); | 427 | _context.apply(context); |
| 428 | _context.firstLine = _context.lastLine; | 428 | _context.firstLine = _context.lastLine; |
| 429 | } | 429 | } |
| @@ -393,7 +393,7 @@ class _WidgetSpan extends _Span { | @@ -393,7 +393,7 @@ class _WidgetSpan extends _Span { | ||
| 393 | } | 393 | } |
| 394 | } | 394 | } |
| 395 | 395 | ||
| 396 | -typedef _VisitorCallback = bool Function( | 396 | +typedef VisitorCallback = bool Function( |
| 397 | InlineSpan span, | 397 | InlineSpan span, |
| 398 | TextStyle? parentStyle, | 398 | TextStyle? parentStyle, |
| 399 | AnnotationBuilder? annotation, | 399 | AnnotationBuilder? annotation, |
| @@ -435,7 +435,7 @@ abstract class InlineSpan { | @@ -435,7 +435,7 @@ abstract class InlineSpan { | ||
| 435 | } | 435 | } |
| 436 | 436 | ||
| 437 | bool visitChildren( | 437 | bool visitChildren( |
| 438 | - _VisitorCallback visitor, | 438 | + VisitorCallback visitor, |
| 439 | TextStyle? parentStyle, | 439 | TextStyle? parentStyle, |
| 440 | AnnotationBuilder? annotation, | 440 | AnnotationBuilder? annotation, |
| 441 | ); | 441 | ); |
| @@ -469,7 +469,7 @@ class WidgetSpan extends InlineSpan { | @@ -469,7 +469,7 @@ class WidgetSpan extends InlineSpan { | ||
| 469 | /// Calls `visitor` on this [WidgetSpan]. There are no children spans to walk. | 469 | /// Calls `visitor` on this [WidgetSpan]. There are no children spans to walk. |
| 470 | @override | 470 | @override |
| 471 | bool visitChildren( | 471 | bool visitChildren( |
| 472 | - _VisitorCallback visitor, | 472 | + VisitorCallback visitor, |
| 473 | TextStyle? parentStyle, | 473 | TextStyle? parentStyle, |
| 474 | AnnotationBuilder? annotation, | 474 | AnnotationBuilder? annotation, |
| 475 | ) { | 475 | ) { |
| @@ -509,7 +509,7 @@ class TextSpan extends InlineSpan { | @@ -509,7 +509,7 @@ class TextSpan extends InlineSpan { | ||
| 509 | 509 | ||
| 510 | @override | 510 | @override |
| 511 | bool visitChildren( | 511 | bool visitChildren( |
| 512 | - _VisitorCallback visitor, | 512 | + VisitorCallback visitor, |
| 513 | TextStyle? parentStyle, | 513 | TextStyle? parentStyle, |
| 514 | AnnotationBuilder? annotation, | 514 | AnnotationBuilder? annotation, |
| 515 | ) { | 515 | ) { |
| @@ -624,14 +624,14 @@ class _Line { | @@ -624,14 +624,14 @@ class _Line { | ||
| 624 | } | 624 | } |
| 625 | } | 625 | } |
| 626 | 626 | ||
| 627 | -class _RichTextContext extends WidgetContext { | 627 | +class RichTextContext extends WidgetContext { |
| 628 | var startOffset = 0.0; | 628 | var startOffset = 0.0; |
| 629 | var endOffset = 0.0; | 629 | var endOffset = 0.0; |
| 630 | var spanStart = 0; | 630 | var spanStart = 0; |
| 631 | var spanEnd = 0; | 631 | var spanEnd = 0; |
| 632 | 632 | ||
| 633 | @override | 633 | @override |
| 634 | - void apply(_RichTextContext other) { | 634 | + void apply(RichTextContext other) { |
| 635 | startOffset = other.startOffset; | 635 | startOffset = other.startOffset; |
| 636 | endOffset = other.endOffset; | 636 | endOffset = other.endOffset; |
| 637 | spanStart = other.spanStart; | 637 | spanStart = other.spanStart; |
| @@ -640,7 +640,7 @@ class _RichTextContext extends WidgetContext { | @@ -640,7 +640,7 @@ class _RichTextContext extends WidgetContext { | ||
| 640 | 640 | ||
| 641 | @override | 641 | @override |
| 642 | WidgetContext clone() { | 642 | WidgetContext clone() { |
| 643 | - return _RichTextContext()..apply(this); | 643 | + return RichTextContext()..apply(this); |
| 644 | } | 644 | } |
| 645 | 645 | ||
| 646 | @override | 646 | @override |
| @@ -682,7 +682,7 @@ class RichText extends Widget with SpanningWidget { | @@ -682,7 +682,7 @@ class RichText extends Widget with SpanningWidget { | ||
| 682 | 682 | ||
| 683 | final List<_TextDecoration> _decorations = <_TextDecoration>[]; | 683 | final List<_TextDecoration> _decorations = <_TextDecoration>[]; |
| 684 | 684 | ||
| 685 | - final _context = _RichTextContext(); | 685 | + final _context = RichTextContext(); |
| 686 | 686 | ||
| 687 | final TextOverflow? overflow; | 687 | final TextOverflow? overflow; |
| 688 | 688 | ||
| @@ -1297,7 +1297,7 @@ class RichText extends Widget with SpanningWidget { | @@ -1297,7 +1297,7 @@ class RichText extends Widget with SpanningWidget { | ||
| 1297 | bool get hasMoreWidgets => canSpan; | 1297 | bool get hasMoreWidgets => canSpan; |
| 1298 | 1298 | ||
| 1299 | @override | 1299 | @override |
| 1300 | - void restoreContext(_RichTextContext context) { | 1300 | + void restoreContext(RichTextContext context) { |
| 1301 | _context.spanStart = context.spanEnd; | 1301 | _context.spanStart = context.spanEnd; |
| 1302 | _context.startOffset = -context.endOffset; | 1302 | _context.startOffset = -context.endOffset; |
| 1303 | } | 1303 | } |
| @@ -45,19 +45,19 @@ class _RunMetrics { | @@ -45,19 +45,19 @@ class _RunMetrics { | ||
| 45 | final int childCount; | 45 | final int childCount; |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | -class _WrapContext extends WidgetContext { | 48 | +class WrapContext extends WidgetContext { |
| 49 | int firstChild = 0; | 49 | int firstChild = 0; |
| 50 | int lastChild = 0; | 50 | int lastChild = 0; |
| 51 | 51 | ||
| 52 | @override | 52 | @override |
| 53 | - void apply(_WrapContext other) { | 53 | + void apply(WrapContext other) { |
| 54 | firstChild = other.firstChild; | 54 | firstChild = other.firstChild; |
| 55 | lastChild = other.lastChild; | 55 | lastChild = other.lastChild; |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | @override | 58 | @override |
| 59 | WidgetContext clone() { | 59 | WidgetContext clone() { |
| 60 | - return _WrapContext()..apply(this); | 60 | + return WrapContext()..apply(this); |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | @override | 63 | @override |
| @@ -110,7 +110,7 @@ class Wrap extends MultiChildWidget with SpanningWidget { | @@ -110,7 +110,7 @@ class Wrap extends MultiChildWidget with SpanningWidget { | ||
| 110 | @override | 110 | @override |
| 111 | bool get hasMoreWidgets => _context.lastChild < children.length; | 111 | bool get hasMoreWidgets => _context.lastChild < children.length; |
| 112 | 112 | ||
| 113 | - final _WrapContext _context = _WrapContext(); | 113 | + final WrapContext _context = WrapContext(); |
| 114 | 114 | ||
| 115 | double? _getMainAxisExtent(Widget child) { | 115 | double? _getMainAxisExtent(Widget child) { |
| 116 | switch (direction) { | 116 | switch (direction) { |
| @@ -390,7 +390,7 @@ class Wrap extends MultiChildWidget with SpanningWidget { | @@ -390,7 +390,7 @@ class Wrap extends MultiChildWidget with SpanningWidget { | ||
| 390 | } | 390 | } |
| 391 | 391 | ||
| 392 | @override | 392 | @override |
| 393 | - void restoreContext(_WrapContext context) { | 393 | + void restoreContext(WrapContext context) { |
| 394 | _context.apply(context); | 394 | _context.apply(context); |
| 395 | _context.firstChild = context.lastChild; | 395 | _context.firstChild = context.lastChild; |
| 396 | } | 396 | } |
| @@ -24,6 +24,7 @@ import '../printing.dart'; | @@ -24,6 +24,7 @@ import '../printing.dart'; | ||
| 24 | import '../printing_info.dart'; | 24 | import '../printing_info.dart'; |
| 25 | import 'page.dart'; | 25 | import 'page.dart'; |
| 26 | import 'raster.dart'; | 26 | import 'raster.dart'; |
| 27 | + | ||
| 27 | /// Custom widget builder that's used for custom | 28 | /// Custom widget builder that's used for custom |
| 28 | /// rasterized pdf pages rendering | 29 | /// rasterized pdf pages rendering |
| 29 | typedef CustomPdfPagesBuilder = Widget Function( | 30 | typedef CustomPdfPagesBuilder = Widget Function( |
| @@ -15,6 +15,7 @@ | @@ -15,6 +15,7 @@ | ||
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | import 'package:flutter/material.dart'; | 17 | import 'package:flutter/material.dart'; |
| 18 | + | ||
| 18 | /// A class that holds rasterized pdf data | 19 | /// A class that holds rasterized pdf data |
| 19 | class PdfPreviewPageData { | 20 | class PdfPreviewPageData { |
| 20 | /// Default constructor | 21 | /// Default constructor |
| @@ -26,12 +27,14 @@ class PdfPreviewPageData { | @@ -26,12 +27,14 @@ class PdfPreviewPageData { | ||
| 26 | 27 | ||
| 27 | /// rasterized pdf image provider | 28 | /// rasterized pdf image provider |
| 28 | final ImageProvider image; | 29 | final ImageProvider image; |
| 30 | + | ||
| 29 | /// rasterized image width | 31 | /// rasterized image width |
| 30 | final int width; | 32 | final int width; |
| 33 | + | ||
| 31 | /// rasterized image height | 34 | /// rasterized image height |
| 32 | final int height; | 35 | final int height; |
| 33 | 36 | ||
| 34 | - /// returns with to height aspect ratio | 37 | + /// returns with to height aspect ratio |
| 35 | double get aspectRatio { | 38 | double get aspectRatio { |
| 36 | if (height != 0.0) { | 39 | if (height != 0.0) { |
| 37 | return width / height; | 40 | return width / height; |
-
Please register or login to post a comment