Image helpers: initials, URL detection and aspect-ratio math.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
aspectRatio(
double width, double height) → double -
The aspect ratio of
width/height(1.0 when height is 0). -
heightForWidth(
double width, double aspectRatio) → double -
Height that keeps the given
aspectRatioforwidth. -
initials(
String? name, {int maxChars = 2, String fallback = '?'}) → String -
Builds a short initials string from
name(maxmaxCharscharacters). -
isAssetPath(
String value) → bool -
Whether
valueis a local asset path (starts withassets/). -
isDataUri(
String value) → bool -
Whether
valueis adata:URI. -
isNetworkUrl(
String value) → bool -
Whether
valueis anhttp(s)image URL. -
widthForHeight(
double height, double aspectRatio) → double -
Width that keeps the given
aspectRatioforheight.