wrapResponse function

List<Object?> wrapResponse({
  1. Object? result,
  2. PlatformException? error,
  3. bool empty = false,
})

Implementation

List<Object?> wrapResponse({Object? result, PlatformException? error, bool empty = false}) {
  if (empty) {
    return <Object?>[];
  }
  if (error == null) {
    return <Object?>[result];
  }
  return <Object?>[error.code, error.message, error.details];
}