Closed NicolasLaube closed 1 year ago
This isn't a feature request... I just wanted to add this remark because it took me a few minutes to figure out how to center a custom tag.
Say you have a custom tag.
To center the widget associated with this tag, just add: alignment: PlaceholderAlignment.middle to your custom WidgetSpan.
alignment: PlaceholderAlignment.middle
WidgetSpan
For example:
class DropPassiveNode extends SpanNode { final Map<String, String> attribute; DropPassiveNode(this.attribute); @override InlineSpan build() { final String identification = attribute['id'] ?? ''; return WidgetSpan( child: GapDropPassive(identification), alignment: PlaceholderAlignment.middle, ); } } SpanNodeGeneratorWithTag GENERATOR_DROP_PASSIVE = SpanNodeGeneratorWithTag( tag: _dropTag, generator: (e, config, visitor) => DropPassiveNode(e.attributes), ); `` I hope it might help someone :)
This isn't a feature request... I just wanted to add this remark because it took me a few minutes to figure out how to center a custom tag.
Say you have a custom tag.
To center the widget associated with this tag, just add:
alignment: PlaceholderAlignment.middle
to your customWidgetSpan
.For example: