8000 Merge branch 'master' into fix/device-pixel-ratio · Sub6Resources/flutter_html@1ed9643 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1ed9643

Browse files
Merge branch 'master' into fix/device-pixel-ratio
2 parents 1802309 + 6571e3b commit 1ed9643

File tree

8 files changed

+415
-365
lines changed

8 files changed

+415
-365
lines changed

lib/custom_render.dart

Lines changed: 11 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -154,84 +154,20 @@ CustomRender blockElementRender({Style? style, List<InlineSpan>? children}) =>
154154
});
155155

156156
CustomRender listElementRender(
157-
{Style? style, Widget? child, List<InlineSpan>? children}) =>
158-
CustomRender.inlineSpan(
159-
inlineSpan: (context, buildChildren) => WidgetSpan(
160-
child: CssBoxWidget(
157+
{Style? style, Widget? child, List<InlineSpan>? children}) {
158+
return CustomRender.inlineSpan(
159+
inlineSpan: (context, buildChildren) {
160+
return WidgetSpan(
161+
child: CssBoxWidget.withInlineSpanChildren(
161162
key: context.key,
162-
style: style ?? context.tree.style,
163+
style: style ?? context.style,
163164
shrinkWrap: context.parser.shrinkWrap,
164-
child: Row(
165-
crossAxisAlignment: CrossAxisAlignment.start,
166-
mainAxisSize: MainAxisSize.min,
167-
textDirection: style?.direction ?? context.tree.style.direction,
168-
children: [
169-
(style?.listStylePosition ??
170-
context.tree.style.listStylePosition) ==
171-
ListStylePosition.outside
172-
? Padding(
173-
padding: style?.padding?.nonNegative ??
174-
context.tree.style.padding?.nonNegative ??
175-
EdgeInsets.only(
176-
left: (style?.direction ??
177-
context.tree.style.direction) !=
178-
TextDirection.rtl
179-
? 10.0
180-
: 0.0,
181-
right: (style?.direction ??
182-
context.tree.style.direction) ==
183-
TextDirection.rtl
184-
? 10.0
185-
: 0.0),
186-
child:
187-
style?.markerContent ?? context.style.markerContent)
188-
: const SizedBox(height: 0, width: 0),
189-
const Text("\u0020",
190-
textAlign: TextAlign.right,
191-
style: TextStyle(fontWeight: FontWeight.w400)),
192-
Expanded(
193-
child: Padding(
194-
padding: (style?.listStylePosition ??
195-
context.tree.style.listStylePosition) ==
196-
ListStylePosition.inside
197-
? EdgeInsets.only(
198-
left: (style?.direction ??
199-
context.tree.style.direction) !=
200-
TextDirection.rtl
201-
? 10.0
202-
: 0.0,
203-
right: (style?.direction ??
204-
context.tree.style.direction) ==
205-
TextDirection.rtl
206-
? 10.0
207-
: 0.0)
208-
: EdgeInsets.zero,
209-
child: CssBoxWidget.withInlineSpanChildren(
210-
children: _getListElementChildren(
211-
style?.listStylePosition ??
212-
context.tree.style.listStylePosition,
213-
buildChildren)
214-
..insertAll(
215-
0,
216-
context.tree.style.listStylePosition ==
217-
ListStylePosition.inside
218-
? [
219-
WidgetSpan(
220-
alignment: PlaceholderAlignment.middle,
221-
child: style?.markerContent ??
222-
context.style.markerContent ??
223-
const SizedBox(height: 0, width: 0))
224-
]
225-
: []),
226-
style: style ?? context.style,
227-
),
228-
),
229-
),
230-
],
231-
),
165+
children: buildChildren(),
232166
),
233-
),
234-
);
167+
);
168+
},
169+
);
170+
}
235171

236172
CustomRender replacedElementRender(
237173
{PlaceholderAlignment? alignment,
@@ -517,20 +453,6 @@ Map<CustomRenderMatcher, CustomRender> generateDefaultRenders() {
517453
};
518454
}
519455

520-
List<InlineSpan> _getListElementChildren(
521-
ListStylePosition? position, Function() buildChildren) {
522-
List<InlineSpan> children = buildChildren.call();
523-
if (position == ListStylePosition.inside) {
524-
const tabSpan = WidgetSpan(
525-
child: Text("\t",
526-
textAlign: TextAlign.right,
527-
style: TextStyle(fontWeight: FontWeight.w400)),
528-
);
529-
children.insert(0, tabSpan);
530-
}
531-
return children;
532-
}
533-
534456
InlineSpan _getInteractableChildren(RenderContext context,
535457
InteractableElement tree, InlineSpan childSpan, TextStyle childStyle) {
536458
if (childSpan is TextSpan) {

0 commit comments

Comments
 (0)
0