fromValue static method

ScrollBarStyle? fromValue(
  1. int? value
)

Gets a possible ScrollBarStyle instance from int value.

Implementation

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