fromValue static method

Gets a possible ScrollViewContentInsetAdjustmentBehavior instance from int value.

Implementation

static ScrollViewContentInsetAdjustmentBehavior? fromValue(int? value) {
  if (value != null) {
    try {
      return ScrollViewContentInsetAdjustmentBehavior.values
          .firstWhere((element) => element.toValue() == value);
    } catch (e) {
      return null;
    }
  }
  return null;
}