dom_tools library
DOM Tools Library
Classes
- AnyUriPolicy
- Allows anu Uri policy.
- CanvasImageViewer
- An image viewer that can render points, rectangles, clip and grid over.
- Color
- Represents a color.
- CSSAnimationConfig
- CSSAnimationConfigElements
- CSS animation configuration for a List<Element>.
- CSSAnimationConfigGroup
- CSS animation configuration for a group of CSSAnimationConfig.
- CSSThemeSet
- A Theme set, with multiples themes.
- CSSValueBase
- DataAssets
-
A collections of assets (DataURL, Blob, MediaSource) that can be accessed
by an
ObjectURL
, avoiding usage and encoding to data URL (base64). - DataStorage
- Represents a persistent storage in the browser.
-
DOMTreeReferenceMap<
V> -
A
TreeReferenceMap
for DOM Nodes. - FilterResult
- Filter result.
- HSLColor
- A color represented using alpha, hue, saturation, and lightness.
- HSVColor
- A color represented using alpha, hue, saturation, and value.
- ImagePerspectiveFilter
- A filter that applies a perspective to an image.
- ImagePerspectiveFilterCache
- A cache for perspective filers.
- ImageScaledCache
- A cache for scaled images.
-
Label<
T extends num> - State
- A state stored in DataStorage.
- StorageValue
- Represents a value stored in State.
- StyleColor
- Specifies a CSS color.
- TextStyle
- Specifies a CSS text style.
- TrackElementInViewport
- Tracks a DOM Element to identify when its visible in viewport.
- TrackElementResize
- Tracks a DOM Element to identify when its size changes.
- TrackElementValue
- Tracks a DOM Element to identify when a value changes.
-
ViewerElement<
T> - Represents an element in the CanvasImageViewer.
Enums
- DataStorageType
- Type of DataStorage.
- EditionType
- The type of edition for CanvasImageViewer.
- FontStyle
- Specifies a CSS font style.
- FontWeight
- Specifies a CSS font weight.
- Quality
- Quality of an image.
- StateOperation
- State operation.
- TouchDeviceDetection
- Status type of touch device detection.
Extensions
Constants
-
codeTheme0
→ const Map<
String, TextStyle> -
codeTheme1
→ const Map<
String, TextStyle> -
codeTheme2
→ const Map<
String, TextStyle> - cssMaxZIndex → const int
Properties
- codeTheme → CSSThemeSet
-
final
- deviceHeight → int?
-
no setter
- deviceWidth → int?
-
no setter
- isExtraLargeDevice → bool
-
no setter
- isExtraSmallDevice → bool
-
no setter
- isLargeDevice → bool
-
no setter
- isLargeDeviceOrHigher → bool
-
no setter
- isLargeDeviceOrLower → bool
-
no setter
- isMediumDevice → bool
-
no setter
- isMediumDeviceOrLHigher → bool
-
no setter
- isMediumDeviceOrLower → bool
-
no setter
- isSmallDevice → bool
-
no setter
- isSmallDeviceOrHigher → bool
-
no setter
- isSmallDeviceOrLower → bool
-
no setter
-
onDetectTouchDevice
→ EventStream<
TouchDeviceDetection> -
Will fire a TouchDeviceDetection when detection finishes.
final
Functions
-
addCSSCode(
String cssCode) → Future< bool> -
Adds a CSS code (
cssCode
) into DOM. -
addCssSource(
String cssSource, {int? insertIndex}) → Future< bool> -
Add a CSS path using a
link
element intohead
DOM node. -
addElementsClasses(
Iterable< Element> elements, Iterable<String> classes) → bool -
Add to
elements
a set ofclasses
. Will remove classes starting with '!'. -
addJavaScriptCode(
String scriptCode) → Future< bool> -
Adds a JavaScript code (
scriptCode
) into DOM. -
addJavaScriptSource(
String scriptSource, {bool addToBody = false, bool async = false}) → Future< bool> -
Adds a JavaScript path (
scriptSource
] into DOM. -
addJSFunction(
String name, List< String> parameters, String body) → Future<bool> - Adds a JavaScript function into DOM.
-
animateCSSSequence(
Iterable< CSSAnimationConfig> animationsConfig, {Duration? initialDelay, int? repeat, bool? repeatInfinity}) → Future<void> ? -
Sames
animateCSS
but runsanimationsConfig
in sequence; -
appendElementInnerHTML(
Element element, String html, {NodeValidator? validator}) → void -
Appends to the inner HTML of
element
with parsed result ofhtml
. -
applyCSS(
CssStyleDeclaration css, Element element, [List< Element> ? extraElements]) → bool -
Applies
css
toelement
andextraElements
list if present. -
applyPerspective(
CanvasImageSource image, List< Point< perspective) → FilterResult?num> > -
Apply
perspective
filter toimage
. -
asCssStyleDeclaration(
dynamic css) → CssStyleDeclaration -
Parses dynamic
css
as CssStyleDeclaration. -
blockHorizontalScrollTraverse(
Element element) → void -
Blocks a scroll event in the horizontal direction that traverses the
element
. -
blockHorizontalScrollTraverseEvent(
Element element, WheelEvent wheelEvent) → bool -
Blocks a
wheelEvent
in the horizontal direction that traverses theelement
. -
blockScrollTraverse(
Element element) → void -
Blocks a scroll event in the vertical and horizontal directions that traverses the
element
. -
blockVerticalScrollTraverse(
Element element) → void -
Blocks a scroll event in the vertical direction that traverses the
element
. -
blockVerticalScrollTraverseEvent(
Element element, WheelEvent wheelEvent) → bool -
Blocks a
wheelEvent
in the vertical direction that traverses theelement
. -
buildMetaContent(
Map< String, String?> map) → String -
Builds a
meta
content frommap
. -
callJSFunction(
String method, [List? args]) → dynamic -
Calls JavaScript a function
method
withargs
. -
callJSObjectMethod(
Object o, String method, [List? args]) → dynamic -
Calls JavaScript a
method
in objecto
withargs
. -
canvasToImageElement(
CanvasElement canvas, [String? mimeType, num? quality]) → ImageElement -
Converts
canvas
to ImageElement -
clearSelections(
) → void - Clears selected text in vieport.
-
copyElementToClipboard(
Element element) → bool -
Copies
element
text to Clipboard. -
copyPoints(
List< Point< points) → List<num> >Point< num> > -
Makes a copy of
points
. -
createDiv(
[bool inline = false, String? html, NodeValidator? validator]) → DivElement -
Creates a
div
.inline
Iftrue
setsdisplay: inline-block
.html
The HTML to parse as content. -
createDivInline(
[String? html]) → DivElement -
Creates a
div
withdisplay: inline-block
. -
createDivInlineBlock(
) → DivElement -
Creates a
div
withdisplay: inline-block
. -
createHTML(
[String? html, NodeValidator? validator]) → Element - Creates a HTML Element. Returns 1st node form parsed HTML.
-
createImageElementFromBase64(
String? base64, [String? mimeType]) → ImageElement? -
Creates an image from a Base-64 with
mimeType
. -
createImageElementFromFile(
File file) → Future< ImageElement> -
Creates an image from a
file
. -
createLabel(
[String? html, NodeValidator? validator]) → LabelElement -
Creates a
label
element. -
createScaledImage(
CanvasImageSource image, int width, int height, double scale) → CanvasImageSource -
Creates a new image from
image
, ofwidth
andheight
, to ascale
. -
createSpan(
[String? html, NodeValidator? validator]) → SpanElement -
Creates a
span
element. -
createStandardNodeValidator(
{bool svg = true, bool allowSvgForeignObject = false}) → NodeValidatorBuilder -
cropImage(
CanvasImageSource image, int x, int y, int width, int height) → CanvasElement? -
Crops the
image
using coordinatesx
,y
,width
andheight
, returning new image (CanvasElement). -
cropImageByRectangle(
CanvasImageSource image, Rectangle< num> ? crop) → CanvasElement? -
Crops an image using a Rectangle (
crop
), delegating to method cropImage, -
dataURLToBlob(
DataURLBase64 dataURL) → Blob -
Converts a
dataURL
to a Blob. -
defineCSS(
CssStyleDeclaration? currentCSS, CssStyleDeclaration? appendCSS, [dynamic defaultCSS]) → CssStyleDeclaration -
Defines a new CssStyleDeclaration merging
currentCSS
andappendCSS
. -
detectTouchDevice(
) → TouchDeviceDetection? - Starts touch device detection. Returns the current status.
-
disableDoubleClicks(
) → void - Disables browser double clicks/tap.
-
disableScrolling(
) → void - Disables scrolling in browser.
-
disableZooming(
) → void - Disables browser zooming.
-
downloadBlob(
Blob blob, String fileName) → void -
Downloads
blob
of typemimeType
, saving a file withfileName
. -
downloadBytes(
List< int> bytes, MimeType mimeType, String fileName) → void -
Downloads
bytes
of typemimeType
, saving a file withfileName
. -
downloadContent(
List< String> content, MimeType mimeType, String fileName) → void -
Downloads
content
of typemimeType
, saving a file withfileName
. -
downloadDataURL(
DataURLBase64 dataURL, String fileName) → void -
Downloads
dataURL
, saving a file withfileName
. -
elementMatchesAttribute(
Element element, String attributeName, dynamic attributeValue) → bool -
Returns
true
ifelement
matchesattributeName
andattributeValue
. -
elementMatchesAttributes(
Element element, Map< String, dynamic> attributes) → bool -
Returns
true
ifelement
matchesattributes
. -
elementOnLoad(
ImageElement img) → Future< bool> -
Returns a Future<bool> for when
img
loads. -
enableScrolling(
) → void - Enables scrolling in browser.
-
evalJS(
String scriptCode) → dynamic -
Call
eval()
with the content ofscriptCode
and returns the result. -
getAllCssRuleBySelector(
Pattern targetSelector, CssStyleSheet? sheet) → List< CssRule> -
Returns a List<CssRule> for
targetSelector
. -
getAllCssStyleSheet(
) → List< CssStyleSheet> - Returns all current CssStyleSheet.
-
getAllMediaCssRule(
String mediaCondition) → List< CssMediaRule> -
Returns a list of @media CssRule with
mediaCondition
. -
getAllOutOfViewportMediaCssRule(
int viewportWidth, dynamic viewportHeight) → List< CssMediaRule> -
Returns all CssMediaRule not applied for
viewportWidth
andviewportHeight
. -
getAllOutOfViewportMediaCssRuleAsClassRule(
int viewportWidth, dynamic viewportHeight, String targetClass) → List< String> -
Transforms all CssMediaRule to
targetClass
rule not applied forviewportWidth
andviewportHeight
. -
getAllViewportMediaCssRule(
int viewportWidth, dynamic viewportHeight) → List< CssMediaRule> -
Returns all CssMediaRule applied for
viewportWidth
viewportHeight
. -
getAllViewportMediaCssRuleAsClassRule(
int viewportWidth, dynamic viewportHeight, String targetClass) → List< String> -
Transforms all CssMediaRule to
targetClass
rule applied forviewportWidth
andviewportHeight
. -
getAnchorElementByHREF(
String href) → AnchorElement? -
Selects an AnchorElement in DOM with
href
. -
getComputedStyle(
{Element? parent, Element? element, String? classes, String? style, }) → CssStyleDeclaration - Returns a CssStyleDeclaration from an element.
-
getElementAllCssProperties(
Element element) → List< String> -
Returns a list of CSS properties associated with
element
-
getElementAllCssRule(
Element element) → List< CssRule> -
Returns a list of CssRule associated with
element
. -
getElementAttribute(
Element element, Object? key) → String? -
Returns
element
attribute withkey
. -
getElementAttributeRegExp(
Element element, RegExp key) → String? -
Returns
element
attribute with RegExpkey
. -
getElementAttributeStr(
Element element, String key) → String? -
Returns
element
attribute with Stringkey
. -
getElementByHREF(
String tag, String href) → Element? -
Selects an Element in DOM with
tag
andhref
. -
getElementBySRC(
String tag, String src) → Element? -
Selects an Element in DOM with
tag
andsrc
. -
getElementByValues<
V> (String tag, ElementValueGetter getter, List< V> values, [ElementValueGetter? getter2, List<V> ? values2]) → Element? -
selects in DOM an Element with
tag
and one ofvalues
provided bygetter
. -
getElementDocumentPosition(
Element element) → Pair< num> - Returns the X and Y position of Element int the Document.
-
getElementHeight(
Element element, [int? def]) → int? -
Returns
element
height. Tries to use 'offsetHeight' or 'style.height' values. -
getElementHREF(
Element element) → String? -
Returns
href
value for different Element types. -
getElementPreComputedStyle(
Element element) → CssStyleDeclaration -
Returns a CssStyleDeclaration of the pre-computed CSS properties of
element
. -
getElementSRC(
Element element) → String? -
Returns
src
value for different Element types. -
getElementsWithAttributes(
String tag, Map< String, dynamic> matchAttributes) → List<Element> -
Selects elements from DOM with
tag
and matches attribute. -
getElementTagName(
Node node) → String? -
Returns the
node
tag name. Returns null ifnode
is not an Element. -
getElementValue(
Element element, [String? def]) → String? -
Gets the
element
value depending of identified type. -
getElementWidth(
Element element, [int? def]) → int? -
Returns
element
width. Tries to use 'offsetWidth' or 'style.width' values. -
getElementZIndex(
Element? element, [String? def]) → String? -
Returns the
element
z-index
orelement.parent
z-index
recursively. -
getFileMimeType(
File file, [String accept = '']) → MimeType? -
Returns the
file
MimeType
. -
getImageDimension(
CanvasImageSource image) → Rectangle< int> ? -
Gets the width and height from
image
(CanvasImageSource). -
getLinkElementByHREF(
String href, [String? rel]) → LinkElement? -
Selects an LinkElement in DOM with
href
. -
getMetaTagsContentWithName(
String name) → List< String?> -
Returns a list of
meta
contet withname
. -
getMetaTagsWithName(
String name) → List< Element> -
Returns a list of
meta
Element withname
. -
getParentElement(
Element element, {bool validator(Element parent)?, int maxLevels = 1000}) → Element? -
Returns the parent of
element
applyingvalidator
andmaxLevels
. -
getScriptElementBySRC(
String src) → ScriptElement? -
Selects an ScriptElement in DOM with
src
. -
getURLData(
String url, {String? user, String? password, bool withCredentials = true}) → Future< Uint8List> -
Makes a HTTP request and returns
url
content as Uint8List. -
getVisibleNode(
Element? element) → Element? - Get the first visible element in the hierarchy.
-
htmlToText(
String html, [NodeValidator? validator]) → String? -
Transform
html
to plain text. -
isCssEmpty(
CssStyleDeclaration css) → bool -
Returns
true
if CssStyleDeclaration is empty. -
isCssNotEmpty(
CssStyleDeclaration css) → bool -
Returns
true
if CssStyleDeclaration is not empty. -
isElementWithHREF(
Element element) → bool -
Returns
true
ifelement
type can havehref
attribute. -
isElementWithSRC(
Element element) → bool -
Returns
true
ifelement
type can havesrc
attribute. -
isInDOM(
dynamic element) → bool -
Returns
true
ifelement
is in DOM tree. -
isInlineElement(
DivElement element, {bool checkBootstrapClasses = true}) → bool -
Returns
true
ifelement
display
property is inline. -
isInViewport(
Element element, {bool fully = false}) → bool -
Returns
true
ifelement
is visible in viewport. -
isMobileAppStatusBarTranslucent(
) → bool -
Returns
true
ifmeta
tag of nameapple-mobile-web-app-status-bar-style
istranslucent
. -
isNodeInDOM(
Node node) → bool -
Returns
true
ifnode
is in DOM tree. -
isOrientationInLandscapeMode(
) → bool -
Returns
true
if device orientation is in Landscape mode. -
isOrientationInPortraitMode(
) → bool -
Returns
true
if device orientation is in Portrait mode. -
isSafariIOS(
) → bool -
jsArrayToList(
JsArray? a) → List? -
Converts a JsArray
a
to a List. Also converts values using jsToDart. -
jsObjectKeys(
JsObject o) → List< String> -
Returns the keys of JsObject
o
. -
jsObjectToMap(
JsObject? o) → Map? -
Converts a JsObject
o
to a Map. Also converts keys and values using jsToDart. -
jsToDart(
Object? o) → Object? -
Converts
o
to Dart primitives or collections. -
lerpDouble(
num a, num b, double t) → double? -
loadCSS(
String cssClassPrefix, Map< String, CSSValueBase> ? css) → void -
Loads
css
dynamically. -
mapJSFunction(
String jsFunctionName, MappedFunction f) → void - Maps a JavaScript function to a Dart function.
-
markdownToDiv(
String markdown, {bool normalize = true, Iterable< BlockSyntax> ? blockSyntaxes, Iterable<InlineSyntax> ? inlineSyntaxes, ExtensionSet? extensionSet, Resolver? linkResolver, Resolver? imageLinkResolver, bool inlineOnly = false}) → DivElement -
Converts a
markdown
document into a HTML in a div node. -
markdownToHtml(
String markdown, {bool normalize = true, Iterable< BlockSyntax> ? blockSyntaxes, Iterable<InlineSyntax> ? inlineSyntaxes, ExtensionSet? extensionSet, Resolver? linkResolver, Resolver? imageLinkResolver, bool inlineOnly = false}) → String -
Converts a
markdown
document into a HTML string. -
measureText(
String text, {required String fontFamily, required Object fontSize, bool bold = false}) → Dimension? -
nodeTreeContains(
Node rootNode, Node target) → bool -
Returns
true
ifrootNode
containstarget
. -
nodeTreeContainsAny(
Node rootNode, Iterable< Node> list) → bool -
Returns
true
ifrootNode
contains any Node inlist
. -
normalizeIndent(
String text) → String - Normalizes a indent, removing the common/global indent of the code.
-
numsToPoints(
List< num> perspective) → List<Point< num> > - Converts a List<num>, as pairs, to a List<Point>.
-
onOrientationchange(
EventListener listener) → bool -
Attaches
listener
toorientationchange
event. -
parseCSSLength(
String cssValue, {String? unit, int? def, bool allowPXWithoutSuffix = false}) → num? -
Parses a CSS length, using optional
unit
. -
parseCssRuleSelectors(
CssRule cssRule) → List< String> -
Parses the selectors of
cssRule
. -
parseCssRuleTextProperties(
String? cssRuleText) → String - Returns a list of properties of the CssRule text.
-
parseCssRuleTextSelectors(
String? cssRuleText) → List< String> - Returns a list of selectors of the CssRule text.
-
parseMetaContent(
String content) → Map< String, String?> -
Parses a
meta
content to Map<String,String>. -
prefetchHref(
String href, {int? insertIndex, bool? preLoad}) → Future< bool> -
Prefetch a HREF using a
link
element intohead
DOM node. -
readFileDataAsArrayBuffer(
File file) → Future< Uint8List?> -
Reads
file
as Uint8List. -
readFileDataAsBase64(
File file) → Future< String?> -
Reads
file
as Base64 String. -
readFileDataAsDataURLBase64(
File file, [String accept = '']) → Future< String?> -
Reads
file
as DATA URL Base64 String. -
readFileDataAsText(
File file) → Future< String?> -
Reads
file
as text. -
readFileInputElementAsArrayBuffer(
FileUploadInputElement? input, [bool removeExifFromImage = false]) → Future< Uint8List?> -
Reads selected file of
input
as Uint8List. -
readFileInputElementAsBase64(
FileUploadInputElement? input, [bool removeExifFromImage = false]) → Future< String?> -
Reads selected file of
input
as Base64. -
readFileInputElementAsDataURLBase64(
FileUploadInputElement? input, [bool removeExifFromImage = false]) → Future< String?> -
Reads selected file of
input
as DATA URL Base64. -
readFileInputElementAsString(
FileUploadInputElement? input, [bool removeExifFromImage = false]) → Future< String?> -
Reads selected file of
input
as String. -
redirectOnTouchEndToMouseEvent(
Element element) → void -
Redirects
element.onTouchEnd
toelement.onMouseUp
as MouseEvent. -
redirectOnTouchMoveToMouseEvent(
Element element) → void -
Redirects
element.onTouchMove
toelement.onMouseMove
as MouseEvent. -
redirectOnTouchStartToMouseEvent(
Element element) → void -
Redirects
element.onTouchStart
toelement.onMouseDown
as MouseEvent. -
reloadAssets(
Map< String, String> assetsURLAndTag, {Duration? timeout}) → Future<bool> - Reloads an asset (img, audi or video), forcing reload of asset URL.
-
reloadIframe(
IFrameElement iFrame, [bool? forceGet]) → Future< bool> - Reloads an IFrame document.
-
removeElementBackgroundBlur(
Element element, [int? blurSize]) → void -
Removes
element
background blur effect, set by setElementBackgroundBlur. -
removeElementScrollColors(
Element element) → List< String> ? -
Removes
element
scroll colors CSS properties set by setElementScrollColors. -
removeExifFromImageFile(
File file) → Future< String?> -
Removes Exif from JPEG
file
. -
replaceElement(
Node n1, Node n2) → bool -
Replaces
n1
withn2
inn1
parent. -
resetZoom(
) → void - Resets viewport zoom.
-
rotateCanvasImageSource(
CanvasImageSource image, int width, int height, [dynamic angleDegree = 90]) → CanvasElement -
Rotates
image
(a CanvasImageSource) withangleDegree
. -
rotateImageElement(
ImageElement image, [dynamic angleDegree = 90]) → CanvasElement -
Rotates
image
withangleDegree
. -
scalePoints(
List< Point< points, double scale) → List<num> >Point< num> > -
Scales
points
toscale
. -
scalePointsXY(
List< Point< points, double scaleX, double scaleY) → List<num> >Point< num> > -
Scales
points
toscaleX
andscaleY
. -
scrollTo(
num? x, num? y, {bool smooth = true, int? delayMs, Object? scrollable}) → void -
Scrolls viewport to
x
,y
. -
scrollToBottom(
{bool smooth = true, int? delayMs}) → void - Scrolls viewport to the bottom.
-
scrollToElement(
Element element, {bool centered = true, bool vertical = true, bool horizontal = true, bool smooth = true, int? translateX, int? translateY, Object? scrollable}) → void -
Scrolls the viewport to the
element
. -
scrollToLeft(
{bool smooth = true, int? delayMs}) → void - Scrolls viewport to the left border.
-
scrollToRight(
{bool smooth = true, int? delayMs}) → void - Scrolls viewport to the right border.
-
scrollToTop(
{bool smooth = true, int y = 0, bool fixSafariIOS = false, int? delayMs}) → void - Scrolls viewport to the top.
-
scrollToTopDelayed(
int delayMs) → void - Use scrollToTop instead.
-
selectCssRuleWithSelector(
Pattern targetSelector) → List< CssRule> -
Returns a list of CssRule with
targetSelector
patterns. -
setDivCentered(
DivElement div, {bool centerVertically = true, bool centerHorizontally = true, bool checkBootstrapClasses = true}) → void -
Sets
div
as centered content, usingdisplay
property astable
and sub div elementsdisplay
property astable-cell
. -
setElementBackgroundBlur(
Element element, [int? blurSize]) → void -
Sets
element
background as a blur effect of sizeblurSize
. Uses CSS propertybackdrop-filter
. -
setElementHREF(
Element element, String href) → bool -
Sets
element
href
depending of the identified type. -
setElementInnerHTML(
Element element, String html, {NodeValidator? validator}) → void -
Sets the inner HTML of
element
with parsed result ofhtml
. -
setElementScrollColors(
Element element, int scrollWidth, String scrollButtonColor, [String? scrollBgColor]) → String? -
Sets
element
scroll colors, using standard CSS propertyscrollbar-color
and webkit pseudo element::-webkit-scrollbar-thumb
and::-webkit-scrollbar-track
-
setElementSRC(
Element element, String src) → bool -
Sets the
element
src
depending of the identified type. -
setElementValue(
Element? element, String value) → bool -
Sets the
element
value
depending of the identified type. -
setMetaViewportScale(
{String? minimumScale, String? maximumScale}) → bool -
Sets the
meta
viewport withminimumScale
andmaximumScale
. -
setTreeElementsBackgroundBlur(
Element element, String className) → void -
setTreeElementsDivCentered(
Element element, String className, {bool centerVertically = true, bool centerHorizontally = true}) → void -
Set all
element
sub div withclassName
to centered content. -
setZoom(
String zoom) → void -
Sets the viewport
zoom
. -
showDialogElement(
Element content, {double? transparency, String? padding}) → DivElement - Shows an Element dialog.
-
showDialogHTML(
String? html, {double? transparency, String? padding, NodeValidator? validator}) → DivElement? -
Shows a
html
dialog. -
showDialogImage(
String src) → void -
Shows an image (
src
) dialog. -
showDialogText(
String? text, {double? transparency, String? padding}) → DivElement? - Shows a text dialog.
-
toCanvasElement(
CanvasImageSource imageSource, int width, int height) → CanvasElement -
Converts
imageSource
to CanvasElement. -
toDataURLBase64(
String? mediaType, String base64) → String - Builds a DATA URL string.
-
toHTML(
Element element) → String -
Converts
element
to HTML. -
touchEventToMouseEvent(
TouchEvent event) → MouseEvent? -
Converts a TouchEvent
event
to a MouseEvent. -
translatePoints(
List< Point< points, num x, num y) → List<num> >Point< num> > -
Translate
pints
inx
andy
.
Typedefs
- AnimationCallback = void Function()
-
ElementValueGetter<
T> = T? Function(Element element) - Returns a value from an Element.
- FunctionTest = bool Function()
- ImageFilter = CanvasImageSource Function(CanvasImageSource? image, int width, int height)
-
Applies a filter to
image
, ofwidth
andheight
. - MappedFunction = dynamic Function(dynamic o)
- MatchesValue = bool Function(String value)
- OnElementEvent = void Function(Element element)
-
OnElementTrackValueEvent<
T> = bool Function(Element element, T? value) - StateEventListener = void Function(StateOperation op, State state, String key, dynamic value)
- StateKeyListener = void Function(dynamic value)
-
ValueCopier<
T> = T? Function(T? value)