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
TreeReferenceMapfor 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'screateJSInteropWrapper. -
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
Functionvalue. - JSInt16Array
-
A JavaScript
Int16Array. - JSInt32Array
-
A JavaScript
Int32Array. - JSInt8Array
-
A JavaScript
Int8Array. - JSNumber
- A JavaScript number.
- JSObject
-
A JavaScript
Object. - JSObjectUtil
- JSPromise
-
A JavaScript
Promiseor 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
undefinedornull. - NumToJSExtension on num
- Conversions from num to JSNumber.
- ObjectExtension on Object?
- ObjectToExternalDartReference on T
-
Conversions from a value of type
Tto 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
linkelement intoheadDOM node. -
addElementsClasses(
Iterable< Element> elements, Iterable<String> classes) → bool -
Add to
elementsa 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
animateCSSbut runsanimationsConfigin sequence; -
appendElementInnerHTML(
HTMLElement element, String html, {Object? validator, bool unsafe = false}) → void -
Appends to the inner HTML of
elementwith parsed result ofhtml. -
applyCSS(
CSSStyleDeclaration css, Element element, [List< Element> ? extraElements]) → bool -
Applies
csstoelementandextraElementslist if present. -
applyPerspective(
CanvasImageSource image, List< Point< perspective) → FilterResult?num> > -
Apply
perspectivefilter toimage. -
asCssStyleDeclaration(
Object? css) → CSSStyleDeclaration -
Parses dynamic
cssas 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
wheelEventin the horizontal direction that traverses theelement. -
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
wheelEventin the vertical direction that traverses theelement. -
buildMetaContent(
Map< String, String?> map) → String -
Builds a
metacontent frommap. -
callJSFunction(
String method, [List< Object?> ? args]) → dynamic -
Calls JavaScript a function
methodwithargs. -
callJSObjectMethod(
JSObject o, String method, [List< Object?> ? args]) → dynamic -
Calls JavaScript a
methodin objectowithargs. -
canvasToImageElement(
HTMLCanvasElement canvas, [String? mimeType, num? quality]) → HTMLImageElement -
Converts
canvasto HTMLImageElement -
clearSelections(
) → void - Clears selected text in vieport.
-
copyElementToClipboard(
Element element) → bool -
Copies
elementtext to Clipboard. -
copyPoints(
List< Point< points) → List<num> >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.inlineIftruesetsdisplay: inline-block.htmlThe HTML to parse as content. -
createDivInline(
{String? html, bool unsafe = false}) → HTMLDivElement -
Creates a
divwithdisplay: inline-block. -
createDivInlineBlock(
) → HTMLDivElement -
Creates a
divwithdisplay: 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
@JSExportannotation, creates a JavaScript object that wraps the given Dart object. -
createLabel(
{String? html, Object? validator, bool unsafe = false}) → HTMLLabelElement -
Creates a
labelelement. -
createScaledImage(
CanvasImageSource image, int width, int height, double scale) → CanvasImageSource -
Creates a new image from
image, ofwidthandheight, to ascale. -
createSpan(
{String? html, Object? validator, bool unsafe = false}) → HTMLSpanElement -
Creates a
spanelement. -
cropImage(
CanvasImageSource image, int x, int y, int width, int height) → HTMLCanvasElement? -
Crops the
imageusing coordinatesx,y,widthandheight, 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
dataURLto a Blob. -
defineCSS(
CSSStyleDeclaration? currentCSS, CSSStyleDeclaration? appendCSS, [dynamic defaultCSS]) → CSSStyleDeclaration -
Defines a new CSSStyleDeclaration merging
currentCSSandappendCSS. -
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
blobof typemimeType, saving a file withfileName. -
downloadBytes(
List< int> bytes, MimeType mimeType, String fileName) → void -
Downloads
bytesof typemimeType, saving a file withfileName. -
downloadContent(
List< String> content, MimeType mimeType, String fileName) → void -
Downloads
contentof 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
trueifelementmatchesattributeNameandattributeValue. -
elementMatchesAttributes(
Element element, Map< String, dynamic> attributes) → bool -
Returns
trueifelementmatchesattributes. -
elementOnLoad(
HTMLImageElement img) → Future< bool> -
Returns a Future<bool> for when
imgloads. -
enableScrolling(
) → void - Enables scrolling in browser.
-
evalJS(
String scriptCode) → dynamic -
Call
eval()with the content ofscriptCodeand 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
viewportWidthandviewportHeight. -
getAllOutOfViewportMediaCssRuleAsClassRule(
int viewportWidth, dynamic viewportHeight, String targetClass) → List< String> -
Transforms all CssMediaRule to
targetClassrule not applied forviewportWidthandviewportHeight. -
getAllViewportMediaCssRule(
int viewportWidth, dynamic viewportHeight) → List< CSSMediaRule> -
Returns all CssMediaRule applied for
viewportWidthviewportHeight. -
getAllViewportMediaCssRuleAsClassRule(
int viewportWidth, dynamic viewportHeight, String targetClass) → List< String> -
Transforms all CssMediaRule to
targetClassrule applied forviewportWidthandviewportHeight. -
getAnchorElementByHREF(
String href) → HTMLAnchorElement? -
Selects an AnchorElement in DOM with
href. -
getComputedStyle(
{Element? parent, HTMLElement? 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
elementattribute withkey. -
getElementAttributeRegExp(
Element element, RegExp key) → String? -
Returns
elementattribute with RegExpkey. -
getElementAttributeStr(
Element element, String key) → String? -
Returns
elementattribute with Stringkey. -
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
tagandhref. -
getElementBySRC(
String tag, String src) → Element? -
Selects an Element in DOM with
tagandsrc. -
getElementByValues<
V> (String tag, ElementValueGetter getter, List< V> values, [ElementValueGetter? getter2, List<V> ? values2]) → Element? -
selects in DOM an Element with
tagand one ofvaluesprovided bygetter. -
getElementDocumentPosition(
HTMLElement element) → Pair< num> - Returns the X and Y position of Element int the Document.
-
getElementHeight(
HTMLElement element, [int? def]) → int? -
Returns
elementheight. Tries to use 'offsetHeight' or 'style.height' values. -
getElementHREF(
Element element) → String? -
Returns
hrefvalue for different Element types. -
getElementPreComputedStyle(
Element element) → CSSStyleDeclaration -
Returns a CSSStyleDeclaration of the pre-computed CSS properties of
element. -
getElementSRC(
Element element) → String? -
Returns
srcvalue for different Element types. -
getElementsWithAttributes(
String tag, Map< String, dynamic> matchAttributes) → List<Element> -
Selects elements from DOM with
tagand matches attribute. -
getElementTagName(
Node node) → String? -
Returns the
nodetag name. Returns null ifnodeis not an Element. -
getElementValue(
Element element, [String? def]) → String? -
Gets the
elementvalue depending of identified type. -
getElementWidth(
HTMLElement element, [int? def]) → int? -
Returns
elementwidth. Tries to use 'offsetWidth' or 'style.width' values. -
getElementZIndex(
Element? element, [String? def]) → String? -
Returns the
elementz-indexorelement.parentz-indexrecursively. -
getFileMimeType(
File file, [String accept = '']) → MimeType? -
Returns the
fileMimeType. -
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
metacontet withname. -
getMetaTagsWithName(
String name) → List< Element> -
Returns a list of
metaElement withname. -
getParentElement(
Element element, {bool validator(Element parent)?, int maxLevels = 1000}) → Element? -
Returns the parent of
elementapplyingvalidatorandmaxLevels. -
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
urlcontent as Uint8List. -
getVisibleNode(
HTMLElement? element) → HTMLElement? - Get the first visible element in the hierarchy.
-
htmlToText(
String html, [Object? validator]) → String? -
Transform
htmlto plain text. -
importModule(
JSAny moduleName) → JSPromise< JSObject> -
Dynamically imports a JavaScript module with the given
moduleNameusing the JavaScriptimport()syntax. -
isCssEmpty(
CSSStyleDeclaration css) → bool -
Returns
trueif CSSStyleDeclaration is empty. -
isCssNotEmpty(
CSSStyleDeclaration css) → bool -
Returns
trueif CSSStyleDeclaration is not empty. -
isElementWithHREF(
Element element) → bool -
Returns
trueifelementtype can havehrefattribute. -
isElementWithSRC(
Element element) → bool -
Returns
trueifelementtype can havesrcattribute. -
isInDOM(
Object? element) → bool -
Returns
trueifelementis in DOM tree. -
isInlineElement(
HTMLDivElement element, {bool checkBootstrapClasses = true}) → bool -
Returns
trueifelementdisplayproperty is inline. -
isInViewport(
Element element, {bool fully = false}) → bool -
Returns
trueifelementis visible in viewport. -
isMobileAppStatusBarTranslucent(
) → bool -
Returns
trueifmetatag of nameapple-mobile-web-app-status-bar-styleistranslucent. -
isNodeInDOM(
Node node) → bool -
Returns
trueifnodeis in DOM tree. -
isOrientationInLandscapeMode(
) → bool -
Returns
trueif device orientation is in Landscape mode. -
isOrientationInPortraitMode(
) → bool -
Returns
trueif device orientation is in Portrait mode. -
isSafariIOS(
) → bool -
jsArrayToList(
JSArray< JSAny?> ? a) → List? -
Converts a JSArray
ato 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
oto a Map. Also converts keys and values using jsToDart. -
jsToDart(
Object? o) → Object? -
Converts
oto Dart primitives or collections. -
lerpDouble(
num a, num b, double t) → double? -
loadCSS(
String cssClassPrefix, Map< String, CSSValueBase> ? css) → void -
Loads
cssdynamically. -
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
markdowndocument 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
markdowndocument 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
trueifrootNodecontainstarget. -
nodeTreeContainsAny(
Node rootNode, Iterable< Node> list) → bool -
Returns
trueifrootNodecontains 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
listenertoorientationchangeevent. -
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
metacontent to Map<String,String>. -
prefetchHref(
String href, {int? insertIndex, bool? preLoad}) → Future< bool> -
Prefetch a HREF using a
linkelement intoheadDOM node. -
readFileDataAsArrayBuffer(
File file) → Future< Uint8List?> -
Reads
fileas Uint8List. -
readFileDataAsBase64(
File file) → Future< String?> -
Reads
fileas Base64 String. -
readFileDataAsBlobURL(
File file, [String accept = '']) → Future< String?> -
Reads
fileas Blob URL. -
readFileDataAsDataURLBase64(
File file, [String accept = '']) → Future< String?> -
Reads
fileas DATA URL Base64 String. -
readFileDataAsText(
File file) → Future< String?> -
Reads
fileas text. -
readFileInputElementAsArrayBuffer(
HTMLInputElement? input, [bool removeExifFromImage = false]) → Future< Uint8List?> -
Reads selected file of
inputas Uint8List. -
readFileInputElementAsBase64(
HTMLInputElement? input, [bool removeExifFromImage = false]) → Future< String?> -
Reads selected file of
inputas Base64. -
readFileInputElementAsBlobUrl(
HTMLInputElement? input, [bool removeExifFromImage = false]) → Future< String?> -
Reads selected file of
inputand return a Blob URL. -
readFileInputElementAsDataURLBase64(
HTMLInputElement? input, [bool removeExifFromImage = false]) → Future< String?> -
Reads selected file of
inputas DATA URL Base64. -
readFileInputElementAsString(
HTMLInputElement? input, [bool removeExifFromImage = false]) → Future< String?> -
Reads selected file of
inputas String. -
redirectOnTouchEndToMouseEvent(
Element element) → void -
Redirects
element.onTouchEndtoelement.onMouseUpas MouseEvent. -
redirectOnTouchMoveToMouseEvent(
Element element) → void -
Redirects
element.onTouchMovetoelement.onMouseMoveas MouseEvent. -
redirectOnTouchStartToMouseEvent(
Element element) → void -
Redirects
element.onTouchStarttoelement.onMouseDownas 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
elementbackground blur effect, set by setElementBackgroundBlur. -
removeElementScrollColors(
Element element) → List< String> ? -
Removes
elementscroll colors CSS properties set by setElementScrollColors. -
removeExifFromImageFile(
File file) → Future< String?> -
Removes Exif from JPEG
file. -
replaceElement(
Node n1, Node n2) → bool -
Replaces
n1withn2inn1parent. -
resetZoom(
) → void - Resets viewport zoom.
-
revokeBlobURL(
String blobUrl) → void -
rotateCanvasImageSource(
CanvasImageSource image, int width, int height, [dynamic angleDegree = 90]) → HTMLCanvasElement -
Rotates
image(a CanvasImageSource) withangleDegree. -
rotateImageElement(
HTMLImageElement image, [dynamic angleDegree = 90]) → HTMLCanvasElement -
Rotates
imagewithangleDegree. -
scalePoints(
List< Point< points, double scale) → List<num> >Point< num> > -
Scales
pointstoscale. -
scalePointsXY(
List< Point< points, double scaleX, double scaleY) → List<num> >Point< num> > -
Scales
pointstoscaleXandscaleY. -
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
targetSelectorpatterns. -
setDivCentered(
HTMLDivElement div, {bool centerVertically = true, bool centerHorizontally = true, bool checkBootstrapClasses = true}) → void -
Sets
divas centered content, usingdisplayproperty astableand sub div elementsdisplayproperty astable-cell. -
setElementBackdropFilter(
Element element, String filter) → void -
Sets a backdrop-filter on the element, including Safari’s
-webkit-backdrop-filterprefix. Example:"blur(3px)". -
setElementBackgroundBlur(
Element element, [int? blurSize]) → void -
Sets
elementbackground as a blur effect of sizeblurSize. Uses CSS propertybackdrop-filter. -
setElementHREF(
Element element, String href) → bool -
Sets
elementhrefdepending of the identified type. -
setElementInnerHTML(
HTMLElement element, String html, {Object? validator, bool unsafe = false}) → void -
Sets the inner HTML of
elementwith parsed result ofhtml. -
setElementScrollColors(
Element element, int scrollWidth, String scrollButtonColor, [String? scrollBgColor]) → String? -
Sets
elementscroll colors, using standard CSS propertyscrollbar-colorand webkit pseudo element::-webkit-scrollbar-thumband::-webkit-scrollbar-track -
setElementSRC(
Element element, String src) → bool -
Sets the
elementsrcdepending of the identified type. -
setElementValue(
Element? element, String value) → bool -
Sets the
elementvaluedepending of the identified type. -
setMetaViewportScale(
{String? minimumScale, String? maximumScale}) → bool -
Sets the
metaviewport withminimumScaleandmaximumScale. -
setTreeElementsBackgroundBlur(
Element element, String className) → void -
setTreeElementsDivCentered(
Element element, String className, {bool centerVertically = true, bool centerHorizontally = true}) → void -
Set all
elementsub div withclassNameto 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
htmldialog. -
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
imageSourceto HTMLCanvasElement. -
toDataURLBase64(
String? mediaType, String base64) → String - Builds a DATA URL string.
-
toHTML(
HTMLElement element) → String -
Converts
elementto HTML. -
touchEventToMouseEvent(
TouchEvent event) → MouseEvent? -
Converts a TouchEvent
eventto a MouseEvent. -
translatePoints(
List< Point< points, num x, num y) → List<num> >Point< num> > -
Translate
pintsinxandy. -
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, ofwidthandheight. - JSVoid = void
-
JS type equivalent for
undefinedfor 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
nullorundefinedvalue.