Merge pull request 'some changes navigation in web and response changes' (#67) from changes into main
Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/67
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<application
|
||||
android:label="tm_app"
|
||||
android:name="${applicationName}"
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:tm_app/core/constants/assets.dart';
|
||||
import 'package:tm_app/core/constants/strings.dart';
|
||||
import 'package:tm_app/core/theme/colors.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
|
||||
class DesktopShellPage extends StatelessWidget {
|
||||
const DesktopShellPage({
|
||||
@@ -18,91 +13,6 @@ class DesktopShellPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Column(
|
||||
children: [_navigationBar(context), Expanded(child: navigationShell)],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Container _navigationBar(BuildContext context) {
|
||||
return Container(
|
||||
height: 64,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.backgroundColor,
|
||||
border: Border(bottom: BorderSide(color: AppColors.grey30)),
|
||||
),
|
||||
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(width: 40),
|
||||
SvgPicture.asset(AssetsManager.logoSmall),
|
||||
Spacer(),
|
||||
_bottomNavigationItem(
|
||||
context: context,
|
||||
text: AppStrings.home,
|
||||
isActive: navigationShell.currentIndex == 0,
|
||||
onTap: () => onTap(0),
|
||||
iconPath: AssetsManager.home,
|
||||
activeIconPath: AssetsManager.homeActive,
|
||||
),
|
||||
SizedBox(width: 24),
|
||||
_bottomNavigationItem(
|
||||
context: context,
|
||||
text: AppStrings.tendersTitle,
|
||||
isActive: navigationShell.currentIndex == 1,
|
||||
onTap: () => onTap(1),
|
||||
iconPath: AssetsManager.tenders,
|
||||
activeIconPath: AssetsManager.tendersActive,
|
||||
),
|
||||
SizedBox(width: 24),
|
||||
_bottomNavigationItem(
|
||||
context: context,
|
||||
text: AppStrings.profile,
|
||||
isActive: navigationShell.currentIndex == 2,
|
||||
onTap: () => onTap(2),
|
||||
iconPath: AssetsManager.profile,
|
||||
activeIconPath: AssetsManager.profileActive,
|
||||
),
|
||||
Spacer(),
|
||||
SizedBox(width: 68),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _bottomNavigationItem({
|
||||
required BuildContext context,
|
||||
required String text,
|
||||
required bool isActive,
|
||||
required VoidCallback onTap,
|
||||
required String iconPath,
|
||||
required String activeIconPath,
|
||||
}) {
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
child: SizedBox(
|
||||
width: 100.0,
|
||||
height: 64,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SvgPicture.asset(isActive ? activeIconPath : iconPath),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontSize: 12.0.sp(),
|
||||
fontWeight: FontWeight.w400,
|
||||
color: isActive ? AppColors.primaryColor : AppColors.grey60,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
return Scaffold(body: navigationShell);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-4
@@ -11,12 +11,14 @@ abstract class TenderApprovalsStateData with _$TenderApprovalsStateData {
|
||||
const factory TenderApprovalsStateData({
|
||||
@JsonKey(name: 'company_id') required String? companyId,
|
||||
@JsonKey(name: 'total_approvals') required int? totalApprovals,
|
||||
@JsonKey(name: 'approved_tenders') required int? approvedTenders,
|
||||
@JsonKey(name: 'submitted_tenders') required int? submittedTenders,
|
||||
@JsonKey(name: 'rejected_tenders') required int? rejectedTenders,
|
||||
@JsonKey(name: 'self_apply_count') required int? selfApplyCount,
|
||||
@JsonKey(name: 'partnership_count') required int? partnershipCount,
|
||||
@JsonKey(name: 'approvals_by_status') required ApprovalsByStatus? approvalsByStatus,
|
||||
@JsonKey(name: 'approvals_by_submission') required ApprovalsBySubmission? approvalsBySubmission,
|
||||
@JsonKey(name: 'approvals_by_status')
|
||||
required ApprovalsByStatus? approvalsByStatus,
|
||||
@JsonKey(name: 'approvals_by_submission')
|
||||
required ApprovalsBySubmission? approvalsBySubmission,
|
||||
@JsonKey(name: 'last_updated') required int? lastUpdated,
|
||||
}) = _TenderApprovalsStateData;
|
||||
|
||||
@@ -27,7 +29,7 @@ abstract class TenderApprovalsStateData with _$TenderApprovalsStateData {
|
||||
@freezed
|
||||
abstract class ApprovalsByStatus with _$ApprovalsByStatus {
|
||||
const factory ApprovalsByStatus({
|
||||
@JsonKey(name: 'approved') required int? approved,
|
||||
@JsonKey(name: 'submitted') required int? submitted,
|
||||
@JsonKey(name: 'rejected') required int? rejected,
|
||||
}) = _ApprovalsByStatus;
|
||||
|
||||
|
||||
+42
-42
@@ -15,7 +15,7 @@ T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$TenderApprovalsStateData {
|
||||
|
||||
@JsonKey(name: 'company_id') String? get companyId;@JsonKey(name: 'total_approvals') int? get totalApprovals;@JsonKey(name: 'approved_tenders') int? get approvedTenders;@JsonKey(name: 'rejected_tenders') int? get rejectedTenders;@JsonKey(name: 'self_apply_count') int? get selfApplyCount;@JsonKey(name: 'partnership_count') int? get partnershipCount;@JsonKey(name: 'approvals_by_status') ApprovalsByStatus? get approvalsByStatus;@JsonKey(name: 'approvals_by_submission') ApprovalsBySubmission? get approvalsBySubmission;@JsonKey(name: 'last_updated') int? get lastUpdated;
|
||||
@JsonKey(name: 'company_id') String? get companyId;@JsonKey(name: 'total_approvals') int? get totalApprovals;@JsonKey(name: 'submitted_tenders') int? get submittedTenders;@JsonKey(name: 'rejected_tenders') int? get rejectedTenders;@JsonKey(name: 'self_apply_count') int? get selfApplyCount;@JsonKey(name: 'partnership_count') int? get partnershipCount;@JsonKey(name: 'approvals_by_status') ApprovalsByStatus? get approvalsByStatus;@JsonKey(name: 'approvals_by_submission') ApprovalsBySubmission? get approvalsBySubmission;@JsonKey(name: 'last_updated') int? get lastUpdated;
|
||||
/// Create a copy of TenderApprovalsStateData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -28,16 +28,16 @@ $TenderApprovalsStateDataCopyWith<TenderApprovalsStateData> get copyWith => _$Te
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is TenderApprovalsStateData&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.totalApprovals, totalApprovals) || other.totalApprovals == totalApprovals)&&(identical(other.approvedTenders, approvedTenders) || other.approvedTenders == approvedTenders)&&(identical(other.rejectedTenders, rejectedTenders) || other.rejectedTenders == rejectedTenders)&&(identical(other.selfApplyCount, selfApplyCount) || other.selfApplyCount == selfApplyCount)&&(identical(other.partnershipCount, partnershipCount) || other.partnershipCount == partnershipCount)&&(identical(other.approvalsByStatus, approvalsByStatus) || other.approvalsByStatus == approvalsByStatus)&&(identical(other.approvalsBySubmission, approvalsBySubmission) || other.approvalsBySubmission == approvalsBySubmission)&&(identical(other.lastUpdated, lastUpdated) || other.lastUpdated == lastUpdated));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is TenderApprovalsStateData&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.totalApprovals, totalApprovals) || other.totalApprovals == totalApprovals)&&(identical(other.submittedTenders, submittedTenders) || other.submittedTenders == submittedTenders)&&(identical(other.rejectedTenders, rejectedTenders) || other.rejectedTenders == rejectedTenders)&&(identical(other.selfApplyCount, selfApplyCount) || other.selfApplyCount == selfApplyCount)&&(identical(other.partnershipCount, partnershipCount) || other.partnershipCount == partnershipCount)&&(identical(other.approvalsByStatus, approvalsByStatus) || other.approvalsByStatus == approvalsByStatus)&&(identical(other.approvalsBySubmission, approvalsBySubmission) || other.approvalsBySubmission == approvalsBySubmission)&&(identical(other.lastUpdated, lastUpdated) || other.lastUpdated == lastUpdated));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,companyId,totalApprovals,approvedTenders,rejectedTenders,selfApplyCount,partnershipCount,approvalsByStatus,approvalsBySubmission,lastUpdated);
|
||||
int get hashCode => Object.hash(runtimeType,companyId,totalApprovals,submittedTenders,rejectedTenders,selfApplyCount,partnershipCount,approvalsByStatus,approvalsBySubmission,lastUpdated);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'TenderApprovalsStateData(companyId: $companyId, totalApprovals: $totalApprovals, approvedTenders: $approvedTenders, rejectedTenders: $rejectedTenders, selfApplyCount: $selfApplyCount, partnershipCount: $partnershipCount, approvalsByStatus: $approvalsByStatus, approvalsBySubmission: $approvalsBySubmission, lastUpdated: $lastUpdated)';
|
||||
return 'TenderApprovalsStateData(companyId: $companyId, totalApprovals: $totalApprovals, submittedTenders: $submittedTenders, rejectedTenders: $rejectedTenders, selfApplyCount: $selfApplyCount, partnershipCount: $partnershipCount, approvalsByStatus: $approvalsByStatus, approvalsBySubmission: $approvalsBySubmission, lastUpdated: $lastUpdated)';
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ abstract mixin class $TenderApprovalsStateDataCopyWith<$Res> {
|
||||
factory $TenderApprovalsStateDataCopyWith(TenderApprovalsStateData value, $Res Function(TenderApprovalsStateData) _then) = _$TenderApprovalsStateDataCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
@JsonKey(name: 'company_id') String? companyId,@JsonKey(name: 'total_approvals') int? totalApprovals,@JsonKey(name: 'approved_tenders') int? approvedTenders,@JsonKey(name: 'rejected_tenders') int? rejectedTenders,@JsonKey(name: 'self_apply_count') int? selfApplyCount,@JsonKey(name: 'partnership_count') int? partnershipCount,@JsonKey(name: 'approvals_by_status') ApprovalsByStatus? approvalsByStatus,@JsonKey(name: 'approvals_by_submission') ApprovalsBySubmission? approvalsBySubmission,@JsonKey(name: 'last_updated') int? lastUpdated
|
||||
@JsonKey(name: 'company_id') String? companyId,@JsonKey(name: 'total_approvals') int? totalApprovals,@JsonKey(name: 'submitted_tenders') int? submittedTenders,@JsonKey(name: 'rejected_tenders') int? rejectedTenders,@JsonKey(name: 'self_apply_count') int? selfApplyCount,@JsonKey(name: 'partnership_count') int? partnershipCount,@JsonKey(name: 'approvals_by_status') ApprovalsByStatus? approvalsByStatus,@JsonKey(name: 'approvals_by_submission') ApprovalsBySubmission? approvalsBySubmission,@JsonKey(name: 'last_updated') int? lastUpdated
|
||||
});
|
||||
|
||||
|
||||
@@ -65,11 +65,11 @@ class _$TenderApprovalsStateDataCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of TenderApprovalsStateData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? companyId = freezed,Object? totalApprovals = freezed,Object? approvedTenders = freezed,Object? rejectedTenders = freezed,Object? selfApplyCount = freezed,Object? partnershipCount = freezed,Object? approvalsByStatus = freezed,Object? approvalsBySubmission = freezed,Object? lastUpdated = freezed,}) {
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? companyId = freezed,Object? totalApprovals = freezed,Object? submittedTenders = freezed,Object? rejectedTenders = freezed,Object? selfApplyCount = freezed,Object? partnershipCount = freezed,Object? approvalsByStatus = freezed,Object? approvalsBySubmission = freezed,Object? lastUpdated = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
companyId: freezed == companyId ? _self.companyId : companyId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,totalApprovals: freezed == totalApprovals ? _self.totalApprovals : totalApprovals // ignore: cast_nullable_to_non_nullable
|
||||
as int?,approvedTenders: freezed == approvedTenders ? _self.approvedTenders : approvedTenders // ignore: cast_nullable_to_non_nullable
|
||||
as int?,submittedTenders: freezed == submittedTenders ? _self.submittedTenders : submittedTenders // ignore: cast_nullable_to_non_nullable
|
||||
as int?,rejectedTenders: freezed == rejectedTenders ? _self.rejectedTenders : rejectedTenders // ignore: cast_nullable_to_non_nullable
|
||||
as int?,selfApplyCount: freezed == selfApplyCount ? _self.selfApplyCount : selfApplyCount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,partnershipCount: freezed == partnershipCount ? _self.partnershipCount : partnershipCount // ignore: cast_nullable_to_non_nullable
|
||||
@@ -185,10 +185,10 @@ return $default(_that);case _:
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function(@JsonKey(name: 'company_id') String? companyId, @JsonKey(name: 'total_approvals') int? totalApprovals, @JsonKey(name: 'approved_tenders') int? approvedTenders, @JsonKey(name: 'rejected_tenders') int? rejectedTenders, @JsonKey(name: 'self_apply_count') int? selfApplyCount, @JsonKey(name: 'partnership_count') int? partnershipCount, @JsonKey(name: 'approvals_by_status') ApprovalsByStatus? approvalsByStatus, @JsonKey(name: 'approvals_by_submission') ApprovalsBySubmission? approvalsBySubmission, @JsonKey(name: 'last_updated') int? lastUpdated)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function(@JsonKey(name: 'company_id') String? companyId, @JsonKey(name: 'total_approvals') int? totalApprovals, @JsonKey(name: 'submitted_tenders') int? submittedTenders, @JsonKey(name: 'rejected_tenders') int? rejectedTenders, @JsonKey(name: 'self_apply_count') int? selfApplyCount, @JsonKey(name: 'partnership_count') int? partnershipCount, @JsonKey(name: 'approvals_by_status') ApprovalsByStatus? approvalsByStatus, @JsonKey(name: 'approvals_by_submission') ApprovalsBySubmission? approvalsBySubmission, @JsonKey(name: 'last_updated') int? lastUpdated)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _TenderApprovalsStateData() when $default != null:
|
||||
return $default(_that.companyId,_that.totalApprovals,_that.approvedTenders,_that.rejectedTenders,_that.selfApplyCount,_that.partnershipCount,_that.approvalsByStatus,_that.approvalsBySubmission,_that.lastUpdated);case _:
|
||||
return $default(_that.companyId,_that.totalApprovals,_that.submittedTenders,_that.rejectedTenders,_that.selfApplyCount,_that.partnershipCount,_that.approvalsByStatus,_that.approvalsBySubmission,_that.lastUpdated);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
@@ -206,10 +206,10 @@ return $default(_that.companyId,_that.totalApprovals,_that.approvedTenders,_that
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function(@JsonKey(name: 'company_id') String? companyId, @JsonKey(name: 'total_approvals') int? totalApprovals, @JsonKey(name: 'approved_tenders') int? approvedTenders, @JsonKey(name: 'rejected_tenders') int? rejectedTenders, @JsonKey(name: 'self_apply_count') int? selfApplyCount, @JsonKey(name: 'partnership_count') int? partnershipCount, @JsonKey(name: 'approvals_by_status') ApprovalsByStatus? approvalsByStatus, @JsonKey(name: 'approvals_by_submission') ApprovalsBySubmission? approvalsBySubmission, @JsonKey(name: 'last_updated') int? lastUpdated) $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function(@JsonKey(name: 'company_id') String? companyId, @JsonKey(name: 'total_approvals') int? totalApprovals, @JsonKey(name: 'submitted_tenders') int? submittedTenders, @JsonKey(name: 'rejected_tenders') int? rejectedTenders, @JsonKey(name: 'self_apply_count') int? selfApplyCount, @JsonKey(name: 'partnership_count') int? partnershipCount, @JsonKey(name: 'approvals_by_status') ApprovalsByStatus? approvalsByStatus, @JsonKey(name: 'approvals_by_submission') ApprovalsBySubmission? approvalsBySubmission, @JsonKey(name: 'last_updated') int? lastUpdated) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _TenderApprovalsStateData():
|
||||
return $default(_that.companyId,_that.totalApprovals,_that.approvedTenders,_that.rejectedTenders,_that.selfApplyCount,_that.partnershipCount,_that.approvalsByStatus,_that.approvalsBySubmission,_that.lastUpdated);case _:
|
||||
return $default(_that.companyId,_that.totalApprovals,_that.submittedTenders,_that.rejectedTenders,_that.selfApplyCount,_that.partnershipCount,_that.approvalsByStatus,_that.approvalsBySubmission,_that.lastUpdated);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
@@ -226,10 +226,10 @@ return $default(_that.companyId,_that.totalApprovals,_that.approvedTenders,_that
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function(@JsonKey(name: 'company_id') String? companyId, @JsonKey(name: 'total_approvals') int? totalApprovals, @JsonKey(name: 'approved_tenders') int? approvedTenders, @JsonKey(name: 'rejected_tenders') int? rejectedTenders, @JsonKey(name: 'self_apply_count') int? selfApplyCount, @JsonKey(name: 'partnership_count') int? partnershipCount, @JsonKey(name: 'approvals_by_status') ApprovalsByStatus? approvalsByStatus, @JsonKey(name: 'approvals_by_submission') ApprovalsBySubmission? approvalsBySubmission, @JsonKey(name: 'last_updated') int? lastUpdated)? $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function(@JsonKey(name: 'company_id') String? companyId, @JsonKey(name: 'total_approvals') int? totalApprovals, @JsonKey(name: 'submitted_tenders') int? submittedTenders, @JsonKey(name: 'rejected_tenders') int? rejectedTenders, @JsonKey(name: 'self_apply_count') int? selfApplyCount, @JsonKey(name: 'partnership_count') int? partnershipCount, @JsonKey(name: 'approvals_by_status') ApprovalsByStatus? approvalsByStatus, @JsonKey(name: 'approvals_by_submission') ApprovalsBySubmission? approvalsBySubmission, @JsonKey(name: 'last_updated') int? lastUpdated)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _TenderApprovalsStateData() when $default != null:
|
||||
return $default(_that.companyId,_that.totalApprovals,_that.approvedTenders,_that.rejectedTenders,_that.selfApplyCount,_that.partnershipCount,_that.approvalsByStatus,_that.approvalsBySubmission,_that.lastUpdated);case _:
|
||||
return $default(_that.companyId,_that.totalApprovals,_that.submittedTenders,_that.rejectedTenders,_that.selfApplyCount,_that.partnershipCount,_that.approvalsByStatus,_that.approvalsBySubmission,_that.lastUpdated);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
@@ -241,12 +241,12 @@ return $default(_that.companyId,_that.totalApprovals,_that.approvedTenders,_that
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class _TenderApprovalsStateData implements TenderApprovalsStateData {
|
||||
const _TenderApprovalsStateData({@JsonKey(name: 'company_id') required this.companyId, @JsonKey(name: 'total_approvals') required this.totalApprovals, @JsonKey(name: 'approved_tenders') required this.approvedTenders, @JsonKey(name: 'rejected_tenders') required this.rejectedTenders, @JsonKey(name: 'self_apply_count') required this.selfApplyCount, @JsonKey(name: 'partnership_count') required this.partnershipCount, @JsonKey(name: 'approvals_by_status') required this.approvalsByStatus, @JsonKey(name: 'approvals_by_submission') required this.approvalsBySubmission, @JsonKey(name: 'last_updated') required this.lastUpdated});
|
||||
const _TenderApprovalsStateData({@JsonKey(name: 'company_id') required this.companyId, @JsonKey(name: 'total_approvals') required this.totalApprovals, @JsonKey(name: 'submitted_tenders') required this.submittedTenders, @JsonKey(name: 'rejected_tenders') required this.rejectedTenders, @JsonKey(name: 'self_apply_count') required this.selfApplyCount, @JsonKey(name: 'partnership_count') required this.partnershipCount, @JsonKey(name: 'approvals_by_status') required this.approvalsByStatus, @JsonKey(name: 'approvals_by_submission') required this.approvalsBySubmission, @JsonKey(name: 'last_updated') required this.lastUpdated});
|
||||
factory _TenderApprovalsStateData.fromJson(Map<String, dynamic> json) => _$TenderApprovalsStateDataFromJson(json);
|
||||
|
||||
@override@JsonKey(name: 'company_id') final String? companyId;
|
||||
@override@JsonKey(name: 'total_approvals') final int? totalApprovals;
|
||||
@override@JsonKey(name: 'approved_tenders') final int? approvedTenders;
|
||||
@override@JsonKey(name: 'submitted_tenders') final int? submittedTenders;
|
||||
@override@JsonKey(name: 'rejected_tenders') final int? rejectedTenders;
|
||||
@override@JsonKey(name: 'self_apply_count') final int? selfApplyCount;
|
||||
@override@JsonKey(name: 'partnership_count') final int? partnershipCount;
|
||||
@@ -267,16 +267,16 @@ Map<String, dynamic> toJson() {
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _TenderApprovalsStateData&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.totalApprovals, totalApprovals) || other.totalApprovals == totalApprovals)&&(identical(other.approvedTenders, approvedTenders) || other.approvedTenders == approvedTenders)&&(identical(other.rejectedTenders, rejectedTenders) || other.rejectedTenders == rejectedTenders)&&(identical(other.selfApplyCount, selfApplyCount) || other.selfApplyCount == selfApplyCount)&&(identical(other.partnershipCount, partnershipCount) || other.partnershipCount == partnershipCount)&&(identical(other.approvalsByStatus, approvalsByStatus) || other.approvalsByStatus == approvalsByStatus)&&(identical(other.approvalsBySubmission, approvalsBySubmission) || other.approvalsBySubmission == approvalsBySubmission)&&(identical(other.lastUpdated, lastUpdated) || other.lastUpdated == lastUpdated));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _TenderApprovalsStateData&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.totalApprovals, totalApprovals) || other.totalApprovals == totalApprovals)&&(identical(other.submittedTenders, submittedTenders) || other.submittedTenders == submittedTenders)&&(identical(other.rejectedTenders, rejectedTenders) || other.rejectedTenders == rejectedTenders)&&(identical(other.selfApplyCount, selfApplyCount) || other.selfApplyCount == selfApplyCount)&&(identical(other.partnershipCount, partnershipCount) || other.partnershipCount == partnershipCount)&&(identical(other.approvalsByStatus, approvalsByStatus) || other.approvalsByStatus == approvalsByStatus)&&(identical(other.approvalsBySubmission, approvalsBySubmission) || other.approvalsBySubmission == approvalsBySubmission)&&(identical(other.lastUpdated, lastUpdated) || other.lastUpdated == lastUpdated));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,companyId,totalApprovals,approvedTenders,rejectedTenders,selfApplyCount,partnershipCount,approvalsByStatus,approvalsBySubmission,lastUpdated);
|
||||
int get hashCode => Object.hash(runtimeType,companyId,totalApprovals,submittedTenders,rejectedTenders,selfApplyCount,partnershipCount,approvalsByStatus,approvalsBySubmission,lastUpdated);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'TenderApprovalsStateData(companyId: $companyId, totalApprovals: $totalApprovals, approvedTenders: $approvedTenders, rejectedTenders: $rejectedTenders, selfApplyCount: $selfApplyCount, partnershipCount: $partnershipCount, approvalsByStatus: $approvalsByStatus, approvalsBySubmission: $approvalsBySubmission, lastUpdated: $lastUpdated)';
|
||||
return 'TenderApprovalsStateData(companyId: $companyId, totalApprovals: $totalApprovals, submittedTenders: $submittedTenders, rejectedTenders: $rejectedTenders, selfApplyCount: $selfApplyCount, partnershipCount: $partnershipCount, approvalsByStatus: $approvalsByStatus, approvalsBySubmission: $approvalsBySubmission, lastUpdated: $lastUpdated)';
|
||||
}
|
||||
|
||||
|
||||
@@ -287,7 +287,7 @@ abstract mixin class _$TenderApprovalsStateDataCopyWith<$Res> implements $Tender
|
||||
factory _$TenderApprovalsStateDataCopyWith(_TenderApprovalsStateData value, $Res Function(_TenderApprovalsStateData) _then) = __$TenderApprovalsStateDataCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
@JsonKey(name: 'company_id') String? companyId,@JsonKey(name: 'total_approvals') int? totalApprovals,@JsonKey(name: 'approved_tenders') int? approvedTenders,@JsonKey(name: 'rejected_tenders') int? rejectedTenders,@JsonKey(name: 'self_apply_count') int? selfApplyCount,@JsonKey(name: 'partnership_count') int? partnershipCount,@JsonKey(name: 'approvals_by_status') ApprovalsByStatus? approvalsByStatus,@JsonKey(name: 'approvals_by_submission') ApprovalsBySubmission? approvalsBySubmission,@JsonKey(name: 'last_updated') int? lastUpdated
|
||||
@JsonKey(name: 'company_id') String? companyId,@JsonKey(name: 'total_approvals') int? totalApprovals,@JsonKey(name: 'submitted_tenders') int? submittedTenders,@JsonKey(name: 'rejected_tenders') int? rejectedTenders,@JsonKey(name: 'self_apply_count') int? selfApplyCount,@JsonKey(name: 'partnership_count') int? partnershipCount,@JsonKey(name: 'approvals_by_status') ApprovalsByStatus? approvalsByStatus,@JsonKey(name: 'approvals_by_submission') ApprovalsBySubmission? approvalsBySubmission,@JsonKey(name: 'last_updated') int? lastUpdated
|
||||
});
|
||||
|
||||
|
||||
@@ -304,11 +304,11 @@ class __$TenderApprovalsStateDataCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of TenderApprovalsStateData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? companyId = freezed,Object? totalApprovals = freezed,Object? approvedTenders = freezed,Object? rejectedTenders = freezed,Object? selfApplyCount = freezed,Object? partnershipCount = freezed,Object? approvalsByStatus = freezed,Object? approvalsBySubmission = freezed,Object? lastUpdated = freezed,}) {
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? companyId = freezed,Object? totalApprovals = freezed,Object? submittedTenders = freezed,Object? rejectedTenders = freezed,Object? selfApplyCount = freezed,Object? partnershipCount = freezed,Object? approvalsByStatus = freezed,Object? approvalsBySubmission = freezed,Object? lastUpdated = freezed,}) {
|
||||
return _then(_TenderApprovalsStateData(
|
||||
companyId: freezed == companyId ? _self.companyId : companyId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,totalApprovals: freezed == totalApprovals ? _self.totalApprovals : totalApprovals // ignore: cast_nullable_to_non_nullable
|
||||
as int?,approvedTenders: freezed == approvedTenders ? _self.approvedTenders : approvedTenders // ignore: cast_nullable_to_non_nullable
|
||||
as int?,submittedTenders: freezed == submittedTenders ? _self.submittedTenders : submittedTenders // ignore: cast_nullable_to_non_nullable
|
||||
as int?,rejectedTenders: freezed == rejectedTenders ? _self.rejectedTenders : rejectedTenders // ignore: cast_nullable_to_non_nullable
|
||||
as int?,selfApplyCount: freezed == selfApplyCount ? _self.selfApplyCount : selfApplyCount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,partnershipCount: freezed == partnershipCount ? _self.partnershipCount : partnershipCount // ignore: cast_nullable_to_non_nullable
|
||||
@@ -350,7 +350,7 @@ $ApprovalsBySubmissionCopyWith<$Res>? get approvalsBySubmission {
|
||||
/// @nodoc
|
||||
mixin _$ApprovalsByStatus {
|
||||
|
||||
@JsonKey(name: 'approved') int? get approved;@JsonKey(name: 'rejected') int? get rejected;
|
||||
@JsonKey(name: 'submitted') int? get submitted;@JsonKey(name: 'rejected') int? get rejected;
|
||||
/// Create a copy of ApprovalsByStatus
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -363,16 +363,16 @@ $ApprovalsByStatusCopyWith<ApprovalsByStatus> get copyWith => _$ApprovalsByStatu
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is ApprovalsByStatus&&(identical(other.approved, approved) || other.approved == approved)&&(identical(other.rejected, rejected) || other.rejected == rejected));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is ApprovalsByStatus&&(identical(other.submitted, submitted) || other.submitted == submitted)&&(identical(other.rejected, rejected) || other.rejected == rejected));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,approved,rejected);
|
||||
int get hashCode => Object.hash(runtimeType,submitted,rejected);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ApprovalsByStatus(approved: $approved, rejected: $rejected)';
|
||||
return 'ApprovalsByStatus(submitted: $submitted, rejected: $rejected)';
|
||||
}
|
||||
|
||||
|
||||
@@ -383,7 +383,7 @@ abstract mixin class $ApprovalsByStatusCopyWith<$Res> {
|
||||
factory $ApprovalsByStatusCopyWith(ApprovalsByStatus value, $Res Function(ApprovalsByStatus) _then) = _$ApprovalsByStatusCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
@JsonKey(name: 'approved') int? approved,@JsonKey(name: 'rejected') int? rejected
|
||||
@JsonKey(name: 'submitted') int? submitted,@JsonKey(name: 'rejected') int? rejected
|
||||
});
|
||||
|
||||
|
||||
@@ -400,9 +400,9 @@ class _$ApprovalsByStatusCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of ApprovalsByStatus
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? approved = freezed,Object? rejected = freezed,}) {
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? submitted = freezed,Object? rejected = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
approved: freezed == approved ? _self.approved : approved // ignore: cast_nullable_to_non_nullable
|
||||
submitted: freezed == submitted ? _self.submitted : submitted // ignore: cast_nullable_to_non_nullable
|
||||
as int?,rejected: freezed == rejected ? _self.rejected : rejected // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
@@ -489,10 +489,10 @@ return $default(_that);case _:
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function(@JsonKey(name: 'approved') int? approved, @JsonKey(name: 'rejected') int? rejected)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function(@JsonKey(name: 'submitted') int? submitted, @JsonKey(name: 'rejected') int? rejected)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ApprovalsByStatus() when $default != null:
|
||||
return $default(_that.approved,_that.rejected);case _:
|
||||
return $default(_that.submitted,_that.rejected);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
@@ -510,10 +510,10 @@ return $default(_that.approved,_that.rejected);case _:
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function(@JsonKey(name: 'approved') int? approved, @JsonKey(name: 'rejected') int? rejected) $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function(@JsonKey(name: 'submitted') int? submitted, @JsonKey(name: 'rejected') int? rejected) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ApprovalsByStatus():
|
||||
return $default(_that.approved,_that.rejected);case _:
|
||||
return $default(_that.submitted,_that.rejected);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
@@ -530,10 +530,10 @@ return $default(_that.approved,_that.rejected);case _:
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function(@JsonKey(name: 'approved') int? approved, @JsonKey(name: 'rejected') int? rejected)? $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function(@JsonKey(name: 'submitted') int? submitted, @JsonKey(name: 'rejected') int? rejected)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ApprovalsByStatus() when $default != null:
|
||||
return $default(_that.approved,_that.rejected);case _:
|
||||
return $default(_that.submitted,_that.rejected);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
@@ -545,10 +545,10 @@ return $default(_that.approved,_that.rejected);case _:
|
||||
@JsonSerializable()
|
||||
|
||||
class _ApprovalsByStatus implements ApprovalsByStatus {
|
||||
const _ApprovalsByStatus({@JsonKey(name: 'approved') required this.approved, @JsonKey(name: 'rejected') required this.rejected});
|
||||
const _ApprovalsByStatus({@JsonKey(name: 'submitted') required this.submitted, @JsonKey(name: 'rejected') required this.rejected});
|
||||
factory _ApprovalsByStatus.fromJson(Map<String, dynamic> json) => _$ApprovalsByStatusFromJson(json);
|
||||
|
||||
@override@JsonKey(name: 'approved') final int? approved;
|
||||
@override@JsonKey(name: 'submitted') final int? submitted;
|
||||
@override@JsonKey(name: 'rejected') final int? rejected;
|
||||
|
||||
/// Create a copy of ApprovalsByStatus
|
||||
@@ -564,16 +564,16 @@ Map<String, dynamic> toJson() {
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ApprovalsByStatus&&(identical(other.approved, approved) || other.approved == approved)&&(identical(other.rejected, rejected) || other.rejected == rejected));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ApprovalsByStatus&&(identical(other.submitted, submitted) || other.submitted == submitted)&&(identical(other.rejected, rejected) || other.rejected == rejected));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,approved,rejected);
|
||||
int get hashCode => Object.hash(runtimeType,submitted,rejected);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ApprovalsByStatus(approved: $approved, rejected: $rejected)';
|
||||
return 'ApprovalsByStatus(submitted: $submitted, rejected: $rejected)';
|
||||
}
|
||||
|
||||
|
||||
@@ -584,7 +584,7 @@ abstract mixin class _$ApprovalsByStatusCopyWith<$Res> implements $ApprovalsBySt
|
||||
factory _$ApprovalsByStatusCopyWith(_ApprovalsByStatus value, $Res Function(_ApprovalsByStatus) _then) = __$ApprovalsByStatusCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
@JsonKey(name: 'approved') int? approved,@JsonKey(name: 'rejected') int? rejected
|
||||
@JsonKey(name: 'submitted') int? submitted,@JsonKey(name: 'rejected') int? rejected
|
||||
});
|
||||
|
||||
|
||||
@@ -601,9 +601,9 @@ class __$ApprovalsByStatusCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of ApprovalsByStatus
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? approved = freezed,Object? rejected = freezed,}) {
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? submitted = freezed,Object? rejected = freezed,}) {
|
||||
return _then(_ApprovalsByStatus(
|
||||
approved: freezed == approved ? _self.approved : approved // ignore: cast_nullable_to_non_nullable
|
||||
submitted: freezed == submitted ? _self.submitted : submitted // ignore: cast_nullable_to_non_nullable
|
||||
as int?,rejected: freezed == rejected ? _self.rejected : rejected // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
|
||||
+4
-4
@@ -11,7 +11,7 @@ _TenderApprovalsStateData _$TenderApprovalsStateDataFromJson(
|
||||
) => _TenderApprovalsStateData(
|
||||
companyId: json['company_id'] as String?,
|
||||
totalApprovals: (json['total_approvals'] as num?)?.toInt(),
|
||||
approvedTenders: (json['approved_tenders'] as num?)?.toInt(),
|
||||
submittedTenders: (json['submitted_tenders'] as num?)?.toInt(),
|
||||
rejectedTenders: (json['rejected_tenders'] as num?)?.toInt(),
|
||||
selfApplyCount: (json['self_apply_count'] as num?)?.toInt(),
|
||||
partnershipCount: (json['partnership_count'] as num?)?.toInt(),
|
||||
@@ -35,7 +35,7 @@ Map<String, dynamic> _$TenderApprovalsStateDataToJson(
|
||||
) => <String, dynamic>{
|
||||
'company_id': instance.companyId,
|
||||
'total_approvals': instance.totalApprovals,
|
||||
'approved_tenders': instance.approvedTenders,
|
||||
'submitted_tenders': instance.submittedTenders,
|
||||
'rejected_tenders': instance.rejectedTenders,
|
||||
'self_apply_count': instance.selfApplyCount,
|
||||
'partnership_count': instance.partnershipCount,
|
||||
@@ -46,13 +46,13 @@ Map<String, dynamic> _$TenderApprovalsStateDataToJson(
|
||||
|
||||
_ApprovalsByStatus _$ApprovalsByStatusFromJson(Map<String, dynamic> json) =>
|
||||
_ApprovalsByStatus(
|
||||
approved: (json['approved'] as num?)?.toInt(),
|
||||
submitted: (json['submitted'] as num?)?.toInt(),
|
||||
rejected: (json['rejected'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ApprovalsByStatusToJson(_ApprovalsByStatus instance) =>
|
||||
<String, dynamic>{
|
||||
'approved': instance.approved,
|
||||
'submitted': instance.submitted,
|
||||
'rejected': instance.rejected,
|
||||
};
|
||||
|
||||
|
||||
@@ -9,26 +9,32 @@ part 'tender_data.g.dart';
|
||||
@freezed
|
||||
abstract class TenderData with _$TenderData {
|
||||
const factory TenderData({
|
||||
|
||||
required bool? success,
|
||||
required String? message,
|
||||
required String? id,
|
||||
@JsonKey(name: 'notice_publication_id') required String? noticePublicationId,
|
||||
@JsonKey(name: 'publication_date') required int? publicationDate,
|
||||
@JsonKey(name: 'tender_id') required String? tenderId,
|
||||
@JsonKey(name: 'notice_publication_id')
|
||||
required String? noticePublicationId,
|
||||
@JsonKey(name: 'publication_date') required int? publicationDate,
|
||||
required String? title,
|
||||
required String? description,
|
||||
@JsonKey(name: 'procurement_type_code') required String? procurementTypeCode,
|
||||
@JsonKey(name: 'procedure_code') required String? procedureCode,
|
||||
@JsonKey(name: 'estimated_value') required int? estimatedValue,
|
||||
@JsonKey(name: 'procurement_type_code')
|
||||
required String? procurementTypeCode,
|
||||
@JsonKey(name: 'procedure_code') required String? procedureCode,
|
||||
@JsonKey(name: 'estimated_value') required int? estimatedValue,
|
||||
required String? currency,
|
||||
required String? duration,
|
||||
required String? durationUnit,
|
||||
@JsonKey(name: 'tender_deadline') required int? tenderDeadline,
|
||||
@JsonKey(name: 'country_code') required String? countryCode,
|
||||
@JsonKey(name: 'buyer_organization') required Organization? buyerOrganization,
|
||||
@JsonKey(name: 'tender_deadline') required int? tenderDeadline,
|
||||
@JsonKey(name: 'submission_deadline') required int? submissionDeadline,
|
||||
@JsonKey(name: 'application_deadline') required int? applicationDeadline,
|
||||
@JsonKey(name: 'submission_url') required String? submissionUrl,
|
||||
@JsonKey(name: 'country_code') required String? countryCode,
|
||||
@JsonKey(name: 'buyer_organization')
|
||||
required Organization? buyerOrganization,
|
||||
required String? status,
|
||||
}) = _TenderData;
|
||||
|
||||
factory TenderData.fromJson(Map<String, Object?> json) =>
|
||||
_$TenderDataFromJson(json);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$TenderData {
|
||||
|
||||
bool? get success; String? get message; String? get id;@JsonKey(name: 'notice_publication_id') String? get noticePublicationId;@JsonKey(name: 'publication_date') int? get publicationDate; String? get title; String? get description;@JsonKey(name: 'procurement_type_code') String? get procurementTypeCode;@JsonKey(name: 'procedure_code') String? get procedureCode;@JsonKey(name: 'estimated_value') int? get estimatedValue; String? get currency; String? get duration; String? get durationUnit;@JsonKey(name: 'tender_deadline') int? get tenderDeadline;@JsonKey(name: 'country_code') String? get countryCode;@JsonKey(name: 'buyer_organization') Organization? get buyerOrganization; String? get status;
|
||||
bool? get success; String? get message; String? get id;@JsonKey(name: 'tender_id') String? get tenderId;@JsonKey(name: 'notice_publication_id') String? get noticePublicationId;@JsonKey(name: 'publication_date') int? get publicationDate; String? get title; String? get description;@JsonKey(name: 'procurement_type_code') String? get procurementTypeCode;@JsonKey(name: 'procedure_code') String? get procedureCode;@JsonKey(name: 'estimated_value') int? get estimatedValue; String? get currency; String? get duration; String? get durationUnit;@JsonKey(name: 'tender_deadline') int? get tenderDeadline;@JsonKey(name: 'submission_deadline') int? get submissionDeadline;@JsonKey(name: 'application_deadline') int? get applicationDeadline;@JsonKey(name: 'submission_url') String? get submissionUrl;@JsonKey(name: 'country_code') String? get countryCode;@JsonKey(name: 'buyer_organization') Organization? get buyerOrganization; String? get status;
|
||||
/// Create a copy of TenderData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -28,16 +28,16 @@ $TenderDataCopyWith<TenderData> get copyWith => _$TenderDataCopyWithImpl<TenderD
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is TenderData&&(identical(other.success, success) || other.success == success)&&(identical(other.message, message) || other.message == message)&&(identical(other.id, id) || other.id == id)&&(identical(other.noticePublicationId, noticePublicationId) || other.noticePublicationId == noticePublicationId)&&(identical(other.publicationDate, publicationDate) || other.publicationDate == publicationDate)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.procurementTypeCode, procurementTypeCode) || other.procurementTypeCode == procurementTypeCode)&&(identical(other.procedureCode, procedureCode) || other.procedureCode == procedureCode)&&(identical(other.estimatedValue, estimatedValue) || other.estimatedValue == estimatedValue)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.duration, duration) || other.duration == duration)&&(identical(other.durationUnit, durationUnit) || other.durationUnit == durationUnit)&&(identical(other.tenderDeadline, tenderDeadline) || other.tenderDeadline == tenderDeadline)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&(identical(other.buyerOrganization, buyerOrganization) || other.buyerOrganization == buyerOrganization)&&(identical(other.status, status) || other.status == status));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is TenderData&&(identical(other.success, success) || other.success == success)&&(identical(other.message, message) || other.message == message)&&(identical(other.id, id) || other.id == id)&&(identical(other.tenderId, tenderId) || other.tenderId == tenderId)&&(identical(other.noticePublicationId, noticePublicationId) || other.noticePublicationId == noticePublicationId)&&(identical(other.publicationDate, publicationDate) || other.publicationDate == publicationDate)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.procurementTypeCode, procurementTypeCode) || other.procurementTypeCode == procurementTypeCode)&&(identical(other.procedureCode, procedureCode) || other.procedureCode == procedureCode)&&(identical(other.estimatedValue, estimatedValue) || other.estimatedValue == estimatedValue)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.duration, duration) || other.duration == duration)&&(identical(other.durationUnit, durationUnit) || other.durationUnit == durationUnit)&&(identical(other.tenderDeadline, tenderDeadline) || other.tenderDeadline == tenderDeadline)&&(identical(other.submissionDeadline, submissionDeadline) || other.submissionDeadline == submissionDeadline)&&(identical(other.applicationDeadline, applicationDeadline) || other.applicationDeadline == applicationDeadline)&&(identical(other.submissionUrl, submissionUrl) || other.submissionUrl == submissionUrl)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&(identical(other.buyerOrganization, buyerOrganization) || other.buyerOrganization == buyerOrganization)&&(identical(other.status, status) || other.status == status));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,success,message,id,noticePublicationId,publicationDate,title,description,procurementTypeCode,procedureCode,estimatedValue,currency,duration,durationUnit,tenderDeadline,countryCode,buyerOrganization,status);
|
||||
int get hashCode => Object.hashAll([runtimeType,success,message,id,tenderId,noticePublicationId,publicationDate,title,description,procurementTypeCode,procedureCode,estimatedValue,currency,duration,durationUnit,tenderDeadline,submissionDeadline,applicationDeadline,submissionUrl,countryCode,buyerOrganization,status]);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'TenderData(success: $success, message: $message, id: $id, noticePublicationId: $noticePublicationId, publicationDate: $publicationDate, title: $title, description: $description, procurementTypeCode: $procurementTypeCode, procedureCode: $procedureCode, estimatedValue: $estimatedValue, currency: $currency, duration: $duration, durationUnit: $durationUnit, tenderDeadline: $tenderDeadline, countryCode: $countryCode, buyerOrganization: $buyerOrganization, status: $status)';
|
||||
return 'TenderData(success: $success, message: $message, id: $id, tenderId: $tenderId, noticePublicationId: $noticePublicationId, publicationDate: $publicationDate, title: $title, description: $description, procurementTypeCode: $procurementTypeCode, procedureCode: $procedureCode, estimatedValue: $estimatedValue, currency: $currency, duration: $duration, durationUnit: $durationUnit, tenderDeadline: $tenderDeadline, submissionDeadline: $submissionDeadline, applicationDeadline: $applicationDeadline, submissionUrl: $submissionUrl, countryCode: $countryCode, buyerOrganization: $buyerOrganization, status: $status)';
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ abstract mixin class $TenderDataCopyWith<$Res> {
|
||||
factory $TenderDataCopyWith(TenderData value, $Res Function(TenderData) _then) = _$TenderDataCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
bool? success, String? message, String? id,@JsonKey(name: 'notice_publication_id') String? noticePublicationId,@JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description,@JsonKey(name: 'procurement_type_code') String? procurementTypeCode,@JsonKey(name: 'procedure_code') String? procedureCode,@JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit,@JsonKey(name: 'tender_deadline') int? tenderDeadline,@JsonKey(name: 'country_code') String? countryCode,@JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status
|
||||
bool? success, String? message, String? id,@JsonKey(name: 'tender_id') String? tenderId,@JsonKey(name: 'notice_publication_id') String? noticePublicationId,@JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description,@JsonKey(name: 'procurement_type_code') String? procurementTypeCode,@JsonKey(name: 'procedure_code') String? procedureCode,@JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit,@JsonKey(name: 'tender_deadline') int? tenderDeadline,@JsonKey(name: 'submission_deadline') int? submissionDeadline,@JsonKey(name: 'application_deadline') int? applicationDeadline,@JsonKey(name: 'submission_url') String? submissionUrl,@JsonKey(name: 'country_code') String? countryCode,@JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status
|
||||
});
|
||||
|
||||
|
||||
@@ -65,11 +65,12 @@ class _$TenderDataCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of TenderData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? success = freezed,Object? message = freezed,Object? id = freezed,Object? noticePublicationId = freezed,Object? publicationDate = freezed,Object? title = freezed,Object? description = freezed,Object? procurementTypeCode = freezed,Object? procedureCode = freezed,Object? estimatedValue = freezed,Object? currency = freezed,Object? duration = freezed,Object? durationUnit = freezed,Object? tenderDeadline = freezed,Object? countryCode = freezed,Object? buyerOrganization = freezed,Object? status = freezed,}) {
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? success = freezed,Object? message = freezed,Object? id = freezed,Object? tenderId = freezed,Object? noticePublicationId = freezed,Object? publicationDate = freezed,Object? title = freezed,Object? description = freezed,Object? procurementTypeCode = freezed,Object? procedureCode = freezed,Object? estimatedValue = freezed,Object? currency = freezed,Object? duration = freezed,Object? durationUnit = freezed,Object? tenderDeadline = freezed,Object? submissionDeadline = freezed,Object? applicationDeadline = freezed,Object? submissionUrl = freezed,Object? countryCode = freezed,Object? buyerOrganization = freezed,Object? status = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
|
||||
as String?,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||
as String?,tenderId: freezed == tenderId ? _self.tenderId : tenderId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,noticePublicationId: freezed == noticePublicationId ? _self.noticePublicationId : noticePublicationId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,publicationDate: freezed == publicationDate ? _self.publicationDate : publicationDate // ignore: cast_nullable_to_non_nullable
|
||||
as int?,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
|
||||
@@ -81,7 +82,10 @@ as int?,currency: freezed == currency ? _self.currency : currency // ignore: cas
|
||||
as String?,duration: freezed == duration ? _self.duration : duration // ignore: cast_nullable_to_non_nullable
|
||||
as String?,durationUnit: freezed == durationUnit ? _self.durationUnit : durationUnit // ignore: cast_nullable_to_non_nullable
|
||||
as String?,tenderDeadline: freezed == tenderDeadline ? _self.tenderDeadline : tenderDeadline // ignore: cast_nullable_to_non_nullable
|
||||
as int?,countryCode: freezed == countryCode ? _self.countryCode : countryCode // ignore: cast_nullable_to_non_nullable
|
||||
as int?,submissionDeadline: freezed == submissionDeadline ? _self.submissionDeadline : submissionDeadline // ignore: cast_nullable_to_non_nullable
|
||||
as int?,applicationDeadline: freezed == applicationDeadline ? _self.applicationDeadline : applicationDeadline // ignore: cast_nullable_to_non_nullable
|
||||
as int?,submissionUrl: freezed == submissionUrl ? _self.submissionUrl : submissionUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String?,countryCode: freezed == countryCode ? _self.countryCode : countryCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,buyerOrganization: freezed == buyerOrganization ? _self.buyerOrganization : buyerOrganization // ignore: cast_nullable_to_non_nullable
|
||||
as Organization?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
@@ -181,10 +185,10 @@ return $default(_that);case _:
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool? success, String? message, String? id, @JsonKey(name: 'notice_publication_id') String? noticePublicationId, @JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description, @JsonKey(name: 'procurement_type_code') String? procurementTypeCode, @JsonKey(name: 'procedure_code') String? procedureCode, @JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit, @JsonKey(name: 'tender_deadline') int? tenderDeadline, @JsonKey(name: 'country_code') String? countryCode, @JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool? success, String? message, String? id, @JsonKey(name: 'tender_id') String? tenderId, @JsonKey(name: 'notice_publication_id') String? noticePublicationId, @JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description, @JsonKey(name: 'procurement_type_code') String? procurementTypeCode, @JsonKey(name: 'procedure_code') String? procedureCode, @JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit, @JsonKey(name: 'tender_deadline') int? tenderDeadline, @JsonKey(name: 'submission_deadline') int? submissionDeadline, @JsonKey(name: 'application_deadline') int? applicationDeadline, @JsonKey(name: 'submission_url') String? submissionUrl, @JsonKey(name: 'country_code') String? countryCode, @JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _TenderData() when $default != null:
|
||||
return $default(_that.success,_that.message,_that.id,_that.noticePublicationId,_that.publicationDate,_that.title,_that.description,_that.procurementTypeCode,_that.procedureCode,_that.estimatedValue,_that.currency,_that.duration,_that.durationUnit,_that.tenderDeadline,_that.countryCode,_that.buyerOrganization,_that.status);case _:
|
||||
return $default(_that.success,_that.message,_that.id,_that.tenderId,_that.noticePublicationId,_that.publicationDate,_that.title,_that.description,_that.procurementTypeCode,_that.procedureCode,_that.estimatedValue,_that.currency,_that.duration,_that.durationUnit,_that.tenderDeadline,_that.submissionDeadline,_that.applicationDeadline,_that.submissionUrl,_that.countryCode,_that.buyerOrganization,_that.status);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
@@ -202,10 +206,10 @@ return $default(_that.success,_that.message,_that.id,_that.noticePublicationId,_
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool? success, String? message, String? id, @JsonKey(name: 'notice_publication_id') String? noticePublicationId, @JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description, @JsonKey(name: 'procurement_type_code') String? procurementTypeCode, @JsonKey(name: 'procedure_code') String? procedureCode, @JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit, @JsonKey(name: 'tender_deadline') int? tenderDeadline, @JsonKey(name: 'country_code') String? countryCode, @JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status) $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool? success, String? message, String? id, @JsonKey(name: 'tender_id') String? tenderId, @JsonKey(name: 'notice_publication_id') String? noticePublicationId, @JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description, @JsonKey(name: 'procurement_type_code') String? procurementTypeCode, @JsonKey(name: 'procedure_code') String? procedureCode, @JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit, @JsonKey(name: 'tender_deadline') int? tenderDeadline, @JsonKey(name: 'submission_deadline') int? submissionDeadline, @JsonKey(name: 'application_deadline') int? applicationDeadline, @JsonKey(name: 'submission_url') String? submissionUrl, @JsonKey(name: 'country_code') String? countryCode, @JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _TenderData():
|
||||
return $default(_that.success,_that.message,_that.id,_that.noticePublicationId,_that.publicationDate,_that.title,_that.description,_that.procurementTypeCode,_that.procedureCode,_that.estimatedValue,_that.currency,_that.duration,_that.durationUnit,_that.tenderDeadline,_that.countryCode,_that.buyerOrganization,_that.status);case _:
|
||||
return $default(_that.success,_that.message,_that.id,_that.tenderId,_that.noticePublicationId,_that.publicationDate,_that.title,_that.description,_that.procurementTypeCode,_that.procedureCode,_that.estimatedValue,_that.currency,_that.duration,_that.durationUnit,_that.tenderDeadline,_that.submissionDeadline,_that.applicationDeadline,_that.submissionUrl,_that.countryCode,_that.buyerOrganization,_that.status);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
@@ -222,10 +226,10 @@ return $default(_that.success,_that.message,_that.id,_that.noticePublicationId,_
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool? success, String? message, String? id, @JsonKey(name: 'notice_publication_id') String? noticePublicationId, @JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description, @JsonKey(name: 'procurement_type_code') String? procurementTypeCode, @JsonKey(name: 'procedure_code') String? procedureCode, @JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit, @JsonKey(name: 'tender_deadline') int? tenderDeadline, @JsonKey(name: 'country_code') String? countryCode, @JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status)? $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool? success, String? message, String? id, @JsonKey(name: 'tender_id') String? tenderId, @JsonKey(name: 'notice_publication_id') String? noticePublicationId, @JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description, @JsonKey(name: 'procurement_type_code') String? procurementTypeCode, @JsonKey(name: 'procedure_code') String? procedureCode, @JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit, @JsonKey(name: 'tender_deadline') int? tenderDeadline, @JsonKey(name: 'submission_deadline') int? submissionDeadline, @JsonKey(name: 'application_deadline') int? applicationDeadline, @JsonKey(name: 'submission_url') String? submissionUrl, @JsonKey(name: 'country_code') String? countryCode, @JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _TenderData() when $default != null:
|
||||
return $default(_that.success,_that.message,_that.id,_that.noticePublicationId,_that.publicationDate,_that.title,_that.description,_that.procurementTypeCode,_that.procedureCode,_that.estimatedValue,_that.currency,_that.duration,_that.durationUnit,_that.tenderDeadline,_that.countryCode,_that.buyerOrganization,_that.status);case _:
|
||||
return $default(_that.success,_that.message,_that.id,_that.tenderId,_that.noticePublicationId,_that.publicationDate,_that.title,_that.description,_that.procurementTypeCode,_that.procedureCode,_that.estimatedValue,_that.currency,_that.duration,_that.durationUnit,_that.tenderDeadline,_that.submissionDeadline,_that.applicationDeadline,_that.submissionUrl,_that.countryCode,_that.buyerOrganization,_that.status);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
@@ -237,12 +241,13 @@ return $default(_that.success,_that.message,_that.id,_that.noticePublicationId,_
|
||||
@JsonSerializable()
|
||||
|
||||
class _TenderData implements TenderData {
|
||||
const _TenderData({required this.success, required this.message, required this.id, @JsonKey(name: 'notice_publication_id') required this.noticePublicationId, @JsonKey(name: 'publication_date') required this.publicationDate, required this.title, required this.description, @JsonKey(name: 'procurement_type_code') required this.procurementTypeCode, @JsonKey(name: 'procedure_code') required this.procedureCode, @JsonKey(name: 'estimated_value') required this.estimatedValue, required this.currency, required this.duration, required this.durationUnit, @JsonKey(name: 'tender_deadline') required this.tenderDeadline, @JsonKey(name: 'country_code') required this.countryCode, @JsonKey(name: 'buyer_organization') required this.buyerOrganization, required this.status});
|
||||
const _TenderData({required this.success, required this.message, required this.id, @JsonKey(name: 'tender_id') required this.tenderId, @JsonKey(name: 'notice_publication_id') required this.noticePublicationId, @JsonKey(name: 'publication_date') required this.publicationDate, required this.title, required this.description, @JsonKey(name: 'procurement_type_code') required this.procurementTypeCode, @JsonKey(name: 'procedure_code') required this.procedureCode, @JsonKey(name: 'estimated_value') required this.estimatedValue, required this.currency, required this.duration, required this.durationUnit, @JsonKey(name: 'tender_deadline') required this.tenderDeadline, @JsonKey(name: 'submission_deadline') required this.submissionDeadline, @JsonKey(name: 'application_deadline') required this.applicationDeadline, @JsonKey(name: 'submission_url') required this.submissionUrl, @JsonKey(name: 'country_code') required this.countryCode, @JsonKey(name: 'buyer_organization') required this.buyerOrganization, required this.status});
|
||||
factory _TenderData.fromJson(Map<String, dynamic> json) => _$TenderDataFromJson(json);
|
||||
|
||||
@override final bool? success;
|
||||
@override final String? message;
|
||||
@override final String? id;
|
||||
@override@JsonKey(name: 'tender_id') final String? tenderId;
|
||||
@override@JsonKey(name: 'notice_publication_id') final String? noticePublicationId;
|
||||
@override@JsonKey(name: 'publication_date') final int? publicationDate;
|
||||
@override final String? title;
|
||||
@@ -254,6 +259,9 @@ class _TenderData implements TenderData {
|
||||
@override final String? duration;
|
||||
@override final String? durationUnit;
|
||||
@override@JsonKey(name: 'tender_deadline') final int? tenderDeadline;
|
||||
@override@JsonKey(name: 'submission_deadline') final int? submissionDeadline;
|
||||
@override@JsonKey(name: 'application_deadline') final int? applicationDeadline;
|
||||
@override@JsonKey(name: 'submission_url') final String? submissionUrl;
|
||||
@override@JsonKey(name: 'country_code') final String? countryCode;
|
||||
@override@JsonKey(name: 'buyer_organization') final Organization? buyerOrganization;
|
||||
@override final String? status;
|
||||
@@ -271,16 +279,16 @@ Map<String, dynamic> toJson() {
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _TenderData&&(identical(other.success, success) || other.success == success)&&(identical(other.message, message) || other.message == message)&&(identical(other.id, id) || other.id == id)&&(identical(other.noticePublicationId, noticePublicationId) || other.noticePublicationId == noticePublicationId)&&(identical(other.publicationDate, publicationDate) || other.publicationDate == publicationDate)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.procurementTypeCode, procurementTypeCode) || other.procurementTypeCode == procurementTypeCode)&&(identical(other.procedureCode, procedureCode) || other.procedureCode == procedureCode)&&(identical(other.estimatedValue, estimatedValue) || other.estimatedValue == estimatedValue)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.duration, duration) || other.duration == duration)&&(identical(other.durationUnit, durationUnit) || other.durationUnit == durationUnit)&&(identical(other.tenderDeadline, tenderDeadline) || other.tenderDeadline == tenderDeadline)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&(identical(other.buyerOrganization, buyerOrganization) || other.buyerOrganization == buyerOrganization)&&(identical(other.status, status) || other.status == status));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _TenderData&&(identical(other.success, success) || other.success == success)&&(identical(other.message, message) || other.message == message)&&(identical(other.id, id) || other.id == id)&&(identical(other.tenderId, tenderId) || other.tenderId == tenderId)&&(identical(other.noticePublicationId, noticePublicationId) || other.noticePublicationId == noticePublicationId)&&(identical(other.publicationDate, publicationDate) || other.publicationDate == publicationDate)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.procurementTypeCode, procurementTypeCode) || other.procurementTypeCode == procurementTypeCode)&&(identical(other.procedureCode, procedureCode) || other.procedureCode == procedureCode)&&(identical(other.estimatedValue, estimatedValue) || other.estimatedValue == estimatedValue)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.duration, duration) || other.duration == duration)&&(identical(other.durationUnit, durationUnit) || other.durationUnit == durationUnit)&&(identical(other.tenderDeadline, tenderDeadline) || other.tenderDeadline == tenderDeadline)&&(identical(other.submissionDeadline, submissionDeadline) || other.submissionDeadline == submissionDeadline)&&(identical(other.applicationDeadline, applicationDeadline) || other.applicationDeadline == applicationDeadline)&&(identical(other.submissionUrl, submissionUrl) || other.submissionUrl == submissionUrl)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&(identical(other.buyerOrganization, buyerOrganization) || other.buyerOrganization == buyerOrganization)&&(identical(other.status, status) || other.status == status));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,success,message,id,noticePublicationId,publicationDate,title,description,procurementTypeCode,procedureCode,estimatedValue,currency,duration,durationUnit,tenderDeadline,countryCode,buyerOrganization,status);
|
||||
int get hashCode => Object.hashAll([runtimeType,success,message,id,tenderId,noticePublicationId,publicationDate,title,description,procurementTypeCode,procedureCode,estimatedValue,currency,duration,durationUnit,tenderDeadline,submissionDeadline,applicationDeadline,submissionUrl,countryCode,buyerOrganization,status]);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'TenderData(success: $success, message: $message, id: $id, noticePublicationId: $noticePublicationId, publicationDate: $publicationDate, title: $title, description: $description, procurementTypeCode: $procurementTypeCode, procedureCode: $procedureCode, estimatedValue: $estimatedValue, currency: $currency, duration: $duration, durationUnit: $durationUnit, tenderDeadline: $tenderDeadline, countryCode: $countryCode, buyerOrganization: $buyerOrganization, status: $status)';
|
||||
return 'TenderData(success: $success, message: $message, id: $id, tenderId: $tenderId, noticePublicationId: $noticePublicationId, publicationDate: $publicationDate, title: $title, description: $description, procurementTypeCode: $procurementTypeCode, procedureCode: $procedureCode, estimatedValue: $estimatedValue, currency: $currency, duration: $duration, durationUnit: $durationUnit, tenderDeadline: $tenderDeadline, submissionDeadline: $submissionDeadline, applicationDeadline: $applicationDeadline, submissionUrl: $submissionUrl, countryCode: $countryCode, buyerOrganization: $buyerOrganization, status: $status)';
|
||||
}
|
||||
|
||||
|
||||
@@ -291,7 +299,7 @@ abstract mixin class _$TenderDataCopyWith<$Res> implements $TenderDataCopyWith<$
|
||||
factory _$TenderDataCopyWith(_TenderData value, $Res Function(_TenderData) _then) = __$TenderDataCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
bool? success, String? message, String? id,@JsonKey(name: 'notice_publication_id') String? noticePublicationId,@JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description,@JsonKey(name: 'procurement_type_code') String? procurementTypeCode,@JsonKey(name: 'procedure_code') String? procedureCode,@JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit,@JsonKey(name: 'tender_deadline') int? tenderDeadline,@JsonKey(name: 'country_code') String? countryCode,@JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status
|
||||
bool? success, String? message, String? id,@JsonKey(name: 'tender_id') String? tenderId,@JsonKey(name: 'notice_publication_id') String? noticePublicationId,@JsonKey(name: 'publication_date') int? publicationDate, String? title, String? description,@JsonKey(name: 'procurement_type_code') String? procurementTypeCode,@JsonKey(name: 'procedure_code') String? procedureCode,@JsonKey(name: 'estimated_value') int? estimatedValue, String? currency, String? duration, String? durationUnit,@JsonKey(name: 'tender_deadline') int? tenderDeadline,@JsonKey(name: 'submission_deadline') int? submissionDeadline,@JsonKey(name: 'application_deadline') int? applicationDeadline,@JsonKey(name: 'submission_url') String? submissionUrl,@JsonKey(name: 'country_code') String? countryCode,@JsonKey(name: 'buyer_organization') Organization? buyerOrganization, String? status
|
||||
});
|
||||
|
||||
|
||||
@@ -308,11 +316,12 @@ class __$TenderDataCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of TenderData
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? success = freezed,Object? message = freezed,Object? id = freezed,Object? noticePublicationId = freezed,Object? publicationDate = freezed,Object? title = freezed,Object? description = freezed,Object? procurementTypeCode = freezed,Object? procedureCode = freezed,Object? estimatedValue = freezed,Object? currency = freezed,Object? duration = freezed,Object? durationUnit = freezed,Object? tenderDeadline = freezed,Object? countryCode = freezed,Object? buyerOrganization = freezed,Object? status = freezed,}) {
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? success = freezed,Object? message = freezed,Object? id = freezed,Object? tenderId = freezed,Object? noticePublicationId = freezed,Object? publicationDate = freezed,Object? title = freezed,Object? description = freezed,Object? procurementTypeCode = freezed,Object? procedureCode = freezed,Object? estimatedValue = freezed,Object? currency = freezed,Object? duration = freezed,Object? durationUnit = freezed,Object? tenderDeadline = freezed,Object? submissionDeadline = freezed,Object? applicationDeadline = freezed,Object? submissionUrl = freezed,Object? countryCode = freezed,Object? buyerOrganization = freezed,Object? status = freezed,}) {
|
||||
return _then(_TenderData(
|
||||
success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
|
||||
as String?,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||
as String?,tenderId: freezed == tenderId ? _self.tenderId : tenderId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,noticePublicationId: freezed == noticePublicationId ? _self.noticePublicationId : noticePublicationId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,publicationDate: freezed == publicationDate ? _self.publicationDate : publicationDate // ignore: cast_nullable_to_non_nullable
|
||||
as int?,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
|
||||
@@ -324,7 +333,10 @@ as int?,currency: freezed == currency ? _self.currency : currency // ignore: cas
|
||||
as String?,duration: freezed == duration ? _self.duration : duration // ignore: cast_nullable_to_non_nullable
|
||||
as String?,durationUnit: freezed == durationUnit ? _self.durationUnit : durationUnit // ignore: cast_nullable_to_non_nullable
|
||||
as String?,tenderDeadline: freezed == tenderDeadline ? _self.tenderDeadline : tenderDeadline // ignore: cast_nullable_to_non_nullable
|
||||
as int?,countryCode: freezed == countryCode ? _self.countryCode : countryCode // ignore: cast_nullable_to_non_nullable
|
||||
as int?,submissionDeadline: freezed == submissionDeadline ? _self.submissionDeadline : submissionDeadline // ignore: cast_nullable_to_non_nullable
|
||||
as int?,applicationDeadline: freezed == applicationDeadline ? _self.applicationDeadline : applicationDeadline // ignore: cast_nullable_to_non_nullable
|
||||
as int?,submissionUrl: freezed == submissionUrl ? _self.submissionUrl : submissionUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String?,countryCode: freezed == countryCode ? _self.countryCode : countryCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,buyerOrganization: freezed == buyerOrganization ? _self.buyerOrganization : buyerOrganization // ignore: cast_nullable_to_non_nullable
|
||||
as Organization?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
|
||||
@@ -10,6 +10,7 @@ _TenderData _$TenderDataFromJson(Map<String, dynamic> json) => _TenderData(
|
||||
success: json['success'] as bool?,
|
||||
message: json['message'] as String?,
|
||||
id: json['id'] as String?,
|
||||
tenderId: json['tender_id'] as String?,
|
||||
noticePublicationId: json['notice_publication_id'] as String?,
|
||||
publicationDate: (json['publication_date'] as num?)?.toInt(),
|
||||
title: json['title'] as String?,
|
||||
@@ -21,6 +22,9 @@ _TenderData _$TenderDataFromJson(Map<String, dynamic> json) => _TenderData(
|
||||
duration: json['duration'] as String?,
|
||||
durationUnit: json['durationUnit'] as String?,
|
||||
tenderDeadline: (json['tender_deadline'] as num?)?.toInt(),
|
||||
submissionDeadline: (json['submission_deadline'] as num?)?.toInt(),
|
||||
applicationDeadline: (json['application_deadline'] as num?)?.toInt(),
|
||||
submissionUrl: json['submission_url'] as String?,
|
||||
countryCode: json['country_code'] as String?,
|
||||
buyerOrganization:
|
||||
json['buyer_organization'] == null
|
||||
@@ -36,6 +40,7 @@ Map<String, dynamic> _$TenderDataToJson(_TenderData instance) =>
|
||||
'success': instance.success,
|
||||
'message': instance.message,
|
||||
'id': instance.id,
|
||||
'tender_id': instance.tenderId,
|
||||
'notice_publication_id': instance.noticePublicationId,
|
||||
'publication_date': instance.publicationDate,
|
||||
'title': instance.title,
|
||||
@@ -47,6 +52,9 @@ Map<String, dynamic> _$TenderDataToJson(_TenderData instance) =>
|
||||
'duration': instance.duration,
|
||||
'durationUnit': instance.durationUnit,
|
||||
'tender_deadline': instance.tenderDeadline,
|
||||
'submission_deadline': instance.submissionDeadline,
|
||||
'application_deadline': instance.applicationDeadline,
|
||||
'submission_url': instance.submissionUrl,
|
||||
'country_code': instance.countryCode,
|
||||
'buyer_organization': instance.buyerOrganization,
|
||||
'status': instance.status,
|
||||
|
||||
@@ -7,24 +7,27 @@ import '../../../core/network/network_manager.dart';
|
||||
|
||||
class YourTendersService {
|
||||
YourTendersService({required NetworkManager networkManager})
|
||||
: _networkManager = networkManager;
|
||||
: _networkManager = networkManager;
|
||||
|
||||
final NetworkManager _networkManager;
|
||||
|
||||
Future<Result<TenderApprovalsResponse>> getApprovedTenders() async {
|
||||
try {
|
||||
final result = await _networkManager.makeRequest(
|
||||
'/api/v1/tender-approvals?status=approved',
|
||||
'/api/v1/tender-approvals?status=submitted',
|
||||
(json) => TenderApprovalsResponse.fromJson(json),
|
||||
method: 'GET',
|
||||
);
|
||||
|
||||
return result;
|
||||
} on DioException catch (e) {
|
||||
appLogger.error('get approved tenders failed: $e');
|
||||
appLogger.error('get submitted tenders failed: $e');
|
||||
return Result.error(e);
|
||||
} on Exception catch (e, stackTrace) {
|
||||
appLogger.error('get approved tenders failed: $e', stackTrace: stackTrace);
|
||||
appLogger.error(
|
||||
'get submitted tenders failed: $e',
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
return Result.error(Exception(e));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class TenderDetailViewModel with ChangeNotifier {
|
||||
notifyListeners();
|
||||
final result = await _tendersRepository.toggleApprovals(
|
||||
tenderId: tenderId,
|
||||
status: 'approved',
|
||||
status: 'submitted',
|
||||
submissionMode: submissionMode,
|
||||
);
|
||||
switch (result) {
|
||||
|
||||
@@ -27,17 +27,17 @@ class _TenderDetailDesktopPageState extends State<TenderDetailDesktopPage> {
|
||||
|
||||
void _viewModelListener() {
|
||||
if (viewModel.status.isNotEmpty &&
|
||||
viewModel.status == 'approved' &&
|
||||
viewModel.status == 'submitted' &&
|
||||
viewModel.approvalStatus == true) {
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text('tender approved successfully!')));
|
||||
).showSnackBar(SnackBar(content: Text('tender submitted successfully!')));
|
||||
}
|
||||
if (viewModel.status.isNotEmpty &&
|
||||
viewModel.status == 'unapproved' &&
|
||||
viewModel.status == 'unsubmitted' &&
|
||||
viewModel.approvalStatus == true) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('tender approve removed sucessfully!')),
|
||||
SnackBar(content: Text('tender submitted removed sucessfully!')),
|
||||
);
|
||||
}
|
||||
if (viewModel.status.isNotEmpty &&
|
||||
|
||||
@@ -28,17 +28,17 @@ class _TenderDetailMobilePageState extends State<TenderDetailMobilePage> {
|
||||
|
||||
void _viewModelListener() {
|
||||
if (viewModel.status.isNotEmpty &&
|
||||
viewModel.status == 'approved' &&
|
||||
viewModel.status == 'submitted' &&
|
||||
viewModel.approvalStatus == true) {
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text('tender approved successfully!')));
|
||||
).showSnackBar(SnackBar(content: Text('tender submitted successfully!')));
|
||||
}
|
||||
if (viewModel.status.isNotEmpty &&
|
||||
viewModel.status == 'unapproved' &&
|
||||
viewModel.status == 'unsubmitted' &&
|
||||
viewModel.approvalStatus == true) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('tender approve removed sucessfully!')),
|
||||
SnackBar(content: Text('tender submitted removed sucessfully!')),
|
||||
);
|
||||
}
|
||||
if (viewModel.status.isNotEmpty &&
|
||||
|
||||
@@ -29,17 +29,17 @@ class _TenderDetailTabletPageState extends State<TenderDetailTabletPage> {
|
||||
|
||||
void _viewModelListener() {
|
||||
if (viewModel.status.isNotEmpty &&
|
||||
viewModel.status == 'approved' &&
|
||||
viewModel.status == 'submitted' &&
|
||||
viewModel.approvalStatus == true) {
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text('tender approved successfully!')));
|
||||
).showSnackBar(SnackBar(content: Text('tender submitted successfully!')));
|
||||
}
|
||||
if (viewModel.status.isNotEmpty &&
|
||||
viewModel.status == 'unapproved' &&
|
||||
viewModel.status == 'unsubmitted' &&
|
||||
viewModel.approvalStatus == true) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('tender approve removed sucessfully!')),
|
||||
SnackBar(content: Text('tender submitted removed sucessfully!')),
|
||||
);
|
||||
}
|
||||
if (viewModel.status.isNotEmpty &&
|
||||
|
||||
@@ -70,7 +70,7 @@ class TenderDetailActions extends StatelessWidget {
|
||||
backgroundColor: AppColors.lightBlue,
|
||||
textColor: AppColors.mainBlue,
|
||||
onPressed: () {
|
||||
if (viewModel.status == 'approved') {
|
||||
if (viewModel.status == 'submitted') {
|
||||
viewModel.submitTenderApproval(
|
||||
tenderId: detail.id!,
|
||||
submissionMode: 'self-apply',
|
||||
@@ -122,7 +122,7 @@ class TenderDetailActions extends StatelessWidget {
|
||||
backgroundColor: AppColors.primary30,
|
||||
textColor: AppColors.mainBlue,
|
||||
onPressed: () {
|
||||
if (viewModel.status == 'approved') {
|
||||
if (viewModel.status == 'submitted') {
|
||||
viewModel.submitTenderApproval(
|
||||
tenderId: detail.id!,
|
||||
submissionMode: 'self-apply',
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tm_app/core/constants/strings.dart';
|
||||
import 'package:tm_app/core/routes/app_routes.dart';
|
||||
@@ -6,6 +7,7 @@ import 'package:tm_app/core/theme/colors.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
import 'package:tm_app/data/services/model/tender_approvals_state_response/tender_approvals_state_response.dart';
|
||||
import 'package:tm_app/view_models/home_view_model.dart';
|
||||
import 'package:tm_app/views/shared/desktop_navigation_widget.dart';
|
||||
|
||||
import '../widgets.dart';
|
||||
|
||||
@@ -27,36 +29,60 @@ class DesktopHomePage extends StatelessWidget {
|
||||
return Center(child: Text(homeViewModel.errorMessage!));
|
||||
}
|
||||
|
||||
return Center(
|
||||
child: SizedBox(
|
||||
width: 780,
|
||||
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(height: 55),
|
||||
// SizedBox(width: 780, child: NotificationCard()),
|
||||
SizedBox(height: 40.0),
|
||||
_progressBarsRow(
|
||||
homeViewModel.tenderApprovalsStateResponse!,
|
||||
),
|
||||
SizedBox(height: 32.0.h()),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 15.0.w()),
|
||||
child: _firstTenderCardsRow(
|
||||
context,
|
||||
homeViewModel.tenderApprovalsStateResponse!,
|
||||
return Column(
|
||||
children: [
|
||||
DesktopNavigationWidget(
|
||||
currentIndex: 0, // Home index
|
||||
onTabChanged: (index) {
|
||||
// Navigate to different screens based on index
|
||||
switch (index) {
|
||||
case 0:
|
||||
// Already on home
|
||||
break;
|
||||
case 1:
|
||||
// Navigate to tenders
|
||||
Router.neglect(context, () => context.go('/tenders'));
|
||||
break;
|
||||
case 2:
|
||||
// Navigate to profile
|
||||
Router.neglect(context, () => context.go('/profile'));
|
||||
break;
|
||||
}
|
||||
},
|
||||
),
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: SizedBox(
|
||||
width: 780,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(height: 55),
|
||||
// SizedBox(width: 780, child: NotificationCard()),
|
||||
SizedBox(height: 40.0),
|
||||
_progressBarsRow(
|
||||
homeViewModel.tenderApprovalsStateResponse!,
|
||||
),
|
||||
SizedBox(height: 32.0.h()),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 15.0.w()),
|
||||
child: _firstTenderCardsRow(
|
||||
context,
|
||||
homeViewModel.tenderApprovalsStateResponse!,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 32.0.h()),
|
||||
_yourTenderText(homeViewModel),
|
||||
SizedBox(height: 8.0.h()),
|
||||
_bottomListView(homeViewModel),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 32.0.h()),
|
||||
_yourTenderText(homeViewModel),
|
||||
SizedBox(height: 8.0.h()),
|
||||
_bottomListView(homeViewModel),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -117,7 +143,7 @@ class DesktopHomePage extends StatelessWidget {
|
||||
iconPath: 'assets/icons/arrows.svg',
|
||||
title: AppStrings.tenderSubmitted,
|
||||
amount:
|
||||
tenderApprovalsStateResponse.data!.approvedTenders.toString(),
|
||||
tenderApprovalsStateResponse.data!.submittedTenders.toString(),
|
||||
// tenderApprovalsStateResponse
|
||||
// .data!
|
||||
// .approvalsBySubmission!
|
||||
|
||||
@@ -117,7 +117,7 @@ class MobileHomePage extends StatelessWidget {
|
||||
iconPath: AssetsManager.arrows,
|
||||
title: AppStrings.tenderSubmitted,
|
||||
amount:
|
||||
tenderApprovalsStateResponse.data!.approvedTenders.toString(),
|
||||
tenderApprovalsStateResponse.data!.submittedTenders.toString(),
|
||||
// tenderApprovalsStateResponse
|
||||
// .data!
|
||||
// .approvalsBySubmission!
|
||||
|
||||
@@ -120,7 +120,7 @@ class TabletHomePage extends StatelessWidget {
|
||||
iconPath: 'assets/icons/arrows.svg',
|
||||
title: AppStrings.tenderSubmitted,
|
||||
amount:
|
||||
tenderApprovalsStateResponse.data!.approvedTenders.toString(),
|
||||
tenderApprovalsStateResponse.data!.submittedTenders.toString(),
|
||||
// tenderApprovalsStateResponse
|
||||
// .data!
|
||||
// .approvalsBySubmission!
|
||||
@@ -207,16 +207,16 @@ class TabletHomePage extends StatelessWidget {
|
||||
Widget _bottomListView(HomeViewModel homeViewModel) {
|
||||
final controller = ScrollController();
|
||||
|
||||
controller.addListener(() {
|
||||
if (homeViewModel.isRecommendedMode) {
|
||||
if (controller.position.pixels >=
|
||||
controller.position.maxScrollExtent - 200) {
|
||||
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
||||
homeViewModel.getHomeRecommandTenders();
|
||||
controller.addListener(() {
|
||||
if (homeViewModel.isRecommendedMode) {
|
||||
if (controller.position.pixels >=
|
||||
controller.position.maxScrollExtent - 200) {
|
||||
if (!homeViewModel.isLoadingMore && homeViewModel.hasMore) {
|
||||
homeViewModel.getHomeRecommandTenders();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tm_app/core/routes/app_routes.dart';
|
||||
import 'package:tm_app/core/theme/colors.dart';
|
||||
|
||||
import '../../../core/constants/assets.dart';
|
||||
@@ -30,7 +30,7 @@ class _LoginDesktopPageState extends State<LoginDesktopPage> {
|
||||
|
||||
void _viewModelListener() {
|
||||
if (viewModel.loggedInUser != null) {
|
||||
HomeRouteData().go(context);
|
||||
Router.neglect(context, () => context.go('/home'));
|
||||
} else if (viewModel.errorMessage != null) {
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tm_app/core/routes/app_routes.dart';
|
||||
import 'package:tm_app/view_models/profile_view_model.dart';
|
||||
@@ -8,6 +9,7 @@ import '../../../core/constants/assets.dart';
|
||||
import '../../../core/constants/strings.dart';
|
||||
import '../../../core/theme/colors.dart';
|
||||
import '../../../core/utils/size_config.dart';
|
||||
import '../../shared/desktop_navigation_widget.dart';
|
||||
import '../widgets/theme_toggle.dart';
|
||||
import '../widgets/title_description.dart';
|
||||
|
||||
@@ -63,101 +65,128 @@ class _DesktopProfilePageState extends State<DesktopProfilePage> {
|
||||
return Center(child: Text(viewModel.errorMessage!));
|
||||
}
|
||||
|
||||
return Center(
|
||||
child: SizedBox(
|
||||
width: 740,
|
||||
height: 662,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 36.0.h()),
|
||||
TitleDescription(
|
||||
title: 'Company Name',
|
||||
description: viewModel.companyProfileData!.name!,
|
||||
),
|
||||
TitleDescription(
|
||||
title: 'National ID',
|
||||
description: viewModel.companyProfileData!.id!,
|
||||
),
|
||||
TitleDescription(
|
||||
title: 'Registration No.',
|
||||
description:
|
||||
viewModel.companyProfileData!.registrationNumber!,
|
||||
),
|
||||
TitleDescription(title: 'Business Type', description: '-'),
|
||||
TitleDescription(
|
||||
title: 'Founded',
|
||||
description:
|
||||
viewModel.companyProfileData!.foundedYear!.toString(),
|
||||
),
|
||||
SizedBox(height: 24.0.h()),
|
||||
// Theme Toggle
|
||||
Align(
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
child: Text(
|
||||
AppStrings.settings,
|
||||
style: TextStyle(
|
||||
fontSize: 20.0.sp(),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.grey70,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 36.0.h()),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
AppStrings.appTheme,
|
||||
style: TextStyle(
|
||||
fontSize: 16.0.sp(),
|
||||
fontWeight: FontWeight.w400,
|
||||
color: AppColors.grey70,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
SvgPicture.asset(AssetsManager.sun),
|
||||
SizedBox(width: 12.0.w()),
|
||||
SizedBox(
|
||||
width: 52.0.w(),
|
||||
height: 32.0.h(),
|
||||
child: ThemeToggle(),
|
||||
),
|
||||
SizedBox(width: 12.0.w()),
|
||||
SvgPicture.asset(AssetsManager.moon),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 24.0.h()),
|
||||
Divider(color: AppColors.dividerColor, thickness: 1),
|
||||
SizedBox(height: 24.0.h()),
|
||||
// Spacer(),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: InkWell(
|
||||
onTap: () => viewModel.logout(),
|
||||
child: Container(
|
||||
width: 156,
|
||||
height: 56.0.h(),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.primary20,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'Logout',
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.primaryColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
return Column(
|
||||
children: [
|
||||
DesktopNavigationWidget(
|
||||
currentIndex: 2, // Tenders index
|
||||
onTabChanged: (index) {
|
||||
// Navigate to different screens based on index
|
||||
switch (index) {
|
||||
case 0:
|
||||
// Navigate to home
|
||||
Router.neglect(context, () => context.go('/home'));
|
||||
break;
|
||||
case 1:
|
||||
// Navigate to profile
|
||||
Router.neglect(context, () => context.go('/tenders'));
|
||||
break;
|
||||
case 2:
|
||||
// Already on profile
|
||||
|
||||
break;
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
// color: Colors.amber.shade100,
|
||||
width: 740,
|
||||
// height: 662,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 36.0.h()),
|
||||
TitleDescription(
|
||||
title: 'Company Name',
|
||||
description: viewModel.companyProfileData!.name!,
|
||||
),
|
||||
TitleDescription(
|
||||
title: 'National ID',
|
||||
description: viewModel.companyProfileData!.id!,
|
||||
),
|
||||
TitleDescription(
|
||||
title: 'Registration No.',
|
||||
description:
|
||||
viewModel.companyProfileData!.registrationNumber!,
|
||||
),
|
||||
TitleDescription(
|
||||
title: 'Business Type',
|
||||
description: '-',
|
||||
),
|
||||
TitleDescription(
|
||||
title: 'Founded',
|
||||
description:
|
||||
viewModel.companyProfileData!.foundedYear!
|
||||
.toString(),
|
||||
),
|
||||
SizedBox(height: 24.0.h()),
|
||||
// Theme Toggle
|
||||
Align(
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
child: Text(
|
||||
AppStrings.settings,
|
||||
style: TextStyle(
|
||||
fontSize: 20.0.sp(),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.grey70,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 36.0.h()),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
AppStrings.appTheme,
|
||||
style: TextStyle(
|
||||
fontSize: 16.0.sp(),
|
||||
fontWeight: FontWeight.w400,
|
||||
color: AppColors.grey70,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
SvgPicture.asset(AssetsManager.sun),
|
||||
SizedBox(width: 12.0.w()),
|
||||
SizedBox(
|
||||
width: 52.0.w(),
|
||||
height: 32.0.h(),
|
||||
child: ThemeToggle(),
|
||||
),
|
||||
SizedBox(width: 12.0.w()),
|
||||
SvgPicture.asset(AssetsManager.moon),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 24.0.h()),
|
||||
Divider(color: AppColors.dividerColor, thickness: 1),
|
||||
SizedBox(height: 24.0.h()),
|
||||
// Spacer(),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: InkWell(
|
||||
onTap: () => viewModel.logout(),
|
||||
child: Container(
|
||||
width: 156,
|
||||
height: 56.0.h(),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.primary20,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'Logout',
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.primaryColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:tm_app/core/constants/assets.dart';
|
||||
import 'package:tm_app/core/constants/strings.dart';
|
||||
import 'package:tm_app/core/theme/colors.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
|
||||
class DesktopNavigationWidget extends StatelessWidget {
|
||||
const DesktopNavigationWidget({
|
||||
required this.currentIndex,
|
||||
required this.onTabChanged,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final int currentIndex;
|
||||
final ValueChanged<int> onTabChanged;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: 64,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.backgroundColor,
|
||||
border: Border(bottom: BorderSide(color: AppColors.grey30)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(width: 40),
|
||||
SvgPicture.asset(AssetsManager.logoSmall),
|
||||
Spacer(),
|
||||
_navigationItem(
|
||||
context: context,
|
||||
text: AppStrings.home,
|
||||
isActive: currentIndex == 0,
|
||||
onTap: () => onTabChanged(0),
|
||||
iconPath: AssetsManager.home,
|
||||
activeIconPath: AssetsManager.homeActive,
|
||||
),
|
||||
SizedBox(width: 24),
|
||||
_navigationItem(
|
||||
context: context,
|
||||
text: AppStrings.tendersTitle,
|
||||
isActive: currentIndex == 1,
|
||||
onTap: () => onTabChanged(1),
|
||||
iconPath: AssetsManager.tenders,
|
||||
activeIconPath: AssetsManager.tendersActive,
|
||||
),
|
||||
SizedBox(width: 24),
|
||||
_navigationItem(
|
||||
context: context,
|
||||
text: AppStrings.profile,
|
||||
isActive: currentIndex == 2,
|
||||
onTap: () => onTabChanged(2),
|
||||
iconPath: AssetsManager.profile,
|
||||
activeIconPath: AssetsManager.profileActive,
|
||||
),
|
||||
Spacer(),
|
||||
SizedBox(width: 68),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _navigationItem({
|
||||
required BuildContext context,
|
||||
required String text,
|
||||
required bool isActive,
|
||||
required VoidCallback onTap,
|
||||
required String iconPath,
|
||||
required String activeIconPath,
|
||||
}) {
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
child: SizedBox(
|
||||
width: 100.0,
|
||||
height: 64,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SvgPicture.asset(isActive ? activeIconPath : iconPath),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontSize: 12.0.sp(),
|
||||
fontWeight: FontWeight.w400,
|
||||
color: isActive ? AppColors.primaryColor : AppColors.grey60,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tm_app/core/theme/colors.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
import 'package:tm_app/view_models/home_view_model.dart';
|
||||
import 'package:tm_app/view_models/tenders_view_model.dart';
|
||||
import 'package:tm_app/views/shared/desktop_navigation_widget.dart';
|
||||
import 'package:tm_app/views/tenders/widgets/main_tenders_slider.dart';
|
||||
|
||||
class DesktopTendersPage extends StatefulWidget {
|
||||
@@ -51,34 +54,62 @@ class _DesktopTendersPageState extends State<DesktopTendersPage> {
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
backgroundColor: AppColors.backgroundColor,
|
||||
body: Center(
|
||||
child: SingleChildScrollView(
|
||||
child: Consumer<TendersViewModel>(
|
||||
builder: (context, viewModel, child) {
|
||||
if (viewModel.isLoading) {
|
||||
return Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: AppColors.jellyBean,
|
||||
),
|
||||
);
|
||||
body: Column(
|
||||
children: [
|
||||
DesktopNavigationWidget(
|
||||
currentIndex: 1, // Tenders index
|
||||
onTabChanged: (index) {
|
||||
// Navigate to different screens based on index
|
||||
switch (index) {
|
||||
case 0:
|
||||
// Navigate to home
|
||||
Router.neglect(context, () => context.go('/home'));
|
||||
context.read<HomeViewModel>().init();
|
||||
break;
|
||||
case 1:
|
||||
// Already on tenders
|
||||
break;
|
||||
case 2:
|
||||
// Navigate to profile
|
||||
// context.go('/profile');
|
||||
Router.neglect(context, () => context.go('/profile'));
|
||||
break;
|
||||
}
|
||||
if (viewModel.errorMessage != null) {
|
||||
return Center(child: Text(viewModel.errorMessage!));
|
||||
}
|
||||
return SizedBox(
|
||||
width: 740,
|
||||
height: 800,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 24.0.h()),
|
||||
child: MainTendersSlider(
|
||||
tenders: viewModel.tendersResponse?.data?.tenders ?? [],
|
||||
isDesktop: true,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: SingleChildScrollView(
|
||||
child: Consumer<TendersViewModel>(
|
||||
builder: (context, viewModel, child) {
|
||||
if (viewModel.isLoading) {
|
||||
return Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: AppColors.jellyBean,
|
||||
),
|
||||
);
|
||||
}
|
||||
if (viewModel.errorMessage != null) {
|
||||
return Center(child: Text(viewModel.errorMessage!));
|
||||
}
|
||||
return SizedBox(
|
||||
width: 740,
|
||||
height: 800,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 24.0.h()),
|
||||
child: MainTendersSlider(
|
||||
tenders:
|
||||
viewModel.tendersResponse?.data?.tenders ?? [],
|
||||
isDesktop: true,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -104,7 +104,7 @@ class TenderActionButtonsRow extends StatelessWidget {
|
||||
if (tender.id == null) return const SizedBox.shrink();
|
||||
|
||||
final approval = viewModel.getTenderApprovalForTender(tender.id!);
|
||||
final isApproved = approval?.status == 'approved';
|
||||
final isApproved = approval?.status == 'submitted';
|
||||
|
||||
return Tooltip(
|
||||
message: AppStrings.submit,
|
||||
@@ -115,7 +115,7 @@ class TenderActionButtonsRow extends StatelessWidget {
|
||||
viewModel.toggleApprovals(
|
||||
tenderId: tender.id!,
|
||||
submissionMode: approval?.submissionMode ?? 'self-apply',
|
||||
status: 'approved',
|
||||
status: 'submitted',
|
||||
);
|
||||
} else {
|
||||
showModalBottomSheet(
|
||||
@@ -127,7 +127,7 @@ class TenderActionButtonsRow extends StatelessWidget {
|
||||
viewModel.toggleApprovals(
|
||||
tenderId: tender.id!,
|
||||
submissionMode: value,
|
||||
status: 'approved',
|
||||
status: 'submitted',
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tm_app/core/constants/strings.dart';
|
||||
import 'package:tm_app/core/theme/colors.dart';
|
||||
@@ -8,6 +9,8 @@ import 'package:tm_app/views/your_tenders/widgets/approved_tenders.dart';
|
||||
import 'package:tm_app/views/your_tenders/widgets/tablet_desktop_appbar.dart';
|
||||
import 'package:tm_app/views/your_tenders/widgets/tenders_submitted.dart';
|
||||
|
||||
import '../../shared/desktop_navigation_widget.dart';
|
||||
|
||||
class YourTendersDesktopPage extends StatefulWidget {
|
||||
const YourTendersDesktopPage({super.key});
|
||||
|
||||
@@ -41,49 +44,75 @@ class _YourTendersDesktopPageState extends State<YourTendersDesktopPage>
|
||||
child: Scaffold(
|
||||
backgroundColor: AppColors.backgroundColor,
|
||||
|
||||
body: Center(
|
||||
child: SizedBox(
|
||||
width: 740,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 128.0),
|
||||
TabletDesktopAppbar(),
|
||||
SizedBox(height: 20.0),
|
||||
MainTabBar(
|
||||
controller: controller,
|
||||
titles: [
|
||||
AppStrings.approvedTenders,
|
||||
AppStrings.tenderSubmitted,
|
||||
body: Column(
|
||||
children: [
|
||||
DesktopNavigationWidget(
|
||||
currentIndex: 1, // Tenders index
|
||||
onTabChanged: (index) {
|
||||
// Navigate to different screens based on index
|
||||
switch (index) {
|
||||
case 0:
|
||||
// Navigate to home
|
||||
Router.neglect(context, () => context.go('/home'));
|
||||
break;
|
||||
case 1:
|
||||
// Already on tenders
|
||||
break;
|
||||
case 2:
|
||||
// Navigate to profile
|
||||
// context.go('/profile');
|
||||
Router.neglect(context, () => context.go('/profile'));
|
||||
break;
|
||||
}
|
||||
},
|
||||
),
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
width: 740,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 64.0),
|
||||
TabletDesktopAppbar(),
|
||||
SizedBox(height: 20.0),
|
||||
MainTabBar(
|
||||
controller: controller,
|
||||
titles: [
|
||||
AppStrings.approvedTenders,
|
||||
AppStrings.tenderSubmitted,
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: Consumer<YourTendersViewModel>(
|
||||
builder: (context, viewModel, child) {
|
||||
if (viewModel.isLoading) {
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: AppColors.secondary50,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (viewModel.errorMessage != null) {
|
||||
return Center(child: Text(viewModel.errorMessage!));
|
||||
}
|
||||
|
||||
return TabBarView(
|
||||
controller: controller,
|
||||
children: [
|
||||
ApprovedTenders(tendersSubmitted: []),
|
||||
TendersSubmitted(
|
||||
approvedTenders: viewModel.data!,
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: Consumer<YourTendersViewModel>(
|
||||
builder: (context, viewModel, child) {
|
||||
if (viewModel.isLoading) {
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: AppColors.secondary50,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (viewModel.errorMessage != null) {
|
||||
return Center(child: Text(viewModel.errorMessage!));
|
||||
}
|
||||
|
||||
return TabBarView(
|
||||
controller: controller,
|
||||
children: [
|
||||
ApprovedTenders(tendersSubmitted: []),
|
||||
TendersSubmitted(approvedTenders: viewModel.data!),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@ class TendersSubmitted extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return approvedTenders.data == null
|
||||
? const Center(child: Text('No approved projects yet.'))
|
||||
? const Center(child: Text('No submitted projects yet.'))
|
||||
: ListView.builder(
|
||||
padding: const EdgeInsets.only(top: 20),
|
||||
itemCount: approvedTenders.data!.length,
|
||||
@@ -31,31 +31,31 @@ class TendersSubmitted extends StatelessWidget {
|
||||
backgroundColor:
|
||||
tender.status == 'Won'
|
||||
? AppColors.green0
|
||||
: tender.status == 'approved'
|
||||
: tender.status == 'submitted'
|
||||
? AppColors.grey0
|
||||
: AppColors.red0.withValues(alpha: 0.2),
|
||||
borderColor:
|
||||
tender.status == 'Won'
|
||||
? AppColors.green10
|
||||
: tender.status == 'approved'
|
||||
: tender.status == 'submitted'
|
||||
? AppColors.grey30
|
||||
: AppColors.red0,
|
||||
statusIcon:
|
||||
tender.status == 'Won'
|
||||
? AssetsManager.tickCircle
|
||||
: tender.status == 'approved'
|
||||
: tender.status == 'submitted'
|
||||
? null
|
||||
: AssetsManager.closeCircle,
|
||||
statusCardColor:
|
||||
tender.status == 'Won'
|
||||
? AppColors.green20
|
||||
: tender.status == 'approved'
|
||||
: tender.status == 'submitted'
|
||||
? AppColors.green20
|
||||
: AppColors.red0,
|
||||
statusTextColor:
|
||||
tender.status == 'Won'
|
||||
? AppColors.green30
|
||||
: tender.status == 'approved'
|
||||
: tender.status == 'submitted'
|
||||
? AppColors.green30
|
||||
: AppColors.red10,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user