MapConverter class
Helpers for adapting loosely-typed platform-channel data
(Map<dynamic,dynamic>, List<dynamic>) to strongly-typed Dart values.
Constructors
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
-
convertBoundingBox(
Map boxMap) → Rect -
Converts a
{left, top, right, bottom}map to a Rect. -
convertBoxesList(
List boxes) → List< Map< String, dynamic> > - Alias of convertMapsList for detection-box lists.
-
convertKeypoints(
List keypointsData) → ({List< double> confidences, List<Point> keypoints}) -
Unpacks a flat
[x0, y0, c0, x1, y1, c1, ...]keypoint list into parallel lists of points and confidences. -
convertMapsList(
List maps) → List< Map< String, dynamic> > -
Converts a list of dynamic maps to
List<Map<String, dynamic>>, skipping non-map entries. -
convertMaskData(
List maskData) → List< List< double> > -
Converts a list of rows of numbers into a typed
List<List<double>>mask. Non-numeric values become0.0. -
convertToTypedMap(
Map map) → Map< String, dynamic> -
Converts a dynamic map to
Map<String, dynamic>. -
convertToTypedMapSafe(
Map? map) → Map< String, dynamic> ? - Null-safe variant of convertToTypedMap.
-
safeGetDouble(
Map map, String key, {double fallback = 0.0}) → double -
Reads
map[key]as double; returnsfallbackif absent or non-numeric. -
safeGetInt(
Map map, String key, {int fallback = 0}) → int -
Reads
map[key]as int; returnsfallbackif absent or non-numeric. -
safeGetString(
Map map, String key, {String fallback = ''}) → String -
Reads
map[key]as String; returnsfallbackif absent or wrong type. -
safeGetUint8List(
Map map, String key) → Uint8List? -
Reads
map[key]as Uint8List or returns null.