dom_tools library

DOM Tools library.

Classes

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 extends Object>
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.
JS
An annotation on a JavaScript interop declaration.
JSExport
Annotation to allow Dart classes to be wrapped with a JS object using dart:js_interop's createJSInteropWrapper.
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.

Extension Types

ExternalDartReference
An opaque reference to a Dart object that can be passed to JavaScript.
JSAny
A non-nullish JavaScript value.
JSArray
A JavaScript Array.
JSArrayBuffer
A JavaScript ArrayBuffer.
JSArrayUtil
JSBigInt
A JavaScript BigInt.
JSBoolean
A JavaScript boolean.
JSBoxedDartObject
A Dart object that is wrapped with a JavaScript object so that it can be passed to JavaScript safely.
JSDataView
A JavaScript DataView.
JSDate
JSExportedDartFunction
A JavaScript callable function created from a Dart function.
JSFloat32Array
A JavaScript Float32Array.
JSFloat64Array
A JavaScript Float64Array.
JSFunction
A JavaScript Function value.
JSInt16Array
A JavaScript Int16Array.
JSInt32Array
A JavaScript Int32Array.
JSInt8Array
A JavaScript Int8Array.
JSNumber
A JavaScript number.
JSObject
A JavaScript Object.
JSObjectUtil
JSPromise
A JavaScript Promise or a promise-like object.
JSString
A JavaScript string.
JSSymbol
A JavaScript Symbol.
JSTypedArray
Abstract supertype of all JavaScript typed arrays.
JSUint16Array
A JavaScript Uint16Array.
JSUint32Array
A JavaScript Uint32Array.
JSUint8Array
A JavaScript Uint8Array.
JSUint8ClampedArray
A JavaScript Uint8ClampedArray.

Extensions

BoolToJSBoolean on bool
Conversions from bool to JSBoolean.
ByteBufferToJSArrayBuffer on ByteBuffer
Conversions from ByteBuffer to JSArrayBuffer.
ByteDataToJSDataView on ByteData
Conversions from ByteData to JSDataView.
DateTimeToJSDateExtension on DateTime
DomElementExtension on Element
DoubleToJSNumber on double
Conversions from double to JSNumber.
ExternalDartReferenceToObject on ExternalDartReference<T>
Conversions from ExternalDartReference to the value of type T.
Float32ListToJSFloat32Array on Float32List
Conversions from Float32List to JSFloat32Array.
Float64ListToJSFloat64Array on Float64List
Conversions from Float64List to JSFloat64Array.
FunctionToJSExportedDartFunction on Function
Conversions from Function to JSExportedDartFunction.
FutureOfJSAnyToJSPromise on Future<T>
Conversions from Future to JSPromise where the Future returns a value.
FutureOfVoidToJSPromise on Future<void>
Conversions from Future to JSPromise where the Future does not return a value.
IDBRequestToFutureExtension on IDBRequest
Int16ListToJSInt16Array on Int16List
Conversions from Int16List to JSInt16Array.
Int32ListToJSInt32Array on Int32List
Conversions from Int32List to JSInt32Array.
Int8ListToJSInt8Array on Int8List
Conversions from Int8List to JSInt8Array.
IterableBoolExtension on Iterable<bool>
IterableDomElementExtension on Iterable<E>
IterableDoubleExtension on Iterable<double>
IterableExtension on Iterable<T>
IterableIntExtension on Iterable<int>
IterableJSAnyToJSArray on Iterable<T>
IterableNumExtension on Iterable<num>
IterableOfIterableExtension on Iterable<T>
IterableStringExtension on Iterable<String>
JSAnyExtension on JSAny
JSAnyNullableExtension on JSAny?
JSAnyOperatorExtension on JSAny?
General-purpose JavaScript operators.
JSAnyUtilityExtension on JSAny?
Common utility functions that are useful for any JavaScript value.
JSArrayBufferToByteBuffer on JSArrayBuffer
Conversions from JSArrayBuffer to ByteBuffer.
JSArrayExtension on JSArray<JSAny?>
JSArrayOfJSBigIntExtension on JSArray<JSBigInt>
JSArrayOfJSBooleanExtension on JSArray<JSBoolean>
JSArrayOfJSNumberExtension on JSArray<JSNumber>
JSArrayOfJSStringExtension on JSArray<JSString>
JSArrayToList on JSArray<T>
Conversions from JSArray to List.
JSBooleanToBool on JSBoolean
Conversions from JSBoolean to bool.
JSBoxedDartObjectToObject on JSBoxedDartObject
Conversions from JSBoxedDartObject to Object.
JSDataViewToByteData on JSDataView
Conversions from JSDataView to ByteData.
JSExportedDartFunctionToFunction on JSExportedDartFunction
Conversions from JSExportedDartFunction to Function.
JSFloat32ArrayToFloat32List on JSFloat32Array
Conversions from JSFloat32Array to Float32List.
JSFloat64ArrayToFloat64List on JSFloat64Array
Conversions from JSFloat64Array to Float64List.
JSFunctionUtilExtension on JSFunction
Utility extensions for JSFunction.
JSInt16ArrayToInt16List on JSInt16Array
Conversions from JSInt16Array to Int16List.
JSInt32ArrayToInt32List on JSInt32Array
Conversions from JSInt32Array to Int32List.
JSInt8ArrayToInt8List on JSInt8Array
Conversions from JSInt8Array to Int8List.
JSNumberToNumber on JSNumber
Conversions from JSNumber to double or int.
JSObjectExtension on JSObject
JSPromiseToFuture on JSPromise<T>
Conversions from JSPromise to Future.
JSStringToString on JSString
Conversions from JSString to String.
JSUint16ArrayToUint16List on JSUint16Array
Conversions from JSUint16Array to Uint16List.
JSUint32ArrayToUint32List on JSUint32Array
Conversions from JSUint32Array to Uint32List.
JSUint8ArrayToUint8List on JSUint8Array
Conversions from JSUint8Array to Uint8List.
JSUint8ClampedArrayToUint8ClampedList on JSUint8ClampedArray
Conversions from JSUint8ClampedArray to Uint8ClampedList.
ListToJSArray on List<T>
Conversions from List to JSArray.
MapExtension on Map<K, V>
NullableObjectUtilExtension on Object?
Common utility functions for Object?s.
NullableUndefineableJSAnyExtension on JSAny?
Helper members to determine if a value is JavaScript undefined or null.
NumToJSExtension on num
Conversions from num to JSNumber.
ObjectExtension on Object?
ObjectToExternalDartReference on T
Conversions from a value of type T to ExternalDartReference.
ObjectToJSBoxedDartObject on Object
Conversions from Object to JSBoxedDartObject.
StringExtension on String
StringToJSString on String
Conversions from String to JSString.
Uint16ListToJSUint16Array on Uint16List
Conversions from Uint16List to JSUint16Array.
Uint32ListToJSUint32Array on Uint32List
Conversions from Uint32List to JSUint32Array.
Uint8ClampedListToJSUint8ClampedArray on Uint8ClampedList
Conversions from Uint8ClampedList to JSUint8ClampedArray.
Uint8ListExtension on Uint8List
Uint8ListToJSUint8Array on Uint8List
Conversions from Uint8List to JSUint8Array.

Constants

anonymous → const _Anonymous
An annotation that indicates a JS annotated class is structural and does not have a known JavaScript prototype.
codeTheme0 → const Map<String, TextStyle>
codeTheme1 → const Map<String, TextStyle>
codeTheme2 → const Map<String, TextStyle>
cssMaxZIndex → const int
staticInterop → const _StaticInterop
staticInterop enables the JS annotated class to be treated as a "static" interop class.

Properties

codeTheme CSSThemeSet
final
deviceHeight int?
no setter
deviceWidth int?
no setter
globalContext JSObject
The global scope that is used to find user-declared interop members.
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 into head DOM node.
addElementsClasses(Iterable<Element> elements, Iterable<String> classes) bool
Add to elements a set of classes. 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 runs animationsConfig in sequence;
appendElementInnerHTML(HTMLElement element, String html, {Object? validator, bool unsafe = false}) → void
Appends to the inner HTML of element with parsed result of html.
applyCSS(CSSStyleDeclaration css, Element element, [List<Element>? extraElements]) bool
Applies css to element and extraElements list if present.
applyPerspective(CanvasImageSource image, List<Point<num>> perspective) FilterResult?
Apply perspective filter to image.
asCssStyleDeclaration(Object? css) CSSStyleDeclaration
Parses dynamic css as CSSStyleDeclaration.
blockHorizontalScrollTraverse(HTMLElement element) → void
Blocks a scroll event in the horizontal direction that traverses the element.
blockHorizontalScrollTraverseEvent(HTMLElement element, WheelEvent wheelEvent) bool
Blocks a wheelEvent in the horizontal direction that traverses the element.
blockScrollTraverse(HTMLElement element) → void
Blocks a scroll event in the vertical and horizontal directions that traverses the element.
blockVerticalScrollTraverse(HTMLElement element) → void
Blocks a scroll event in the vertical direction that traverses the element.
blockVerticalScrollTraverseEvent(HTMLElement element, WheelEvent wheelEvent) bool
Blocks a wheelEvent in the vertical direction that traverses the element.
buildMetaContent(Map<String, String?> map) String
Builds a meta content from map.
callJSFunction(String method, [List<Object?>? args]) → dynamic
Calls JavaScript a function method with args.
callJSObjectMethod(JSObject o, String method, [List<Object?>? args]) → dynamic
Calls JavaScript a method in object o with args.
canvasToImageElement(HTMLCanvasElement canvas, [String? mimeType, num? quality]) HTMLImageElement
Converts canvas to HTMLImageElement
clearSelections() → void
Clears selected text in vieport.
copyElementToClipboard(Element element) bool
Copies element text to Clipboard.
copyPoints(List<Point<num>> points) List<Point<num>>
Makes a copy of points.
createBlobURL(Uint8List data, String mimeType) String
createDiv({bool inline = false, String? html, Object? validator, bool unsafe = false}) HTMLDivElement
Creates a div. inline If true sets display: inline-block. html The HTML to parse as content.
createDivInline({String? html, bool unsafe = false}) HTMLDivElement
Creates a div with display: inline-block.
createDivInlineBlock() HTMLDivElement
Creates a div with display: inline-block.
createElement({String? html, bool unsafe = false}) Element
Creates a HTML Element. Returns 1st node form parsed HTML.
createHTML({String? html, Object? validator, bool unsafe = false}) HTMLElement
Creates a HTMLElement. Returns 1st node form parsed HTML.
createImageElementFromBase64(String? base64, [String? mimeType]) HTMLImageElement?
Creates an image from a Base-64 with mimeType.
createImageElementFromFile(File file) Future<HTMLImageElement>
Creates an image from a file.
createJSInteropWrapper<T extends Object>(T dartObject, [JSObject? proto = null]) JSObject
Given a instance of a Dart class that contains an @JSExport annotation, creates a JavaScript object that wraps the given Dart object.
createLabel({String? html, Object? validator, bool unsafe = false}) HTMLLabelElement
Creates a label element.
createScaledImage(CanvasImageSource image, int width, int height, double scale) CanvasImageSource
Creates a new image from image, of width and height, to a scale.
createSpan({String? html, Object? validator, bool unsafe = false}) HTMLSpanElement
Creates a span element.
cropImage(CanvasImageSource image, int x, int y, int width, int height) HTMLCanvasElement?
Crops the image using coordinates x, y, width and height, returning new image (HTMLCanvasElement).
cropImageByRectangle(CanvasImageSource image, Rectangle<num>? crop) HTMLCanvasElement?
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 and appendCSS.
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 type mimeType, saving a file with fileName.
downloadBytes(List<int> bytes, MimeType mimeType, String fileName) → void
Downloads bytes of type mimeType, saving a file with fileName.
downloadContent(List<String> content, MimeType mimeType, String fileName) → void
Downloads content of type mimeType, saving a file with fileName.
downloadDataURL(DataURLBase64 dataURL, String fileName) → void
Downloads dataURL, saving a file with fileName.
elementMatchesAttribute(Element element, String attributeName, dynamic attributeValue) bool
Returns true if element matches attributeName and attributeValue.
elementMatchesAttributes(Element element, Map<String, dynamic> attributes) bool
Returns true if element matches attributes.
elementOnLoad(HTMLImageElement 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 of scriptCode 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 and viewportHeight.
getAllOutOfViewportMediaCssRuleAsClassRule(int viewportWidth, dynamic viewportHeight, String targetClass) List<String>
Transforms all CssMediaRule to targetClass rule not applied for viewportWidth and viewportHeight.
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 for viewportWidth and viewportHeight.
getAnchorElementByHREF(String href) HTMLAnchorElement?
Selects an AnchorElement in DOM with href.
getComputedStyle({Element? parent, HTMLElement? element, String? classes, String? style, bool? hidden}) 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 with key.
getElementAttributeRegExp(Element element, RegExp key) String?
Returns element attribute with RegExp key.
getElementAttributeStr(Element element, String key) String?
Returns element attribute with String key.
getElementBackdropFilter(Element element) String?
Returns the current backdrop-filter value (standard or prefixed).
getElementByHREF(String tag, String href) Element?
Selects an Element in DOM with tag and href.
getElementBySRC(String tag, String src) Element?
Selects an Element in DOM with tag and src.
getElementByValues<V>(String tag, ElementValueGetter getter, List<V> values, [ElementValueGetter? getter2, List<V>? values2]) Element?
selects in DOM an Element with tag and one of values provided by getter.
getElementDocumentPosition(HTMLElement element) → Pair<num>
Returns the X and Y position of Element int the Document.
getElementHeight(HTMLElement 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 if node is not an Element.
getElementValue(Element element, [String? def]) String?
Gets the element value depending of identified type.
getElementWidth(HTMLElement 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 or element.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]) HTMLLinkElement?
Selects an LinkElement in DOM with href.
getMetaTagsContentWithName(String name) List<String?>
Returns a list of meta contet with name.
getMetaTagsWithName(String name) List<Element>
Returns a list of meta Element with name.
getParentElement(Element element, {bool validator(Element parent)?, int maxLevels = 1000}) Element?
Returns the parent of element applying validator and maxLevels.
getScriptElementBySRC(String src) HTMLScriptElement?
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(HTMLElement? element) HTMLElement?
Get the first visible element in the hierarchy.
htmlToText(String html, [Object? validator]) String?
Transform html to plain text.
importModule(JSAny moduleName) JSPromise<JSObject>
Dynamically imports a JavaScript module with the given moduleName using the JavaScript import() syntax.
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 if element type can have href attribute.
isElementWithSRC(Element element) bool
Returns true if element type can have src attribute.
isInDOM(Object? element) bool
Returns true if element is in DOM tree.
isInlineElement(HTMLDivElement element, {bool checkBootstrapClasses = true}) bool
Returns true if element display property is inline.
isInViewport(Element element, {bool fully = false}) bool
Returns true if element is visible in viewport.
isMobileAppStatusBarTranslucent() bool
Returns true if meta tag of name apple-mobile-web-app-status-bar-style is translucent.
isNodeInDOM(Node node) bool
Returns true if node 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<JSAny?>? 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}) HTMLDivElement
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?
newCSSStyleDeclaration({String? cssText}) CSSStyleDeclaration
nodeTreeContains(Node rootNode, Node target) bool
Returns true if rootNode contains target.
nodeTreeContainsAny(Node rootNode, Iterable<Node> list) bool
Returns true if rootNode contains any Node in list.
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 to orientationchange 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 into head DOM node.
readFileDataAsArrayBuffer(File file) Future<Uint8List?>
Reads file as Uint8List.
readFileDataAsBase64(File file) Future<String?>
Reads file as Base64 String.
readFileDataAsBlobURL(File file, [String accept = '']) Future<String?>
Reads file as Blob URL.
readFileDataAsDataURLBase64(File file, [String accept = '']) Future<String?>
Reads file as DATA URL Base64 String.
readFileDataAsText(File file) Future<String?>
Reads file as text.
readFileInputElementAsArrayBuffer(HTMLInputElement? input, [bool removeExifFromImage = false]) Future<Uint8List?>
Reads selected file of input as Uint8List.
readFileInputElementAsBase64(HTMLInputElement? input, [bool removeExifFromImage = false]) Future<String?>
Reads selected file of input as Base64.
readFileInputElementAsBlobUrl(HTMLInputElement? input, [bool removeExifFromImage = false]) Future<String?>
Reads selected file of input and return a Blob URL.
readFileInputElementAsDataURLBase64(HTMLInputElement? input, [bool removeExifFromImage = false]) Future<String?>
Reads selected file of input as DATA URL Base64.
readFileInputElementAsString(HTMLInputElement? input, [bool removeExifFromImage = false]) Future<String?>
Reads selected file of input as String.
redirectOnTouchEndToMouseEvent(Element element) → void
Redirects element.onTouchEnd to element.onMouseUp as MouseEvent.
redirectOnTouchMoveToMouseEvent(Element element) → void
Redirects element.onTouchMove to element.onMouseMove as MouseEvent.
redirectOnTouchStartToMouseEvent(Element element) → void
Redirects element.onTouchStart to element.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(HTMLIFrameElement iFrame, [bool? forceGet]) Future<bool>
Reloads an IFrame document.
removeElementBackdropFilter(Element element) → void
Clears all backdrop-filter styles from the element.
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 with n2 in n1 parent.
resetZoom() → void
Resets viewport zoom.
revokeBlobURL(String blobUrl) → void
rotateCanvasImageSource(CanvasImageSource image, int width, int height, [dynamic angleDegree = 90]) HTMLCanvasElement
Rotates image (a CanvasImageSource) with angleDegree.
rotateImageElement(HTMLImageElement image, [dynamic angleDegree = 90]) HTMLCanvasElement
Rotates image with angleDegree.
scalePoints(List<Point<num>> points, double scale) List<Point<num>>
Scales points to scale.
scalePointsXY(List<Point<num>> points, double scaleX, double scaleY) List<Point<num>>
Scales points to scaleX and scaleY.
scrollTo(num? x, num? y, {bool smooth = true, int? delayMs, Object? scrollable}) → void
Scrolls viewport to x,y.
scrollToBottom({bool smooth = true, int? delayMs, Object? scrollable}) → void
Scrolls viewport to the bottom.
scrollToElement(HTMLElement 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, Object? scrollable}) → void
Scrolls viewport to the left border.
scrollToRight({bool smooth = true, int? delayMs, Object? scrollable}) → void
Scrolls viewport to the right border.
scrollToTop({bool smooth = true, int y = 0, bool fixSafariIOS = false, int? delayMs, Object? scrollable}) → 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(HTMLDivElement div, {bool centerVertically = true, bool centerHorizontally = true, bool checkBootstrapClasses = true}) → void
Sets div as centered content, using display property as table and sub div elements display property as table-cell.
setElementBackdropFilter(Element element, String filter) → void
Sets a backdrop-filter on the element, including Safari’s -webkit-backdrop-filter prefix. Example: "blur(3px)".
setElementBackgroundBlur(Element element, [int? blurSize]) → void
Sets element background as a blur effect of size blurSize. Uses CSS property backdrop-filter.
setElementHREF(Element element, String href) bool
Sets element href depending of the identified type.
setElementInnerHTML(HTMLElement element, String html, {Object? validator, bool unsafe = false}) → void
Sets the inner HTML of element with parsed result of html.
setElementScrollColors(Element element, int scrollWidth, String scrollButtonColor, [String? scrollBgColor]) String?
Sets element scroll colors, using standard CSS property scrollbar-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 with minimumScale and maximumScale.
setTreeElementsBackgroundBlur(Element element, String className) → void
setTreeElementsDivCentered(Element element, String className, {bool centerVertically = true, bool centerHorizontally = true}) → void
Set all element sub div with className to centered content.
setZoom(String zoom) → void
Sets the viewport zoom.
showDialogElement(HTMLElement content, {double? transparency, String? padding}) HTMLDivElement
Shows an Element dialog.
showDialogHTML(String? html, {double? transparency, String? padding, Object? validator, bool unsafe = false}) HTMLDivElement?
Shows a html dialog.
showDialogImage(String src) → void
Shows an image (src) dialog.
showDialogText(String? text, {double? transparency, String? padding}) HTMLDivElement?
Shows a text dialog.
toCanvasElement(CanvasImageSource imageSource, int width, int height) HTMLCanvasElement
Converts imageSource to HTMLCanvasElement.
toDataURLBase64(String? mediaType, String base64) String
Builds a DATA URL string.
toHTML(HTMLElement element) String
Converts element to HTML.
touchEventToMouseEvent(TouchEvent event) MouseEvent?
Converts a TouchEvent event to a MouseEvent.
translatePoints(List<Point<num>> points, num x, num y) List<Point<num>>
Translate pints in x and y.
tryCall<R>(R call()) → R?

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, of width and height.
JSVoid = void
JS type equivalent for undefined for interop member return types.
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)

Exceptions / Errors

NullRejectionException
Exception for when a JSPromise that is converted via JSPromiseToFuture.toDart is rejected with a null or undefined value.