createSpan method
InlineSpan
createSpan({
- required BuildContext context,
- String? text,
- String? textContent,
- List<
InlineSpan> ? children, - required Map<
String?, String?> attributes, - GestureRecognizer? recognizer,
override
Implementation
@override
InlineSpan createSpan({
required BuildContext context,
String? text,
String? textContent,
List<InlineSpan>? children,
required Map<String?, String?> attributes,
GestureRecognizer? recognizer,
}) {
Widget widget = builder(context, attributes, textContent);
if (size != null) {
widget = SizedBox(
width: (size!.width == double.infinity) ? null : size!.width,
height: (size!.height == double.infinity) ? null : size!.height,
child: widget,
);
}
if (constraints != null) {
widget = ConstrainedBox(
constraints: constraints!,
child: widget,
);
}
final InlineSpan span = TextSpan(
children: [
WidgetSpan(
child: widget,
alignment: alignment,
baseline: baseline,
// style: TextStyle(backgroundColor: backgroundColor),
),
],
);
return span;
}