FeedbackResponse<T extends Object?> class

Used to create default feedback responses as part of the feedback_response package.

If you are interested in using different feedbackLevel/feedbackType enums then consider creating your own response class overriding the FeedbackResponseInterface.

Inheritance

Constructors

FeedbackResponse({required FeedbackLevel feedbackLevel, required FeedbackType feedbackType, String? title, String? message, T? result})
FeedbackResponse.error({String? title, String? message, T? result, FeedbackLevel feedbackLevel = FeedbackLevel.error, FeedbackType feedbackType = FeedbackType.notification})
Used to create an error response with a dialog type of feedback.
factory
FeedbackResponse.errorNone({String? title, String? message, T? result, FeedbackLevel feedbackLevel = FeedbackLevel.error, FeedbackType feedbackType = FeedbackType.none})
Used to create an error response without any type of feedback.
factory
FeedbackResponse.info({String? title, String? message, T? result, FeedbackLevel feedbackLevel = FeedbackLevel.info, FeedbackType feedbackType = FeedbackType.notification})
Used to create an info response with a dialog type of feedback.
factory
FeedbackResponse.success({String? title, String? message, T? result, FeedbackLevel feedbackLevel = FeedbackLevel.success, FeedbackType feedbackType = FeedbackType.notification})
Used to create a success response with a snack type of feedback.
factory
FeedbackResponse.successNone({String? title, String? message, T? result, FeedbackLevel feedbackLevel = FeedbackLevel.success, FeedbackType feedbackType = FeedbackType.none})
Used to create a success response without any type of feedback.
factory
FeedbackResponse.warning({String? title, String? message, T? result, FeedbackLevel feedbackLevel = FeedbackLevel.warning, FeedbackType feedbackType = FeedbackType.notification})
Used to create a warning response with a dialog type of feedback.
factory

Properties

feedbackLevel FeedbackLevel
Used to determine the feedback level/notification level towards the user.
finalinherited
feedbackType FeedbackType
Used to determine the feedback type/notification type towards the user.
finalinherited
hasError bool
Indicates whether the response has an error.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
isSuccess bool
Indicates whether the response is a successful.
no setteroverride
message String?
Used to provide a message for the type of feedback.
finalinherited
result → T?
Used to provide a result.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String?
Used to provide a title for the type of feedback.
finalinherited

Methods

copyWith<E>({FeedbackLevel? feedbackLevel, FeedbackType? feedbackType, E? result, String? title, String? message, String? ifSuccessTitle, String? ifSuccessMessage, String? ifErrorTitle, String? ifErrorMessage}) FeedbackResponse<E>
Used to change responses if needed.
fold<E>({required E ifSuccess(FeedbackResponse<T> response), required E orElse(FeedbackResponse<T> response)}) → E
Returns a value depending on the success state of FeedbackResponse by applying one of the provided functions ifSuccess or orElse.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resultAsType<E>() → E
Parses the response to any desired type of E.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited