MapConvert<T> mixin

T 被转换的数据对象。

class Model extends MapConvert<Model> {
  toMap() {
    return ModelExtension().toMap();
  }
}

extension ModelExtension on Model {
  Map<String, dynamic> get mapping => toMap();

  toMap() {
    return {
      "key":"value",
    }
  }
}
Available extensions

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

fromMap(Map<String, dynamic> map) → T
将Map转换为对象
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
将对象转换为Map
toMap() Map<String, dynamic>

Available on MapConvert<T>, provided by the MapConvertExtension extension

toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited