isValid method

  1. @override
bool isValid(
  1. S state
)
override

Implementation

@override
bool isValid(S state) {
  switch (state) {
    case String():
      return state.isNotEmpty;
    case Iterable():
      return state.isNotEmpty;
    case File():
      return state.existsSync();
    case bool():
      return null is S || state;
    default:
      return state != null;
  }
}