fromMap static method

PullToRefreshSettings? fromMap(
  1. Map<String, dynamic>? map
)

Gets a possible PullToRefreshSettings instance from a Map value.

Implementation

static PullToRefreshSettings? fromMap(Map<String, dynamic>? map) {
  if (map == null) {
    return null;
  }
  final instance = PullToRefreshSettings(
    attributedTitle: AttributedString.fromMap(
        map['attributedTitle']?.cast<String, dynamic>()),
    backgroundColor: map['backgroundColor'] != null
        ? UtilColor.fromStringRepresentation(map['backgroundColor'])
        : null,
    color: map['color'] != null
        ? UtilColor.fromStringRepresentation(map['color'])
        : null,
    distanceToTriggerSync: map['distanceToTriggerSync'],
    size: PullToRefreshSize.fromNativeValue(map['size']),
    slingshotDistance: map['slingshotDistance'],
  );
  instance.enabled = map['enabled'];
  return instance;
}