build method
Widget
build(
- BuildContext context,
- QuillController controller,
- Embed node,
- bool readOnly,
- bool inline,
- TextStyle textStyle,
Implementation
@override
Widget build(
BuildContext context,
QuillController controller,
Embed node,
bool readOnly,
bool inline,
TextStyle textStyle,
) {
assert(!kIsWeb, 'Please provide video EmbedBuilder for Web');
final videoUrl = node.value.data;
if (isYouTubeUrl(videoUrl)) {
return YoutubeVideoApp(
videoUrl: videoUrl,
readOnly: readOnly,
youtubeVideoSupportMode: configurations.youtubeVideoSupportMode,
);
}
final ((elementSize), margin, alignment) = getElementAttributes(
node,
context,
);
final width = elementSize.width;
final height = elementSize.height;
return Container(
width: width,
height: height,
margin: EdgeInsets.all(margin ?? 0.0),
alignment: alignment,
child: VideoApp(
videoUrl: videoUrl,
readOnly: readOnly,
onVideoInit: configurations.onVideoInit,
),
);
}