Link constructor
Link({
- required String href,
- PrefetchMode prefetch = PrefetchMode.off,
- String? text,
- String? className,
- String? style,
- Map<
String, String> ? attrs, - List<
BloomNode> children = const [], - Map<
String, BloomEventHandler> ? on, - BloomEventHandler? onClick,
Creates a hyperlink element targeting href with optional prefetch behavior.
Implementation
Link({
required String href,
this.prefetch = PrefetchMode.off,
super.text,
super.className,
super.style,
Map<String, String>? attrs,
super.children = const [],
Map<String, BloomEventHandler>? on,
BloomEventHandler? onClick,
}) : super(
'a',
attrs: {
'href': href,
if (prefetch == PrefetchMode.visible)
'data-bloom-prefetch': 'visible',
if (attrs != null) ...attrs,
},
on: _buildHandlers(
href: href,
prefetch: prefetch,
on: on,
onClick: onClick,
),
);