successData property

SuccessType get successData

Implementation

SuccessType get successData {
  if (isSuccess) {
    final data = (this as _Success<SuccessType, FailureType>).data;
    if (data == null) {
      throw const FormatException('Success data not exist');
    }
    return data;
  }

  throw const FormatException('This is not Success type');
}