Merge pull request 'home_your_tenders_pagination' (#106) from home_your_tenders_pagination into main
Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/106
This commit is contained in:
@@ -8,7 +8,7 @@ import '../services/model/feedback_stats_response/feedback_stat_response.dart';
|
|||||||
|
|
||||||
class HomeRepository {
|
class HomeRepository {
|
||||||
HomeRepository({required HomeService homeService})
|
HomeRepository({required HomeService homeService})
|
||||||
: _homeService = homeService;
|
: _homeService = homeService;
|
||||||
final HomeService _homeService;
|
final HomeService _homeService;
|
||||||
|
|
||||||
Future<Result<RecommendedTendersResponse>> getHomeRecommendedTenders({
|
Future<Result<RecommendedTendersResponse>> getHomeRecommendedTenders({
|
||||||
@@ -18,8 +18,11 @@ class HomeRepository {
|
|||||||
return _homeService.getRecommendedTenders(limit: limit, offset: offset);
|
return _homeService.getRecommendedTenders(limit: limit, offset: offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Result<TenderApprovalsResponse>> getYourTenders() {
|
Future<Result<TenderApprovalsResponse>> getYourTenders({
|
||||||
return _homeService.getYourTenders();
|
required int limit,
|
||||||
|
required int offset,
|
||||||
|
}) {
|
||||||
|
return _homeService.getYourTenders(limit: limit, offset: offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Result<TenderApprovalsStateResponse>> getTendersApprovalsState() {
|
Future<Result<TenderApprovalsStateResponse>> getTendersApprovalsState() {
|
||||||
|
|||||||
@@ -7,7 +7,15 @@ class HomeApi {
|
|||||||
return '$recommendedTenders?limit=$limit&offset=$offset';
|
return '$recommendedTenders?limit=$limit&offset=$offset';
|
||||||
}
|
}
|
||||||
|
|
||||||
static const String tenderApprovals = '/api/v1/tender-approvals';
|
static const String tenderApprovalsBase = '/api/v1/tender-approvals';
|
||||||
|
|
||||||
|
static String getYourTenders({
|
||||||
|
required int limit,
|
||||||
|
required int offset,
|
||||||
|
}) {
|
||||||
|
return '$tenderApprovalsBase?limit=$limit&offset=$offset';
|
||||||
|
}
|
||||||
|
|
||||||
static const String tenderApprovalStats = '/api/v1/tender-approvals/stats';
|
static const String tenderApprovalStats = '/api/v1/tender-approvals/stats';
|
||||||
static const String statsCompany = '/api/v1/feedback/stats/company';
|
static const String statsCompany = '/api/v1/feedback/stats/company';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import '../../core/network/network_manager.dart';
|
|||||||
|
|
||||||
class HomeService {
|
class HomeService {
|
||||||
HomeService({required NetworkManager networkManager})
|
HomeService({required NetworkManager networkManager})
|
||||||
: _networkManager = networkManager;
|
: _networkManager = networkManager;
|
||||||
final NetworkManager _networkManager;
|
final NetworkManager _networkManager;
|
||||||
|
|
||||||
Future<Result<RecommendedTendersResponse>> getRecommendedTenders({
|
Future<Result<RecommendedTendersResponse>> getRecommendedTenders({
|
||||||
@@ -24,24 +24,24 @@ class HomeService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Result<TenderApprovalsResponse>> getYourTenders() async {
|
Future<Result<TenderApprovalsResponse>> getYourTenders({
|
||||||
|
required int limit,
|
||||||
|
required int offset,
|
||||||
|
}) async {
|
||||||
final result = await _networkManager.makeRequest(
|
final result = await _networkManager.makeRequest(
|
||||||
HomeApi.tenderApprovals,
|
HomeApi.getYourTenders(limit: limit, offset: offset),
|
||||||
(json) => TenderApprovalsResponse.fromJson(json),
|
(json) => TenderApprovalsResponse.fromJson(json),
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
);
|
);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Result<TenderApprovalsStateResponse>>
|
Future<Result<TenderApprovalsStateResponse>> getTendersApprovalsState() async {
|
||||||
getTendersApprovalsState() async {
|
|
||||||
final result = await _networkManager.makeRequest(
|
final result = await _networkManager.makeRequest(
|
||||||
HomeApi.tenderApprovalStats,
|
HomeApi.tenderApprovalStats,
|
||||||
(json) => TenderApprovalsStateResponse.fromJson(json),
|
(json) => TenderApprovalsStateResponse.fromJson(json),
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
);
|
);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||||
|
import '../tender_approvals_data/tender_approvals_data.dart';
|
||||||
|
|
||||||
|
part 'tender_approvals_data_wrapper.freezed.dart';
|
||||||
|
part 'tender_approvals_data_wrapper.g.dart';
|
||||||
|
|
||||||
|
@freezed
|
||||||
|
abstract class TenderApprovalsDataWrapper with _$TenderApprovalsDataWrapper {
|
||||||
|
const factory TenderApprovalsDataWrapper({
|
||||||
|
required List<TenderApprovalsData>? tenders,
|
||||||
|
required Metadata? metadata,
|
||||||
|
}) = _TenderApprovalsDataWrapper;
|
||||||
|
|
||||||
|
factory TenderApprovalsDataWrapper.fromJson(Map<String, Object?> json) =>
|
||||||
|
_$TenderApprovalsDataWrapperFromJson(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
@freezed
|
||||||
|
abstract class Metadata with _$Metadata {
|
||||||
|
const factory Metadata({
|
||||||
|
required int? total,
|
||||||
|
required int? limit,
|
||||||
|
required int? offset,
|
||||||
|
required int? page,
|
||||||
|
required int? pages,
|
||||||
|
}) = _Metadata;
|
||||||
|
|
||||||
|
factory Metadata.fromJson(Map<String, Object?> json) =>
|
||||||
|
_$MetadataFromJson(json);
|
||||||
|
}
|
||||||
+587
@@ -0,0 +1,587 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// coverage:ignore-file
|
||||||
|
// ignore_for_file: type=lint
|
||||||
|
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||||
|
|
||||||
|
part of 'tender_approvals_data_wrapper.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// FreezedGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
// dart format off
|
||||||
|
T _$identity<T>(T value) => value;
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
mixin _$TenderApprovalsDataWrapper {
|
||||||
|
|
||||||
|
List<TenderApprovalsData>? get tenders; Metadata? get metadata;
|
||||||
|
/// Create a copy of TenderApprovalsDataWrapper
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$TenderApprovalsDataWrapperCopyWith<TenderApprovalsDataWrapper> get copyWith => _$TenderApprovalsDataWrapperCopyWithImpl<TenderApprovalsDataWrapper>(this as TenderApprovalsDataWrapper, _$identity);
|
||||||
|
|
||||||
|
/// Serializes this TenderApprovalsDataWrapper to a JSON map.
|
||||||
|
Map<String, dynamic> toJson();
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is TenderApprovalsDataWrapper&&const DeepCollectionEquality().equals(other.tenders, tenders)&&(identical(other.metadata, metadata) || other.metadata == metadata));
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(tenders),metadata);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'TenderApprovalsDataWrapper(tenders: $tenders, metadata: $metadata)';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract mixin class $TenderApprovalsDataWrapperCopyWith<$Res> {
|
||||||
|
factory $TenderApprovalsDataWrapperCopyWith(TenderApprovalsDataWrapper value, $Res Function(TenderApprovalsDataWrapper) _then) = _$TenderApprovalsDataWrapperCopyWithImpl;
|
||||||
|
@useResult
|
||||||
|
$Res call({
|
||||||
|
List<TenderApprovalsData>? tenders, Metadata? metadata
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$MetadataCopyWith<$Res>? get metadata;
|
||||||
|
|
||||||
|
}
|
||||||
|
/// @nodoc
|
||||||
|
class _$TenderApprovalsDataWrapperCopyWithImpl<$Res>
|
||||||
|
implements $TenderApprovalsDataWrapperCopyWith<$Res> {
|
||||||
|
_$TenderApprovalsDataWrapperCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
|
final TenderApprovalsDataWrapper _self;
|
||||||
|
final $Res Function(TenderApprovalsDataWrapper) _then;
|
||||||
|
|
||||||
|
/// Create a copy of TenderApprovalsDataWrapper
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@pragma('vm:prefer-inline') @override $Res call({Object? tenders = freezed,Object? metadata = freezed,}) {
|
||||||
|
return _then(_self.copyWith(
|
||||||
|
tenders: freezed == tenders ? _self.tenders : tenders // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<TenderApprovalsData>?,metadata: freezed == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Metadata?,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
/// Create a copy of TenderApprovalsDataWrapper
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$MetadataCopyWith<$Res>? get metadata {
|
||||||
|
if (_self.metadata == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $MetadataCopyWith<$Res>(_self.metadata!, (value) {
|
||||||
|
return _then(_self.copyWith(metadata: value));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Adds pattern-matching-related methods to [TenderApprovalsDataWrapper].
|
||||||
|
extension TenderApprovalsDataWrapperPatterns on TenderApprovalsDataWrapper {
|
||||||
|
/// A variant of `map` that fallback to returning `orElse`.
|
||||||
|
///
|
||||||
|
/// It is equivalent to doing:
|
||||||
|
/// ```dart
|
||||||
|
/// switch (sealedClass) {
|
||||||
|
/// case final Subclass value:
|
||||||
|
/// return ...;
|
||||||
|
/// case _:
|
||||||
|
/// return orElse();
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
|
|
||||||
|
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _TenderApprovalsDataWrapper value)? $default,{required TResult orElse(),}){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _TenderApprovalsDataWrapper() when $default != null:
|
||||||
|
return $default(_that);case _:
|
||||||
|
return orElse();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// A `switch`-like method, using callbacks.
|
||||||
|
///
|
||||||
|
/// Callbacks receives the raw object, upcasted.
|
||||||
|
/// It is equivalent to doing:
|
||||||
|
/// ```dart
|
||||||
|
/// switch (sealedClass) {
|
||||||
|
/// case final Subclass value:
|
||||||
|
/// return ...;
|
||||||
|
/// case final Subclass2 value:
|
||||||
|
/// return ...;
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
|
|
||||||
|
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _TenderApprovalsDataWrapper value) $default,){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _TenderApprovalsDataWrapper():
|
||||||
|
return $default(_that);case _:
|
||||||
|
throw StateError('Unexpected subclass');
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// A variant of `map` that fallback to returning `null`.
|
||||||
|
///
|
||||||
|
/// It is equivalent to doing:
|
||||||
|
/// ```dart
|
||||||
|
/// switch (sealedClass) {
|
||||||
|
/// case final Subclass value:
|
||||||
|
/// return ...;
|
||||||
|
/// case _:
|
||||||
|
/// return null;
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
|
|
||||||
|
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _TenderApprovalsDataWrapper value)? $default,){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _TenderApprovalsDataWrapper() when $default != null:
|
||||||
|
return $default(_that);case _:
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// A variant of `when` that fallback to an `orElse` callback.
|
||||||
|
///
|
||||||
|
/// It is equivalent to doing:
|
||||||
|
/// ```dart
|
||||||
|
/// switch (sealedClass) {
|
||||||
|
/// case Subclass(:final field):
|
||||||
|
/// return ...;
|
||||||
|
/// case _:
|
||||||
|
/// return orElse();
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
|
|
||||||
|
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( List<TenderApprovalsData>? tenders, Metadata? metadata)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _TenderApprovalsDataWrapper() when $default != null:
|
||||||
|
return $default(_that.tenders,_that.metadata);case _:
|
||||||
|
return orElse();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// A `switch`-like method, using callbacks.
|
||||||
|
///
|
||||||
|
/// As opposed to `map`, this offers destructuring.
|
||||||
|
/// It is equivalent to doing:
|
||||||
|
/// ```dart
|
||||||
|
/// switch (sealedClass) {
|
||||||
|
/// case Subclass(:final field):
|
||||||
|
/// return ...;
|
||||||
|
/// case Subclass2(:final field2):
|
||||||
|
/// return ...;
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
|
|
||||||
|
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( List<TenderApprovalsData>? tenders, Metadata? metadata) $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _TenderApprovalsDataWrapper():
|
||||||
|
return $default(_that.tenders,_that.metadata);case _:
|
||||||
|
throw StateError('Unexpected subclass');
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// A variant of `when` that fallback to returning `null`
|
||||||
|
///
|
||||||
|
/// It is equivalent to doing:
|
||||||
|
/// ```dart
|
||||||
|
/// switch (sealedClass) {
|
||||||
|
/// case Subclass(:final field):
|
||||||
|
/// return ...;
|
||||||
|
/// case _:
|
||||||
|
/// return null;
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
|
|
||||||
|
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( List<TenderApprovalsData>? tenders, Metadata? metadata)? $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _TenderApprovalsDataWrapper() when $default != null:
|
||||||
|
return $default(_that.tenders,_that.metadata);case _:
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
@JsonSerializable()
|
||||||
|
|
||||||
|
class _TenderApprovalsDataWrapper implements TenderApprovalsDataWrapper {
|
||||||
|
const _TenderApprovalsDataWrapper({required final List<TenderApprovalsData>? tenders, required this.metadata}): _tenders = tenders;
|
||||||
|
factory _TenderApprovalsDataWrapper.fromJson(Map<String, dynamic> json) => _$TenderApprovalsDataWrapperFromJson(json);
|
||||||
|
|
||||||
|
final List<TenderApprovalsData>? _tenders;
|
||||||
|
@override List<TenderApprovalsData>? get tenders {
|
||||||
|
final value = _tenders;
|
||||||
|
if (value == null) return null;
|
||||||
|
if (_tenders is EqualUnmodifiableListView) return _tenders;
|
||||||
|
// ignore: implicit_dynamic_type
|
||||||
|
return EqualUnmodifiableListView(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override final Metadata? metadata;
|
||||||
|
|
||||||
|
/// Create a copy of TenderApprovalsDataWrapper
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
_$TenderApprovalsDataWrapperCopyWith<_TenderApprovalsDataWrapper> get copyWith => __$TenderApprovalsDataWrapperCopyWithImpl<_TenderApprovalsDataWrapper>(this, _$identity);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
return _$TenderApprovalsDataWrapperToJson(this, );
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _TenderApprovalsDataWrapper&&const DeepCollectionEquality().equals(other._tenders, _tenders)&&(identical(other.metadata, metadata) || other.metadata == metadata));
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_tenders),metadata);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'TenderApprovalsDataWrapper(tenders: $tenders, metadata: $metadata)';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract mixin class _$TenderApprovalsDataWrapperCopyWith<$Res> implements $TenderApprovalsDataWrapperCopyWith<$Res> {
|
||||||
|
factory _$TenderApprovalsDataWrapperCopyWith(_TenderApprovalsDataWrapper value, $Res Function(_TenderApprovalsDataWrapper) _then) = __$TenderApprovalsDataWrapperCopyWithImpl;
|
||||||
|
@override @useResult
|
||||||
|
$Res call({
|
||||||
|
List<TenderApprovalsData>? tenders, Metadata? metadata
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@override $MetadataCopyWith<$Res>? get metadata;
|
||||||
|
|
||||||
|
}
|
||||||
|
/// @nodoc
|
||||||
|
class __$TenderApprovalsDataWrapperCopyWithImpl<$Res>
|
||||||
|
implements _$TenderApprovalsDataWrapperCopyWith<$Res> {
|
||||||
|
__$TenderApprovalsDataWrapperCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
|
final _TenderApprovalsDataWrapper _self;
|
||||||
|
final $Res Function(_TenderApprovalsDataWrapper) _then;
|
||||||
|
|
||||||
|
/// Create a copy of TenderApprovalsDataWrapper
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override @pragma('vm:prefer-inline') $Res call({Object? tenders = freezed,Object? metadata = freezed,}) {
|
||||||
|
return _then(_TenderApprovalsDataWrapper(
|
||||||
|
tenders: freezed == tenders ? _self._tenders : tenders // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<TenderApprovalsData>?,metadata: freezed == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Metadata?,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Create a copy of TenderApprovalsDataWrapper
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$MetadataCopyWith<$Res>? get metadata {
|
||||||
|
if (_self.metadata == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $MetadataCopyWith<$Res>(_self.metadata!, (value) {
|
||||||
|
return _then(_self.copyWith(metadata: value));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
mixin _$Metadata {
|
||||||
|
|
||||||
|
int? get total; int? get limit; int? get offset; int? get page; int? get pages;
|
||||||
|
/// Create a copy of Metadata
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$MetadataCopyWith<Metadata> get copyWith => _$MetadataCopyWithImpl<Metadata>(this as Metadata, _$identity);
|
||||||
|
|
||||||
|
/// Serializes this Metadata to a JSON map.
|
||||||
|
Map<String, dynamic> toJson();
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is Metadata&&(identical(other.total, total) || other.total == total)&&(identical(other.limit, limit) || other.limit == limit)&&(identical(other.offset, offset) || other.offset == offset)&&(identical(other.page, page) || other.page == page)&&(identical(other.pages, pages) || other.pages == pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType,total,limit,offset,page,pages);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'Metadata(total: $total, limit: $limit, offset: $offset, page: $page, pages: $pages)';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract mixin class $MetadataCopyWith<$Res> {
|
||||||
|
factory $MetadataCopyWith(Metadata value, $Res Function(Metadata) _then) = _$MetadataCopyWithImpl;
|
||||||
|
@useResult
|
||||||
|
$Res call({
|
||||||
|
int? total, int? limit, int? offset, int? page, int? pages
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/// @nodoc
|
||||||
|
class _$MetadataCopyWithImpl<$Res>
|
||||||
|
implements $MetadataCopyWith<$Res> {
|
||||||
|
_$MetadataCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
|
final Metadata _self;
|
||||||
|
final $Res Function(Metadata) _then;
|
||||||
|
|
||||||
|
/// Create a copy of Metadata
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@pragma('vm:prefer-inline') @override $Res call({Object? total = freezed,Object? limit = freezed,Object? offset = freezed,Object? page = freezed,Object? pages = freezed,}) {
|
||||||
|
return _then(_self.copyWith(
|
||||||
|
total: freezed == total ? _self.total : total // ignore: cast_nullable_to_non_nullable
|
||||||
|
as int?,limit: freezed == limit ? _self.limit : limit // ignore: cast_nullable_to_non_nullable
|
||||||
|
as int?,offset: freezed == offset ? _self.offset : offset // ignore: cast_nullable_to_non_nullable
|
||||||
|
as int?,page: freezed == page ? _self.page : page // ignore: cast_nullable_to_non_nullable
|
||||||
|
as int?,pages: freezed == pages ? _self.pages : pages // ignore: cast_nullable_to_non_nullable
|
||||||
|
as int?,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Adds pattern-matching-related methods to [Metadata].
|
||||||
|
extension MetadataPatterns on Metadata {
|
||||||
|
/// A variant of `map` that fallback to returning `orElse`.
|
||||||
|
///
|
||||||
|
/// It is equivalent to doing:
|
||||||
|
/// ```dart
|
||||||
|
/// switch (sealedClass) {
|
||||||
|
/// case final Subclass value:
|
||||||
|
/// return ...;
|
||||||
|
/// case _:
|
||||||
|
/// return orElse();
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
|
|
||||||
|
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _Metadata value)? $default,{required TResult orElse(),}){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _Metadata() when $default != null:
|
||||||
|
return $default(_that);case _:
|
||||||
|
return orElse();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// A `switch`-like method, using callbacks.
|
||||||
|
///
|
||||||
|
/// Callbacks receives the raw object, upcasted.
|
||||||
|
/// It is equivalent to doing:
|
||||||
|
/// ```dart
|
||||||
|
/// switch (sealedClass) {
|
||||||
|
/// case final Subclass value:
|
||||||
|
/// return ...;
|
||||||
|
/// case final Subclass2 value:
|
||||||
|
/// return ...;
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
|
|
||||||
|
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _Metadata value) $default,){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _Metadata():
|
||||||
|
return $default(_that);case _:
|
||||||
|
throw StateError('Unexpected subclass');
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// A variant of `map` that fallback to returning `null`.
|
||||||
|
///
|
||||||
|
/// It is equivalent to doing:
|
||||||
|
/// ```dart
|
||||||
|
/// switch (sealedClass) {
|
||||||
|
/// case final Subclass value:
|
||||||
|
/// return ...;
|
||||||
|
/// case _:
|
||||||
|
/// return null;
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
|
|
||||||
|
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _Metadata value)? $default,){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _Metadata() when $default != null:
|
||||||
|
return $default(_that);case _:
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// A variant of `when` that fallback to an `orElse` callback.
|
||||||
|
///
|
||||||
|
/// It is equivalent to doing:
|
||||||
|
/// ```dart
|
||||||
|
/// switch (sealedClass) {
|
||||||
|
/// case Subclass(:final field):
|
||||||
|
/// return ...;
|
||||||
|
/// case _:
|
||||||
|
/// return orElse();
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
|
|
||||||
|
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int? total, int? limit, int? offset, int? page, int? pages)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _Metadata() when $default != null:
|
||||||
|
return $default(_that.total,_that.limit,_that.offset,_that.page,_that.pages);case _:
|
||||||
|
return orElse();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// A `switch`-like method, using callbacks.
|
||||||
|
///
|
||||||
|
/// As opposed to `map`, this offers destructuring.
|
||||||
|
/// It is equivalent to doing:
|
||||||
|
/// ```dart
|
||||||
|
/// switch (sealedClass) {
|
||||||
|
/// case Subclass(:final field):
|
||||||
|
/// return ...;
|
||||||
|
/// case Subclass2(:final field2):
|
||||||
|
/// return ...;
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
|
|
||||||
|
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int? total, int? limit, int? offset, int? page, int? pages) $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _Metadata():
|
||||||
|
return $default(_that.total,_that.limit,_that.offset,_that.page,_that.pages);case _:
|
||||||
|
throw StateError('Unexpected subclass');
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// A variant of `when` that fallback to returning `null`
|
||||||
|
///
|
||||||
|
/// It is equivalent to doing:
|
||||||
|
/// ```dart
|
||||||
|
/// switch (sealedClass) {
|
||||||
|
/// case Subclass(:final field):
|
||||||
|
/// return ...;
|
||||||
|
/// case _:
|
||||||
|
/// return null;
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
|
|
||||||
|
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int? total, int? limit, int? offset, int? page, int? pages)? $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _Metadata() when $default != null:
|
||||||
|
return $default(_that.total,_that.limit,_that.offset,_that.page,_that.pages);case _:
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
@JsonSerializable()
|
||||||
|
|
||||||
|
class _Metadata implements Metadata {
|
||||||
|
const _Metadata({required this.total, required this.limit, required this.offset, required this.page, required this.pages});
|
||||||
|
factory _Metadata.fromJson(Map<String, dynamic> json) => _$MetadataFromJson(json);
|
||||||
|
|
||||||
|
@override final int? total;
|
||||||
|
@override final int? limit;
|
||||||
|
@override final int? offset;
|
||||||
|
@override final int? page;
|
||||||
|
@override final int? pages;
|
||||||
|
|
||||||
|
/// Create a copy of Metadata
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
_$MetadataCopyWith<_Metadata> get copyWith => __$MetadataCopyWithImpl<_Metadata>(this, _$identity);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
return _$MetadataToJson(this, );
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _Metadata&&(identical(other.total, total) || other.total == total)&&(identical(other.limit, limit) || other.limit == limit)&&(identical(other.offset, offset) || other.offset == offset)&&(identical(other.page, page) || other.page == page)&&(identical(other.pages, pages) || other.pages == pages));
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType,total,limit,offset,page,pages);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'Metadata(total: $total, limit: $limit, offset: $offset, page: $page, pages: $pages)';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract mixin class _$MetadataCopyWith<$Res> implements $MetadataCopyWith<$Res> {
|
||||||
|
factory _$MetadataCopyWith(_Metadata value, $Res Function(_Metadata) _then) = __$MetadataCopyWithImpl;
|
||||||
|
@override @useResult
|
||||||
|
$Res call({
|
||||||
|
int? total, int? limit, int? offset, int? page, int? pages
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/// @nodoc
|
||||||
|
class __$MetadataCopyWithImpl<$Res>
|
||||||
|
implements _$MetadataCopyWith<$Res> {
|
||||||
|
__$MetadataCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
|
final _Metadata _self;
|
||||||
|
final $Res Function(_Metadata) _then;
|
||||||
|
|
||||||
|
/// Create a copy of Metadata
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override @pragma('vm:prefer-inline') $Res call({Object? total = freezed,Object? limit = freezed,Object? offset = freezed,Object? page = freezed,Object? pages = freezed,}) {
|
||||||
|
return _then(_Metadata(
|
||||||
|
total: freezed == total ? _self.total : total // ignore: cast_nullable_to_non_nullable
|
||||||
|
as int?,limit: freezed == limit ? _self.limit : limit // ignore: cast_nullable_to_non_nullable
|
||||||
|
as int?,offset: freezed == offset ? _self.offset : offset // ignore: cast_nullable_to_non_nullable
|
||||||
|
as int?,page: freezed == page ? _self.page : page // ignore: cast_nullable_to_non_nullable
|
||||||
|
as int?,pages: freezed == pages ? _self.pages : pages // ignore: cast_nullable_to_non_nullable
|
||||||
|
as int?,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// dart format on
|
||||||
+43
@@ -0,0 +1,43 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'tender_approvals_data_wrapper.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
_TenderApprovalsDataWrapper _$TenderApprovalsDataWrapperFromJson(
|
||||||
|
Map<String, dynamic> json,
|
||||||
|
) => _TenderApprovalsDataWrapper(
|
||||||
|
tenders:
|
||||||
|
(json['tenders'] as List<dynamic>?)
|
||||||
|
?.map((e) => TenderApprovalsData.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
metadata:
|
||||||
|
json['metadata'] == null
|
||||||
|
? null
|
||||||
|
: Metadata.fromJson(json['metadata'] as Map<String, dynamic>),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$TenderApprovalsDataWrapperToJson(
|
||||||
|
_TenderApprovalsDataWrapper instance,
|
||||||
|
) => <String, dynamic>{
|
||||||
|
'tenders': instance.tenders,
|
||||||
|
'metadata': instance.metadata,
|
||||||
|
};
|
||||||
|
|
||||||
|
_Metadata _$MetadataFromJson(Map<String, dynamic> json) => _Metadata(
|
||||||
|
total: (json['total'] as num?)?.toInt(),
|
||||||
|
limit: (json['limit'] as num?)?.toInt(),
|
||||||
|
offset: (json['offset'] as num?)?.toInt(),
|
||||||
|
page: (json['page'] as num?)?.toInt(),
|
||||||
|
pages: (json['pages'] as num?)?.toInt(),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$MetadataToJson(_Metadata instance) => <String, dynamic>{
|
||||||
|
'total': instance.total,
|
||||||
|
'limit': instance.limit,
|
||||||
|
'offset': instance.offset,
|
||||||
|
'page': instance.page,
|
||||||
|
'pages': instance.pages,
|
||||||
|
};
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||||
|
import 'package:tm_app/data/services/model/tender_approvals_data_warpper/tender_approvals_data_wrapper.dart';
|
||||||
|
|
||||||
import '../error/error_model.dart';
|
import '../error/error_model.dart';
|
||||||
import '../tender_approvals_data/tender_approvals_data.dart';
|
|
||||||
|
|
||||||
part 'tender_approvals_response.freezed.dart';
|
part 'tender_approvals_response.freezed.dart';
|
||||||
part 'tender_approvals_response.g.dart';
|
part 'tender_approvals_response.g.dart';
|
||||||
@@ -11,7 +11,7 @@ abstract class TenderApprovalsResponse with _$TenderApprovalsResponse {
|
|||||||
const factory TenderApprovalsResponse({
|
const factory TenderApprovalsResponse({
|
||||||
required bool? success,
|
required bool? success,
|
||||||
required ErrorModel? error,
|
required ErrorModel? error,
|
||||||
required List<TenderApprovalsData>? data,
|
required TenderApprovalsDataWrapper? data,
|
||||||
}) = _TenderApprovalsResponse;
|
}) = _TenderApprovalsResponse;
|
||||||
|
|
||||||
factory TenderApprovalsResponse.fromJson(Map<String, Object?> json) =>
|
factory TenderApprovalsResponse.fromJson(Map<String, Object?> json) =>
|
||||||
|
|||||||
+41
-25
@@ -15,7 +15,7 @@ T _$identity<T>(T value) => value;
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
mixin _$TenderApprovalsResponse {
|
mixin _$TenderApprovalsResponse {
|
||||||
|
|
||||||
bool? get success; ErrorModel? get error; List<TenderApprovalsData>? get data;
|
bool? get success; ErrorModel? get error; TenderApprovalsDataWrapper? get data;
|
||||||
/// Create a copy of TenderApprovalsResponse
|
/// Create a copy of TenderApprovalsResponse
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@@ -28,12 +28,12 @@ $TenderApprovalsResponseCopyWith<TenderApprovalsResponse> get copyWith => _$Tend
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is TenderApprovalsResponse&&(identical(other.success, success) || other.success == success)&&(identical(other.error, error) || other.error == error)&&const DeepCollectionEquality().equals(other.data, data));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is TenderApprovalsResponse&&(identical(other.success, success) || other.success == success)&&(identical(other.error, error) || other.error == error)&&(identical(other.data, data) || other.data == data));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,success,error,const DeepCollectionEquality().hash(data));
|
int get hashCode => Object.hash(runtimeType,success,error,data);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
@@ -48,11 +48,11 @@ abstract mixin class $TenderApprovalsResponseCopyWith<$Res> {
|
|||||||
factory $TenderApprovalsResponseCopyWith(TenderApprovalsResponse value, $Res Function(TenderApprovalsResponse) _then) = _$TenderApprovalsResponseCopyWithImpl;
|
factory $TenderApprovalsResponseCopyWith(TenderApprovalsResponse value, $Res Function(TenderApprovalsResponse) _then) = _$TenderApprovalsResponseCopyWithImpl;
|
||||||
@useResult
|
@useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
bool? success, ErrorModel? error, List<TenderApprovalsData>? data
|
bool? success, ErrorModel? error, TenderApprovalsDataWrapper? data
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$ErrorModelCopyWith<$Res>? get error;
|
$ErrorModelCopyWith<$Res>? get error;$TenderApprovalsDataWrapperCopyWith<$Res>? get data;
|
||||||
|
|
||||||
}
|
}
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@@ -70,7 +70,7 @@ class _$TenderApprovalsResponseCopyWithImpl<$Res>
|
|||||||
success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable
|
success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable
|
||||||
as bool?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
as bool?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
||||||
as ErrorModel?,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
|
as ErrorModel?,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
|
||||||
as List<TenderApprovalsData>?,
|
as TenderApprovalsDataWrapper?,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
/// Create a copy of TenderApprovalsResponse
|
/// Create a copy of TenderApprovalsResponse
|
||||||
@@ -85,6 +85,18 @@ $ErrorModelCopyWith<$Res>? get error {
|
|||||||
return $ErrorModelCopyWith<$Res>(_self.error!, (value) {
|
return $ErrorModelCopyWith<$Res>(_self.error!, (value) {
|
||||||
return _then(_self.copyWith(error: value));
|
return _then(_self.copyWith(error: value));
|
||||||
});
|
});
|
||||||
|
}/// Create a copy of TenderApprovalsResponse
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$TenderApprovalsDataWrapperCopyWith<$Res>? get data {
|
||||||
|
if (_self.data == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $TenderApprovalsDataWrapperCopyWith<$Res>(_self.data!, (value) {
|
||||||
|
return _then(_self.copyWith(data: value));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,7 +179,7 @@ return $default(_that);case _:
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool? success, ErrorModel? error, List<TenderApprovalsData>? data)? $default,{required TResult orElse(),}) {final _that = this;
|
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool? success, ErrorModel? error, TenderApprovalsDataWrapper? data)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _TenderApprovalsResponse() when $default != null:
|
case _TenderApprovalsResponse() when $default != null:
|
||||||
return $default(_that.success,_that.error,_that.data);case _:
|
return $default(_that.success,_that.error,_that.data);case _:
|
||||||
@@ -188,7 +200,7 @@ return $default(_that.success,_that.error,_that.data);case _:
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool? success, ErrorModel? error, List<TenderApprovalsData>? data) $default,) {final _that = this;
|
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool? success, ErrorModel? error, TenderApprovalsDataWrapper? data) $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _TenderApprovalsResponse():
|
case _TenderApprovalsResponse():
|
||||||
return $default(_that.success,_that.error,_that.data);case _:
|
return $default(_that.success,_that.error,_that.data);case _:
|
||||||
@@ -208,7 +220,7 @@ return $default(_that.success,_that.error,_that.data);case _:
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool? success, ErrorModel? error, List<TenderApprovalsData>? data)? $default,) {final _that = this;
|
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool? success, ErrorModel? error, TenderApprovalsDataWrapper? data)? $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _TenderApprovalsResponse() when $default != null:
|
case _TenderApprovalsResponse() when $default != null:
|
||||||
return $default(_that.success,_that.error,_that.data);case _:
|
return $default(_that.success,_that.error,_that.data);case _:
|
||||||
@@ -223,20 +235,12 @@ return $default(_that.success,_that.error,_that.data);case _:
|
|||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
|
|
||||||
class _TenderApprovalsResponse implements TenderApprovalsResponse {
|
class _TenderApprovalsResponse implements TenderApprovalsResponse {
|
||||||
const _TenderApprovalsResponse({required this.success, required this.error, required final List<TenderApprovalsData>? data}): _data = data;
|
const _TenderApprovalsResponse({required this.success, required this.error, required this.data});
|
||||||
factory _TenderApprovalsResponse.fromJson(Map<String, dynamic> json) => _$TenderApprovalsResponseFromJson(json);
|
factory _TenderApprovalsResponse.fromJson(Map<String, dynamic> json) => _$TenderApprovalsResponseFromJson(json);
|
||||||
|
|
||||||
@override final bool? success;
|
@override final bool? success;
|
||||||
@override final ErrorModel? error;
|
@override final ErrorModel? error;
|
||||||
final List<TenderApprovalsData>? _data;
|
@override final TenderApprovalsDataWrapper? data;
|
||||||
@override List<TenderApprovalsData>? get data {
|
|
||||||
final value = _data;
|
|
||||||
if (value == null) return null;
|
|
||||||
if (_data is EqualUnmodifiableListView) return _data;
|
|
||||||
// ignore: implicit_dynamic_type
|
|
||||||
return EqualUnmodifiableListView(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// Create a copy of TenderApprovalsResponse
|
/// Create a copy of TenderApprovalsResponse
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@@ -251,12 +255,12 @@ Map<String, dynamic> toJson() {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _TenderApprovalsResponse&&(identical(other.success, success) || other.success == success)&&(identical(other.error, error) || other.error == error)&&const DeepCollectionEquality().equals(other._data, _data));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _TenderApprovalsResponse&&(identical(other.success, success) || other.success == success)&&(identical(other.error, error) || other.error == error)&&(identical(other.data, data) || other.data == data));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,success,error,const DeepCollectionEquality().hash(_data));
|
int get hashCode => Object.hash(runtimeType,success,error,data);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
@@ -271,11 +275,11 @@ abstract mixin class _$TenderApprovalsResponseCopyWith<$Res> implements $TenderA
|
|||||||
factory _$TenderApprovalsResponseCopyWith(_TenderApprovalsResponse value, $Res Function(_TenderApprovalsResponse) _then) = __$TenderApprovalsResponseCopyWithImpl;
|
factory _$TenderApprovalsResponseCopyWith(_TenderApprovalsResponse value, $Res Function(_TenderApprovalsResponse) _then) = __$TenderApprovalsResponseCopyWithImpl;
|
||||||
@override @useResult
|
@override @useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
bool? success, ErrorModel? error, List<TenderApprovalsData>? data
|
bool? success, ErrorModel? error, TenderApprovalsDataWrapper? data
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@override $ErrorModelCopyWith<$Res>? get error;
|
@override $ErrorModelCopyWith<$Res>? get error;@override $TenderApprovalsDataWrapperCopyWith<$Res>? get data;
|
||||||
|
|
||||||
}
|
}
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@@ -292,8 +296,8 @@ class __$TenderApprovalsResponseCopyWithImpl<$Res>
|
|||||||
return _then(_TenderApprovalsResponse(
|
return _then(_TenderApprovalsResponse(
|
||||||
success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable
|
success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable
|
||||||
as bool?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
as bool?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
||||||
as ErrorModel?,data: freezed == data ? _self._data : data // ignore: cast_nullable_to_non_nullable
|
as ErrorModel?,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
|
||||||
as List<TenderApprovalsData>?,
|
as TenderApprovalsDataWrapper?,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,6 +313,18 @@ $ErrorModelCopyWith<$Res>? get error {
|
|||||||
return $ErrorModelCopyWith<$Res>(_self.error!, (value) {
|
return $ErrorModelCopyWith<$Res>(_self.error!, (value) {
|
||||||
return _then(_self.copyWith(error: value));
|
return _then(_self.copyWith(error: value));
|
||||||
});
|
});
|
||||||
|
}/// Create a copy of TenderApprovalsResponse
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$TenderApprovalsDataWrapperCopyWith<$Res>? get data {
|
||||||
|
if (_self.data == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $TenderApprovalsDataWrapperCopyWith<$Res>(_self.data!, (value) {
|
||||||
|
return _then(_self.copyWith(data: value));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,11 @@ _TenderApprovalsResponse _$TenderApprovalsResponseFromJson(
|
|||||||
? null
|
? null
|
||||||
: ErrorModel.fromJson(json['error'] as Map<String, dynamic>),
|
: ErrorModel.fromJson(json['error'] as Map<String, dynamic>),
|
||||||
data:
|
data:
|
||||||
(json['data'] as List<dynamic>?)
|
json['data'] == null
|
||||||
?.map((e) => TenderApprovalsData.fromJson(e as Map<String, dynamic>))
|
? null
|
||||||
.toList(),
|
: TenderApprovalsDataWrapper.fromJson(
|
||||||
|
json['data'] as Map<String, dynamic>,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$TenderApprovalsResponseToJson(
|
Map<String, dynamic> _$TenderApprovalsResponseToJson(
|
||||||
|
|||||||
+13
-1
@@ -35,6 +35,9 @@ class $AssetsIconsGen {
|
|||||||
/// File path: assets/icons/arrow-right.svg
|
/// File path: assets/icons/arrow-right.svg
|
||||||
String get arrowRight => 'assets/icons/arrow-right.svg';
|
String get arrowRight => 'assets/icons/arrow-right.svg';
|
||||||
|
|
||||||
|
/// File path: assets/icons/arrow_down_small.svg
|
||||||
|
String get arrowDownSmall => 'assets/icons/arrow_down_small.svg';
|
||||||
|
|
||||||
/// File path: assets/icons/arrows.svg
|
/// File path: assets/icons/arrows.svg
|
||||||
String get arrows => 'assets/icons/arrows.svg';
|
String get arrows => 'assets/icons/arrows.svg';
|
||||||
|
|
||||||
@@ -129,6 +132,7 @@ class $AssetsIconsGen {
|
|||||||
arrowLeftSmall,
|
arrowLeftSmall,
|
||||||
arrowRightSmall,
|
arrowRightSmall,
|
||||||
arrowRight,
|
arrowRight,
|
||||||
|
arrowDownSmall,
|
||||||
arrows,
|
arrows,
|
||||||
calendar,
|
calendar,
|
||||||
closeCircle,
|
closeCircle,
|
||||||
@@ -163,6 +167,9 @@ class $AssetsIconsGen {
|
|||||||
class $AssetsPngsGen {
|
class $AssetsPngsGen {
|
||||||
const $AssetsPngsGen();
|
const $AssetsPngsGen();
|
||||||
|
|
||||||
|
/// File path: assets/pngs/app_logo.png
|
||||||
|
AssetGenImage get appLogo => const AssetGenImage('assets/pngs/app_logo.png');
|
||||||
|
|
||||||
/// File path: assets/pngs/forgot_password.png
|
/// File path: assets/pngs/forgot_password.png
|
||||||
AssetGenImage get forgotPassword =>
|
AssetGenImage get forgotPassword =>
|
||||||
const AssetGenImage('assets/pngs/forgot_password.png');
|
const AssetGenImage('assets/pngs/forgot_password.png');
|
||||||
@@ -175,7 +182,12 @@ class $AssetsPngsGen {
|
|||||||
const AssetGenImage('assets/pngs/web_login_image.png');
|
const AssetGenImage('assets/pngs/web_login_image.png');
|
||||||
|
|
||||||
/// List of all assets
|
/// List of all assets
|
||||||
List<AssetGenImage> get values => [forgotPassword, logo, webLoginImage];
|
List<AssetGenImage> get values => [
|
||||||
|
appLogo,
|
||||||
|
forgotPassword,
|
||||||
|
logo,
|
||||||
|
webLoginImage,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
class $AssetsSvgsGen {
|
class $AssetsSvgsGen {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class HomeViewModel with ChangeNotifier {
|
|||||||
final HomeRepository _homeRepository;
|
final HomeRepository _homeRepository;
|
||||||
|
|
||||||
HomeViewModel({required HomeRepository homeRepository})
|
HomeViewModel({required HomeRepository homeRepository})
|
||||||
: _homeRepository = homeRepository {
|
: _homeRepository = homeRepository {
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,7 +36,6 @@ class HomeViewModel with ChangeNotifier {
|
|||||||
bool _isLoadingMore = false;
|
bool _isLoadingMore = false;
|
||||||
bool _hasMore = true;
|
bool _hasMore = true;
|
||||||
|
|
||||||
/// آیا الان در حالت Recommended هستیم یا YourTenders
|
|
||||||
bool _isRecommendedMode = false;
|
bool _isRecommendedMode = false;
|
||||||
|
|
||||||
List<TenderData> get tenders => _tenders;
|
List<TenderData> get tenders => _tenders;
|
||||||
@@ -46,11 +45,11 @@ class HomeViewModel with ChangeNotifier {
|
|||||||
|
|
||||||
void init() async {
|
void init() async {
|
||||||
await getApprovedStates();
|
await getApprovedStates();
|
||||||
await getYourTenders();
|
await getYourTenders(reset: true);
|
||||||
await getFeedbackStats();
|
await getFeedbackStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getHomeRecommandTenders({bool reset = false}) async {
|
Future<void> getHomeRecommendTenders({bool reset = false}) async {
|
||||||
if (_isLoadingMore || (!_hasMore && !reset)) {
|
if (_isLoadingMore || (!_hasMore && !reset)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -63,7 +62,7 @@ class HomeViewModel with ChangeNotifier {
|
|||||||
|
|
||||||
_isLoadingMore = true;
|
_isLoadingMore = true;
|
||||||
_errorMessage = null;
|
_errorMessage = null;
|
||||||
_isRecommendedMode = true; // ✅ اینجا یعنی در حالت Recommended هستیم
|
_isRecommendedMode = true;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|
||||||
final result = await _homeRepository.getHomeRecommendedTenders(
|
final result = await _homeRepository.getHomeRecommendedTenders(
|
||||||
@@ -94,38 +93,58 @@ class HomeViewModel with ChangeNotifier {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getYourTenders() async {
|
Future<void> getYourTenders({bool reset = false}) async {
|
||||||
_isLoading = true;
|
if (_isLoadingMore || (!_hasMore && !reset)) {
|
||||||
_isRecommendedMode = false; // ✅ وقتی YourTenders میاد → بدون pagination
|
return;
|
||||||
notifyListeners();
|
|
||||||
|
|
||||||
final result = await _homeRepository.getYourTenders();
|
|
||||||
|
|
||||||
switch (result) {
|
|
||||||
case Ok<TenderApprovalsResponse>():
|
|
||||||
data = result.value;
|
|
||||||
_errorMessage = null;
|
|
||||||
|
|
||||||
if (data?.data?.isEmpty ?? true) {
|
|
||||||
// اگه YourTenders خالی بود → برو سمت Recommended
|
|
||||||
await getHomeRecommandTenders(reset: true);
|
|
||||||
} else {
|
|
||||||
_tenders.clear();
|
|
||||||
_tenders.addAll(
|
|
||||||
data!.data!.map((e) => e.tender).whereType<TenderData>(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
case Error<TenderApprovalsResponse>():
|
|
||||||
_errorMessage = result.error.toString();
|
|
||||||
await getHomeRecommandTenders(reset: true);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
_isLoading = false;
|
|
||||||
notifyListeners();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (reset) {
|
||||||
|
_currentPage = 0;
|
||||||
|
_hasMore = true;
|
||||||
|
_tenders.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
_isLoadingMore = true;
|
||||||
|
_errorMessage = null;
|
||||||
|
_isRecommendedMode = false;
|
||||||
|
notifyListeners();
|
||||||
|
|
||||||
|
final result = await _homeRepository.getYourTenders(
|
||||||
|
limit: _pageSize,
|
||||||
|
offset: _currentPage * _pageSize,
|
||||||
|
);
|
||||||
|
|
||||||
|
switch (result) {
|
||||||
|
case Ok<TenderApprovalsResponse>():
|
||||||
|
data = result.value;
|
||||||
|
|
||||||
|
final tendersList = data?.data?.tenders ?? [];
|
||||||
|
final metadata = data?.data?.metadata;
|
||||||
|
|
||||||
|
if (tendersList.isNotEmpty) {
|
||||||
|
_tenders.addAll(
|
||||||
|
tendersList.map((e) => e.tender).whereType<TenderData>(),
|
||||||
|
);
|
||||||
|
_currentPage++;
|
||||||
|
|
||||||
|
if (metadata != null && (_currentPage >= metadata.pages!)) {
|
||||||
|
_hasMore = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
_hasMore = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Error<TenderApprovalsResponse>():
|
||||||
|
_errorMessage = result.error.toString();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
_isLoadingMore = false;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Future<void> getApprovedStates() async {
|
Future<void> getApprovedStates() async {
|
||||||
_isLoading = true;
|
_isLoading = true;
|
||||||
_errorMessage = null;
|
_errorMessage = null;
|
||||||
@@ -166,7 +185,6 @@ class HomeViewModel with ChangeNotifier {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculation methods for progress bars
|
|
||||||
double get partnershipCount {
|
double get partnershipCount {
|
||||||
return tenderApprovalsStateResponse?.data?.partnershipCount?.toDouble() ??
|
return tenderApprovalsStateResponse?.data?.partnershipCount?.toDouble() ??
|
||||||
0.0;
|
0.0;
|
||||||
|
|||||||
@@ -169,7 +169,8 @@ class DesktopHomePage extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _yourTenderText(HomeViewModel homeViewModel) {
|
Widget _yourTenderText(HomeViewModel homeViewModel) {
|
||||||
final isYourTenders = homeViewModel.data?.data?.isNotEmpty ?? false;
|
final isYourTenders =
|
||||||
|
homeViewModel.data?.data?.tenders!.isNotEmpty ?? false;
|
||||||
return ConstrainedBox(
|
return ConstrainedBox(
|
||||||
constraints: BoxConstraints(maxWidth: 740),
|
constraints: BoxConstraints(maxWidth: 740),
|
||||||
child: Align(
|
child: Align(
|
||||||
@@ -190,16 +191,23 @@ class DesktopHomePage extends StatelessWidget {
|
|||||||
|
|
||||||
Widget _bottomListView(HomeViewModel homeViewModel) {
|
Widget _bottomListView(HomeViewModel homeViewModel) {
|
||||||
final controller = ScrollController();
|
final controller = ScrollController();
|
||||||
controller.addListener(() {
|
if (!homeViewModel.isRecommendedMode) {
|
||||||
if (homeViewModel.isRecommendedMode) {
|
// YourTenders
|
||||||
if (controller.position.pixels >=
|
if (controller.position.pixels >=
|
||||||
controller.position.maxScrollExtent - 200) {
|
controller.position.maxScrollExtent - 200) {
|
||||||
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
||||||
homeViewModel.getHomeRecommandTenders();
|
homeViewModel.getYourTenders();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
} else {
|
||||||
|
// Recommended
|
||||||
|
if (controller.position.pixels >=
|
||||||
|
controller.position.maxScrollExtent - 200) {
|
||||||
|
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
||||||
|
homeViewModel.getHomeRecommendTenders();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: 740,
|
width: 740,
|
||||||
|
|||||||
@@ -163,7 +163,8 @@ class MobileHomePage extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _yourTenderText(HomeViewModel homeViewModel) {
|
Widget _yourTenderText(HomeViewModel homeViewModel) {
|
||||||
final isYourTenders = homeViewModel.data?.data?.isNotEmpty ?? false;
|
final isYourTenders =
|
||||||
|
homeViewModel.data?.data?.tenders!.isNotEmpty ?? false;
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 24.0.w()),
|
padding: EdgeInsets.symmetric(horizontal: 24.0.w()),
|
||||||
child: Text(
|
child: Text(
|
||||||
@@ -183,11 +184,20 @@ class MobileHomePage extends StatelessWidget {
|
|||||||
final controller = ScrollController();
|
final controller = ScrollController();
|
||||||
|
|
||||||
controller.addListener(() {
|
controller.addListener(() {
|
||||||
if (homeViewModel.isRecommendedMode) {
|
if (!homeViewModel.isRecommendedMode) {
|
||||||
|
// YourTenders
|
||||||
if (controller.position.pixels >=
|
if (controller.position.pixels >=
|
||||||
controller.position.maxScrollExtent - 200) {
|
controller.position.maxScrollExtent - 200) {
|
||||||
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
||||||
homeViewModel.getHomeRecommandTenders();
|
homeViewModel.getYourTenders();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Recommended
|
||||||
|
if (controller.position.pixels >=
|
||||||
|
controller.position.maxScrollExtent - 200) {
|
||||||
|
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
||||||
|
homeViewModel.getHomeRecommendTenders();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -195,7 +195,8 @@ class TabletHomePage extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _yourTenderText(HomeViewModel homeViewModel) {
|
Widget _yourTenderText(HomeViewModel homeViewModel) {
|
||||||
final isYourTenders = homeViewModel.data?.data?.isNotEmpty ?? false;
|
final isYourTenders =
|
||||||
|
homeViewModel.data?.data?.tenders!.isNotEmpty ?? false;
|
||||||
return Text(
|
return Text(
|
||||||
isYourTenders ? HomeStrings.yourTenders : HomeStrings.recommendedTenders,
|
isYourTenders ? HomeStrings.yourTenders : HomeStrings.recommendedTenders,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -209,16 +210,23 @@ class TabletHomePage extends StatelessWidget {
|
|||||||
Widget _bottomListView(HomeViewModel homeViewModel) {
|
Widget _bottomListView(HomeViewModel homeViewModel) {
|
||||||
final controller = ScrollController();
|
final controller = ScrollController();
|
||||||
|
|
||||||
controller.addListener(() {
|
if (!homeViewModel.isRecommendedMode) {
|
||||||
if (homeViewModel.isRecommendedMode) {
|
// YourTenders
|
||||||
if (controller.position.pixels >=
|
if (controller.position.pixels >=
|
||||||
controller.position.maxScrollExtent - 200) {
|
controller.position.maxScrollExtent - 200) {
|
||||||
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
||||||
homeViewModel.getHomeRecommandTenders();
|
homeViewModel.getYourTenders();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
} else {
|
||||||
|
// Recommended
|
||||||
|
if (controller.position.pixels >=
|
||||||
|
controller.position.maxScrollExtent - 200) {
|
||||||
|
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
||||||
|
homeViewModel.getHomeRecommendTenders();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ class TendersSubmitted extends StatelessWidget {
|
|||||||
? const Center(child: Text('No submitted projects yet.'))
|
? const Center(child: Text('No submitted projects yet.'))
|
||||||
: ListView.builder(
|
: ListView.builder(
|
||||||
padding: const EdgeInsets.only(top: 20),
|
padding: const EdgeInsets.only(top: 20),
|
||||||
itemCount: approvedTenders.data!.length,
|
itemCount: approvedTenders.data!.tenders!.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final tender = approvedTenders.data![index];
|
final tender = approvedTenders.data!.tenders![index];
|
||||||
return TenderCard(
|
return TenderCard(
|
||||||
date: tender.createdAt!.toString(),
|
date: tender.createdAt!.toString(),
|
||||||
title: tender.tender!.title!,
|
title: tender.tender!.title!,
|
||||||
|
|||||||
Reference in New Issue
Block a user