added feedback
This commit is contained in:
@@ -13,7 +13,7 @@ part 'feedback_response.g.dart';
|
||||
abstract class FeedbackResponse with _$FeedbackResponse {
|
||||
const factory FeedbackResponse({
|
||||
@JsonKey(name: 'meta') required Meta? meta,
|
||||
@JsonKey(name: 'data') required List<FeedbackData>? data,
|
||||
@JsonKey(name: 'data') required FeedbackData? data,
|
||||
@JsonKey(name: 'error') required ErrorModel? error,
|
||||
required String? message,
|
||||
required bool? success,
|
||||
|
||||
@@ -15,7 +15,7 @@ T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$FeedbackResponse {
|
||||
|
||||
@JsonKey(name: 'meta') Meta? get meta;@JsonKey(name: 'data') List<FeedbackData>? get data;@JsonKey(name: 'error') ErrorModel? get error; String? get message; bool? get success;
|
||||
@JsonKey(name: 'meta') Meta? get meta;@JsonKey(name: 'data') FeedbackData? get data;@JsonKey(name: 'error') ErrorModel? get error; String? get message; bool? get success;
|
||||
/// Create a copy of FeedbackResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -28,12 +28,12 @@ $FeedbackResponseCopyWith<FeedbackResponse> get copyWith => _$FeedbackResponseCo
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is FeedbackResponse&&(identical(other.meta, meta) || other.meta == meta)&&const DeepCollectionEquality().equals(other.data, data)&&(identical(other.error, error) || other.error == error)&&(identical(other.message, message) || other.message == message)&&(identical(other.success, success) || other.success == success));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is FeedbackResponse&&(identical(other.meta, meta) || other.meta == meta)&&(identical(other.data, data) || other.data == data)&&(identical(other.error, error) || other.error == error)&&(identical(other.message, message) || other.message == message)&&(identical(other.success, success) || other.success == success));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,meta,const DeepCollectionEquality().hash(data),error,message,success);
|
||||
int get hashCode => Object.hash(runtimeType,meta,data,error,message,success);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
@@ -48,11 +48,11 @@ abstract mixin class $FeedbackResponseCopyWith<$Res> {
|
||||
factory $FeedbackResponseCopyWith(FeedbackResponse value, $Res Function(FeedbackResponse) _then) = _$FeedbackResponseCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
@JsonKey(name: 'meta') Meta? meta,@JsonKey(name: 'data') List<FeedbackData>? data,@JsonKey(name: 'error') ErrorModel? error, String? message, bool? success
|
||||
@JsonKey(name: 'meta') Meta? meta,@JsonKey(name: 'data') FeedbackData? data,@JsonKey(name: 'error') ErrorModel? error, String? message, bool? success
|
||||
});
|
||||
|
||||
|
||||
$MetaCopyWith<$Res>? get meta;$ErrorModelCopyWith<$Res>? get error;
|
||||
$MetaCopyWith<$Res>? get meta;$FeedbackDataCopyWith<$Res>? get data;$ErrorModelCopyWith<$Res>? get error;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
@@ -69,7 +69,7 @@ class _$FeedbackResponseCopyWithImpl<$Res>
|
||||
return _then(_self.copyWith(
|
||||
meta: freezed == meta ? _self.meta : meta // ignore: cast_nullable_to_non_nullable
|
||||
as Meta?,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
|
||||
as List<FeedbackData>?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
||||
as FeedbackData?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
||||
as ErrorModel?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
|
||||
as String?,success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
@@ -91,6 +91,18 @@ $MetaCopyWith<$Res>? get meta {
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$FeedbackDataCopyWith<$Res>? get data {
|
||||
if (_self.data == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $FeedbackDataCopyWith<$Res>(_self.data!, (value) {
|
||||
return _then(_self.copyWith(data: value));
|
||||
});
|
||||
}/// Create a copy of FeedbackResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$ErrorModelCopyWith<$Res>? get error {
|
||||
if (_self.error == null) {
|
||||
return null;
|
||||
@@ -181,7 +193,7 @@ return $default(_that);case _:
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function(@JsonKey(name: 'meta') Meta? meta, @JsonKey(name: 'data') List<FeedbackData>? data, @JsonKey(name: 'error') ErrorModel? error, String? message, bool? success)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function(@JsonKey(name: 'meta') Meta? meta, @JsonKey(name: 'data') FeedbackData? data, @JsonKey(name: 'error') ErrorModel? error, String? message, bool? success)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _FeedbackResponse() when $default != null:
|
||||
return $default(_that.meta,_that.data,_that.error,_that.message,_that.success);case _:
|
||||
@@ -202,7 +214,7 @@ return $default(_that.meta,_that.data,_that.error,_that.message,_that.success);c
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function(@JsonKey(name: 'meta') Meta? meta, @JsonKey(name: 'data') List<FeedbackData>? data, @JsonKey(name: 'error') ErrorModel? error, String? message, bool? success) $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function(@JsonKey(name: 'meta') Meta? meta, @JsonKey(name: 'data') FeedbackData? data, @JsonKey(name: 'error') ErrorModel? error, String? message, bool? success) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _FeedbackResponse():
|
||||
return $default(_that.meta,_that.data,_that.error,_that.message,_that.success);case _:
|
||||
@@ -222,7 +234,7 @@ return $default(_that.meta,_that.data,_that.error,_that.message,_that.success);c
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function(@JsonKey(name: 'meta') Meta? meta, @JsonKey(name: 'data') List<FeedbackData>? data, @JsonKey(name: 'error') ErrorModel? error, String? message, bool? success)? $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function(@JsonKey(name: 'meta') Meta? meta, @JsonKey(name: 'data') FeedbackData? data, @JsonKey(name: 'error') ErrorModel? error, String? message, bool? success)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _FeedbackResponse() when $default != null:
|
||||
return $default(_that.meta,_that.data,_that.error,_that.message,_that.success);case _:
|
||||
@@ -237,19 +249,11 @@ return $default(_that.meta,_that.data,_that.error,_that.message,_that.success);c
|
||||
@JsonSerializable()
|
||||
|
||||
class _FeedbackResponse implements FeedbackResponse {
|
||||
const _FeedbackResponse({@JsonKey(name: 'meta') required this.meta, @JsonKey(name: 'data') required final List<FeedbackData>? data, @JsonKey(name: 'error') required this.error, required this.message, required this.success}): _data = data;
|
||||
const _FeedbackResponse({@JsonKey(name: 'meta') required this.meta, @JsonKey(name: 'data') required this.data, @JsonKey(name: 'error') required this.error, required this.message, required this.success});
|
||||
factory _FeedbackResponse.fromJson(Map<String, dynamic> json) => _$FeedbackResponseFromJson(json);
|
||||
|
||||
@override@JsonKey(name: 'meta') final Meta? meta;
|
||||
final List<FeedbackData>? _data;
|
||||
@override@JsonKey(name: 'data') List<FeedbackData>? get data {
|
||||
final value = _data;
|
||||
if (value == null) return null;
|
||||
if (_data is EqualUnmodifiableListView) return _data;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
@override@JsonKey(name: 'data') final FeedbackData? data;
|
||||
@override@JsonKey(name: 'error') final ErrorModel? error;
|
||||
@override final String? message;
|
||||
@override final bool? success;
|
||||
@@ -267,12 +271,12 @@ Map<String, dynamic> toJson() {
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _FeedbackResponse&&(identical(other.meta, meta) || other.meta == meta)&&const DeepCollectionEquality().equals(other._data, _data)&&(identical(other.error, error) || other.error == error)&&(identical(other.message, message) || other.message == message)&&(identical(other.success, success) || other.success == success));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _FeedbackResponse&&(identical(other.meta, meta) || other.meta == meta)&&(identical(other.data, data) || other.data == data)&&(identical(other.error, error) || other.error == error)&&(identical(other.message, message) || other.message == message)&&(identical(other.success, success) || other.success == success));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,meta,const DeepCollectionEquality().hash(_data),error,message,success);
|
||||
int get hashCode => Object.hash(runtimeType,meta,data,error,message,success);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
@@ -287,11 +291,11 @@ abstract mixin class _$FeedbackResponseCopyWith<$Res> implements $FeedbackRespon
|
||||
factory _$FeedbackResponseCopyWith(_FeedbackResponse value, $Res Function(_FeedbackResponse) _then) = __$FeedbackResponseCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
@JsonKey(name: 'meta') Meta? meta,@JsonKey(name: 'data') List<FeedbackData>? data,@JsonKey(name: 'error') ErrorModel? error, String? message, bool? success
|
||||
@JsonKey(name: 'meta') Meta? meta,@JsonKey(name: 'data') FeedbackData? data,@JsonKey(name: 'error') ErrorModel? error, String? message, bool? success
|
||||
});
|
||||
|
||||
|
||||
@override $MetaCopyWith<$Res>? get meta;@override $ErrorModelCopyWith<$Res>? get error;
|
||||
@override $MetaCopyWith<$Res>? get meta;@override $FeedbackDataCopyWith<$Res>? get data;@override $ErrorModelCopyWith<$Res>? get error;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
@@ -307,8 +311,8 @@ class __$FeedbackResponseCopyWithImpl<$Res>
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? meta = freezed,Object? data = freezed,Object? error = freezed,Object? message = freezed,Object? success = freezed,}) {
|
||||
return _then(_FeedbackResponse(
|
||||
meta: freezed == meta ? _self.meta : meta // ignore: cast_nullable_to_non_nullable
|
||||
as Meta?,data: freezed == data ? _self._data : data // ignore: cast_nullable_to_non_nullable
|
||||
as List<FeedbackData>?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
||||
as Meta?,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
|
||||
as FeedbackData?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
||||
as ErrorModel?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
|
||||
as String?,success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
@@ -331,6 +335,18 @@ $MetaCopyWith<$Res>? get meta {
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$FeedbackDataCopyWith<$Res>? get data {
|
||||
if (_self.data == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $FeedbackDataCopyWith<$Res>(_self.data!, (value) {
|
||||
return _then(_self.copyWith(data: value));
|
||||
});
|
||||
}/// Create a copy of FeedbackResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$ErrorModelCopyWith<$Res>? get error {
|
||||
if (_self.error == null) {
|
||||
return null;
|
||||
|
||||
@@ -13,9 +13,9 @@ _FeedbackResponse _$FeedbackResponseFromJson(Map<String, dynamic> json) =>
|
||||
? null
|
||||
: Meta.fromJson(json['meta'] as Map<String, dynamic>),
|
||||
data:
|
||||
(json['data'] as List<dynamic>?)
|
||||
?.map((e) => FeedbackData.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
json['data'] == null
|
||||
? null
|
||||
: FeedbackData.fromJson(json['data'] as Map<String, dynamic>),
|
||||
error:
|
||||
json['error'] == null
|
||||
? null
|
||||
|
||||
Reference in New Issue
Block a user