LexicalEmbedView class

A card standing in for an embedded video, tweet or Figma document.

It is a card, not a player. Playing a video in Flutter means a platform view and a plugin dependency, and a document package that dragged one in would impose it on everyone who merely wanted to read a document containing a video. The card carries the thumbnail, the title and a tap target; onOpen decides what happens next, and an application that does want an inline player can build its own widget and register it in place of this one.

Inheritance

Constructors

LexicalEmbedView({required EmbedKind kind, required String id, required String url, Key? key, String? label, EmbedOpener? onOpen, EmbedThumbnailResolver thumbnailResolver = defaultEmbedThumbnailResolver, double maxWidth = 560, Color accentColor = const Color(0xFF4DA3FF), Color surfaceColor = const Color(0x14808DAD), Color textColor = const Color(0xFF0B1020), Color mutedTextColor = const Color(0xFF808DAD)})
Draws a card for the embed id of kind, linking to url.
const

Properties

accentColor Color
The colour of the play badge.
final
hashCode int
The hash code for this object.
no setterinherited
id String
The stored identifier.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
kind EmbedKind
What kind of embed this is.
final
label String?
A title to show instead of the URL, when the application knows one.
final
maxWidth double
The widest the card is drawn.
final
mutedTextColor Color
The colour of the second line.
final
onOpen EmbedOpener?
Called when the card is tapped. A card with no opener is not tappable.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
surfaceColor Color
The card's background.
final
textColor Color
The colour of the title.
final
thumbnailResolver EmbedThumbnailResolver
Finds the still image, if there is one.
final
url String
Where a tap should lead.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited