some changes navigation in web and response changes

This commit is contained in:
amirrezaghabeli
2025-08-26 12:22:42 +03:30
parent 1b94f704cb
commit f964186a87
24 changed files with 553 additions and 398 deletions
+1
View File
@@ -1,4 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<application <application
android:label="tm_app" android:label="tm_app"
android:name="${applicationName}" android:name="${applicationName}"
@@ -1,10 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:go_router/go_router.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 { class DesktopShellPage extends StatelessWidget {
const DesktopShellPage({ const DesktopShellPage({
@@ -18,91 +13,6 @@ class DesktopShellPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(body: navigationShell);
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,
),
),
],
),
),
);
} }
} }
@@ -11,12 +11,14 @@ abstract class TenderApprovalsStateData with _$TenderApprovalsStateData {
const factory TenderApprovalsStateData({ const factory TenderApprovalsStateData({
@JsonKey(name: 'company_id') required String? companyId, @JsonKey(name: 'company_id') required String? companyId,
@JsonKey(name: 'total_approvals') required int? totalApprovals, @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: 'rejected_tenders') required int? rejectedTenders,
@JsonKey(name: 'self_apply_count') required int? selfApplyCount, @JsonKey(name: 'self_apply_count') required int? selfApplyCount,
@JsonKey(name: 'partnership_count') required int? partnershipCount, @JsonKey(name: 'partnership_count') required int? partnershipCount,
@JsonKey(name: 'approvals_by_status') required ApprovalsByStatus? approvalsByStatus, @JsonKey(name: 'approvals_by_status')
@JsonKey(name: 'approvals_by_submission') required ApprovalsBySubmission? approvalsBySubmission, required ApprovalsByStatus? approvalsByStatus,
@JsonKey(name: 'approvals_by_submission')
required ApprovalsBySubmission? approvalsBySubmission,
@JsonKey(name: 'last_updated') required int? lastUpdated, @JsonKey(name: 'last_updated') required int? lastUpdated,
}) = _TenderApprovalsStateData; }) = _TenderApprovalsStateData;
@@ -27,7 +29,7 @@ abstract class TenderApprovalsStateData with _$TenderApprovalsStateData {
@freezed @freezed
abstract class ApprovalsByStatus with _$ApprovalsByStatus { abstract class ApprovalsByStatus with _$ApprovalsByStatus {
const factory ApprovalsByStatus({ const factory ApprovalsByStatus({
@JsonKey(name: 'approved') required int? approved, @JsonKey(name: 'submitted') required int? submitted,
@JsonKey(name: 'rejected') required int? rejected, @JsonKey(name: 'rejected') required int? rejected,
}) = _ApprovalsByStatus; }) = _ApprovalsByStatus;
@@ -15,7 +15,7 @@ T _$identity<T>(T value) => value;
/// @nodoc /// @nodoc
mixin _$TenderApprovalsStateData { 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 /// Create a copy of TenderApprovalsStateData
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false) @JsonKey(includeFromJson: false, includeToJson: false)
@@ -28,16 +28,16 @@ $TenderApprovalsStateDataCopyWith<TenderApprovalsStateData> get copyWith => _$Te
@override @override
bool operator ==(Object other) { 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) @JsonKey(includeFromJson: false, includeToJson: false)
@override @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 @override
String toString() { 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; factory $TenderApprovalsStateDataCopyWith(TenderApprovalsStateData value, $Res Function(TenderApprovalsStateData) _then) = _$TenderApprovalsStateDataCopyWithImpl;
@useResult @useResult
$Res call({ $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 /// Create a copy of TenderApprovalsStateData
/// with the given fields replaced by the non-null parameter values. /// 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( return _then(_self.copyWith(
companyId: freezed == companyId ? _self.companyId : companyId // ignore: cast_nullable_to_non_nullable 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 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?,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?,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 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) { switch (_that) {
case _TenderApprovalsStateData() when $default != null: 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(); 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) { switch (_that) {
case _TenderApprovalsStateData(): 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'); 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) { switch (_that) {
case _TenderApprovalsStateData() when $default != null: 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; return null;
} }
@@ -241,12 +241,12 @@ return $default(_that.companyId,_that.totalApprovals,_that.approvedTenders,_that
@JsonSerializable(explicitToJson: true) @JsonSerializable(explicitToJson: true)
class _TenderApprovalsStateData implements TenderApprovalsStateData { 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); factory _TenderApprovalsStateData.fromJson(Map<String, dynamic> json) => _$TenderApprovalsStateDataFromJson(json);
@override@JsonKey(name: 'company_id') final String? companyId; @override@JsonKey(name: 'company_id') final String? companyId;
@override@JsonKey(name: 'total_approvals') final int? totalApprovals; @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: 'rejected_tenders') final int? rejectedTenders;
@override@JsonKey(name: 'self_apply_count') final int? selfApplyCount; @override@JsonKey(name: 'self_apply_count') final int? selfApplyCount;
@override@JsonKey(name: 'partnership_count') final int? partnershipCount; @override@JsonKey(name: 'partnership_count') final int? partnershipCount;
@@ -267,16 +267,16 @@ Map<String, dynamic> toJson() {
@override @override
bool operator ==(Object other) { 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) @JsonKey(includeFromJson: false, includeToJson: false)
@override @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 @override
String toString() { 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; factory _$TenderApprovalsStateDataCopyWith(_TenderApprovalsStateData value, $Res Function(_TenderApprovalsStateData) _then) = __$TenderApprovalsStateDataCopyWithImpl;
@override @useResult @override @useResult
$Res call({ $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 /// Create a copy of TenderApprovalsStateData
/// with the given fields replaced by the non-null parameter values. /// 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( return _then(_TenderApprovalsStateData(
companyId: freezed == companyId ? _self.companyId : companyId // ignore: cast_nullable_to_non_nullable 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 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?,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?,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 as int?,partnershipCount: freezed == partnershipCount ? _self.partnershipCount : partnershipCount // ignore: cast_nullable_to_non_nullable
@@ -350,7 +350,7 @@ $ApprovalsBySubmissionCopyWith<$Res>? get approvalsBySubmission {
/// @nodoc /// @nodoc
mixin _$ApprovalsByStatus { 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 /// Create a copy of ApprovalsByStatus
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false) @JsonKey(includeFromJson: false, includeToJson: false)
@@ -363,16 +363,16 @@ $ApprovalsByStatusCopyWith<ApprovalsByStatus> get copyWith => _$ApprovalsByStatu
@override @override
bool operator ==(Object other) { 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) @JsonKey(includeFromJson: false, includeToJson: false)
@override @override
int get hashCode => Object.hash(runtimeType,approved,rejected); int get hashCode => Object.hash(runtimeType,submitted,rejected);
@override @override
String toString() { 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; factory $ApprovalsByStatusCopyWith(ApprovalsByStatus value, $Res Function(ApprovalsByStatus) _then) = _$ApprovalsByStatusCopyWithImpl;
@useResult @useResult
$Res call({ $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 /// Create a copy of ApprovalsByStatus
/// with the given fields replaced by the non-null parameter values. /// 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( 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?,rejected: freezed == rejected ? _self.rejected : rejected // ignore: cast_nullable_to_non_nullable
as int?, 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) { switch (_that) {
case _ApprovalsByStatus() when $default != null: case _ApprovalsByStatus() when $default != null:
return $default(_that.approved,_that.rejected);case _: return $default(_that.submitted,_that.rejected);case _:
return orElse(); 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) { switch (_that) {
case _ApprovalsByStatus(): case _ApprovalsByStatus():
return $default(_that.approved,_that.rejected);case _: return $default(_that.submitted,_that.rejected);case _:
throw StateError('Unexpected subclass'); 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) { switch (_that) {
case _ApprovalsByStatus() when $default != null: case _ApprovalsByStatus() when $default != null:
return $default(_that.approved,_that.rejected);case _: return $default(_that.submitted,_that.rejected);case _:
return null; return null;
} }
@@ -545,10 +545,10 @@ return $default(_that.approved,_that.rejected);case _:
@JsonSerializable() @JsonSerializable()
class _ApprovalsByStatus implements ApprovalsByStatus { 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); 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; @override@JsonKey(name: 'rejected') final int? rejected;
/// Create a copy of ApprovalsByStatus /// Create a copy of ApprovalsByStatus
@@ -564,16 +564,16 @@ Map<String, dynamic> toJson() {
@override @override
bool operator ==(Object other) { 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) @JsonKey(includeFromJson: false, includeToJson: false)
@override @override
int get hashCode => Object.hash(runtimeType,approved,rejected); int get hashCode => Object.hash(runtimeType,submitted,rejected);
@override @override
String toString() { 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; factory _$ApprovalsByStatusCopyWith(_ApprovalsByStatus value, $Res Function(_ApprovalsByStatus) _then) = __$ApprovalsByStatusCopyWithImpl;
@override @useResult @override @useResult
$Res call({ $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 /// Create a copy of ApprovalsByStatus
/// with the given fields replaced by the non-null parameter values. /// 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( 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?,rejected: freezed == rejected ? _self.rejected : rejected // ignore: cast_nullable_to_non_nullable
as int?, as int?,
)); ));
@@ -11,7 +11,7 @@ _TenderApprovalsStateData _$TenderApprovalsStateDataFromJson(
) => _TenderApprovalsStateData( ) => _TenderApprovalsStateData(
companyId: json['company_id'] as String?, companyId: json['company_id'] as String?,
totalApprovals: (json['total_approvals'] as num?)?.toInt(), 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(), rejectedTenders: (json['rejected_tenders'] as num?)?.toInt(),
selfApplyCount: (json['self_apply_count'] as num?)?.toInt(), selfApplyCount: (json['self_apply_count'] as num?)?.toInt(),
partnershipCount: (json['partnership_count'] as num?)?.toInt(), partnershipCount: (json['partnership_count'] as num?)?.toInt(),
@@ -35,7 +35,7 @@ Map<String, dynamic> _$TenderApprovalsStateDataToJson(
) => <String, dynamic>{ ) => <String, dynamic>{
'company_id': instance.companyId, 'company_id': instance.companyId,
'total_approvals': instance.totalApprovals, 'total_approvals': instance.totalApprovals,
'approved_tenders': instance.approvedTenders, 'submitted_tenders': instance.submittedTenders,
'rejected_tenders': instance.rejectedTenders, 'rejected_tenders': instance.rejectedTenders,
'self_apply_count': instance.selfApplyCount, 'self_apply_count': instance.selfApplyCount,
'partnership_count': instance.partnershipCount, 'partnership_count': instance.partnershipCount,
@@ -46,13 +46,13 @@ Map<String, dynamic> _$TenderApprovalsStateDataToJson(
_ApprovalsByStatus _$ApprovalsByStatusFromJson(Map<String, dynamic> json) => _ApprovalsByStatus _$ApprovalsByStatusFromJson(Map<String, dynamic> json) =>
_ApprovalsByStatus( _ApprovalsByStatus(
approved: (json['approved'] as num?)?.toInt(), submitted: (json['submitted'] as num?)?.toInt(),
rejected: (json['rejected'] as num?)?.toInt(), rejected: (json['rejected'] as num?)?.toInt(),
); );
Map<String, dynamic> _$ApprovalsByStatusToJson(_ApprovalsByStatus instance) => Map<String, dynamic> _$ApprovalsByStatusToJson(_ApprovalsByStatus instance) =>
<String, dynamic>{ <String, dynamic>{
'approved': instance.approved, 'submitted': instance.submitted,
'rejected': instance.rejected, 'rejected': instance.rejected,
}; };
@@ -9,23 +9,29 @@ part 'tender_data.g.dart';
@freezed @freezed
abstract class TenderData with _$TenderData { abstract class TenderData with _$TenderData {
const factory TenderData({ const factory TenderData({
required bool? success, required bool? success,
required String? message, required String? message,
required String? id, required String? id,
@JsonKey(name: 'notice_publication_id') required String? noticePublicationId, @JsonKey(name: 'tender_id') required String? tenderId,
@JsonKey(name: 'notice_publication_id')
required String? noticePublicationId,
@JsonKey(name: 'publication_date') required int? publicationDate, @JsonKey(name: 'publication_date') required int? publicationDate,
required String? title, required String? title,
required String? description, required String? description,
@JsonKey(name: 'procurement_type_code') required String? procurementTypeCode, @JsonKey(name: 'procurement_type_code')
required String? procurementTypeCode,
@JsonKey(name: 'procedure_code') required String? procedureCode, @JsonKey(name: 'procedure_code') required String? procedureCode,
@JsonKey(name: 'estimated_value') required int? estimatedValue, @JsonKey(name: 'estimated_value') required int? estimatedValue,
required String? currency, required String? currency,
required String? duration, required String? duration,
required String? durationUnit, required String? durationUnit,
@JsonKey(name: 'tender_deadline') required int? tenderDeadline, @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: 'country_code') required String? countryCode,
@JsonKey(name: 'buyer_organization') required Organization? buyerOrganization, @JsonKey(name: 'buyer_organization')
required Organization? buyerOrganization,
required String? status, required String? status,
}) = _TenderData; }) = _TenderData;
@@ -15,7 +15,7 @@ T _$identity<T>(T value) => value;
/// @nodoc /// @nodoc
mixin _$TenderData { 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 /// Create a copy of TenderData
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false) @JsonKey(includeFromJson: false, includeToJson: false)
@@ -28,16 +28,16 @@ $TenderDataCopyWith<TenderData> get copyWith => _$TenderDataCopyWithImpl<TenderD
@override @override
bool operator ==(Object other) { 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) @JsonKey(includeFromJson: false, includeToJson: false)
@override @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 @override
String toString() { 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; factory $TenderDataCopyWith(TenderData value, $Res Function(TenderData) _then) = _$TenderDataCopyWithImpl;
@useResult @useResult
$Res call({ $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 /// Create a copy of TenderData
/// with the given fields replaced by the non-null parameter values. /// 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( return _then(_self.copyWith(
success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable
as bool?,message: freezed == message ? _self.message : message // 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?,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?,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 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 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?,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?,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 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 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 Organization?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
as String?, 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) { switch (_that) {
case _TenderData() when $default != null: 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(); 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) { switch (_that) {
case _TenderData(): 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'); 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) { switch (_that) {
case _TenderData() when $default != null: 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; return null;
} }
@@ -237,12 +241,13 @@ return $default(_that.success,_that.message,_that.id,_that.noticePublicationId,_
@JsonSerializable() @JsonSerializable()
class _TenderData implements TenderData { 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); factory _TenderData.fromJson(Map<String, dynamic> json) => _$TenderDataFromJson(json);
@override final bool? success; @override final bool? success;
@override final String? message; @override final String? message;
@override final String? id; @override final String? id;
@override@JsonKey(name: 'tender_id') final String? tenderId;
@override@JsonKey(name: 'notice_publication_id') final String? noticePublicationId; @override@JsonKey(name: 'notice_publication_id') final String? noticePublicationId;
@override@JsonKey(name: 'publication_date') final int? publicationDate; @override@JsonKey(name: 'publication_date') final int? publicationDate;
@override final String? title; @override final String? title;
@@ -254,6 +259,9 @@ class _TenderData implements TenderData {
@override final String? duration; @override final String? duration;
@override final String? durationUnit; @override final String? durationUnit;
@override@JsonKey(name: 'tender_deadline') final int? tenderDeadline; @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: 'country_code') final String? countryCode;
@override@JsonKey(name: 'buyer_organization') final Organization? buyerOrganization; @override@JsonKey(name: 'buyer_organization') final Organization? buyerOrganization;
@override final String? status; @override final String? status;
@@ -271,16 +279,16 @@ Map<String, dynamic> toJson() {
@override @override
bool operator ==(Object other) { 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) @JsonKey(includeFromJson: false, includeToJson: false)
@override @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 @override
String toString() { 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; factory _$TenderDataCopyWith(_TenderData value, $Res Function(_TenderData) _then) = __$TenderDataCopyWithImpl;
@override @useResult @override @useResult
$Res call({ $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 /// Create a copy of TenderData
/// with the given fields replaced by the non-null parameter values. /// 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( return _then(_TenderData(
success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable success: freezed == success ? _self.success : success // ignore: cast_nullable_to_non_nullable
as bool?,message: freezed == message ? _self.message : message // 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?,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?,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 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 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?,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?,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 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 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 Organization?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
as String?, as String?,
@@ -10,6 +10,7 @@ _TenderData _$TenderDataFromJson(Map<String, dynamic> json) => _TenderData(
success: json['success'] as bool?, success: json['success'] as bool?,
message: json['message'] as String?, message: json['message'] as String?,
id: json['id'] as String?, id: json['id'] as String?,
tenderId: json['tender_id'] as String?,
noticePublicationId: json['notice_publication_id'] as String?, noticePublicationId: json['notice_publication_id'] as String?,
publicationDate: (json['publication_date'] as num?)?.toInt(), publicationDate: (json['publication_date'] as num?)?.toInt(),
title: json['title'] as String?, title: json['title'] as String?,
@@ -21,6 +22,9 @@ _TenderData _$TenderDataFromJson(Map<String, dynamic> json) => _TenderData(
duration: json['duration'] as String?, duration: json['duration'] as String?,
durationUnit: json['durationUnit'] as String?, durationUnit: json['durationUnit'] as String?,
tenderDeadline: (json['tender_deadline'] as num?)?.toInt(), 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?, countryCode: json['country_code'] as String?,
buyerOrganization: buyerOrganization:
json['buyer_organization'] == null json['buyer_organization'] == null
@@ -36,6 +40,7 @@ Map<String, dynamic> _$TenderDataToJson(_TenderData instance) =>
'success': instance.success, 'success': instance.success,
'message': instance.message, 'message': instance.message,
'id': instance.id, 'id': instance.id,
'tender_id': instance.tenderId,
'notice_publication_id': instance.noticePublicationId, 'notice_publication_id': instance.noticePublicationId,
'publication_date': instance.publicationDate, 'publication_date': instance.publicationDate,
'title': instance.title, 'title': instance.title,
@@ -47,6 +52,9 @@ Map<String, dynamic> _$TenderDataToJson(_TenderData instance) =>
'duration': instance.duration, 'duration': instance.duration,
'durationUnit': instance.durationUnit, 'durationUnit': instance.durationUnit,
'tender_deadline': instance.tenderDeadline, 'tender_deadline': instance.tenderDeadline,
'submission_deadline': instance.submissionDeadline,
'application_deadline': instance.applicationDeadline,
'submission_url': instance.submissionUrl,
'country_code': instance.countryCode, 'country_code': instance.countryCode,
'buyer_organization': instance.buyerOrganization, 'buyer_organization': instance.buyerOrganization,
'status': instance.status, 'status': instance.status,
+6 -3
View File
@@ -14,17 +14,20 @@ class YourTendersService {
Future<Result<TenderApprovalsResponse>> getApprovedTenders() async { Future<Result<TenderApprovalsResponse>> getApprovedTenders() async {
try { try {
final result = await _networkManager.makeRequest( final result = await _networkManager.makeRequest(
'/api/v1/tender-approvals?status=approved', '/api/v1/tender-approvals?status=submitted',
(json) => TenderApprovalsResponse.fromJson(json), (json) => TenderApprovalsResponse.fromJson(json),
method: 'GET', method: 'GET',
); );
return result; return result;
} on DioException catch (e) { } on DioException catch (e) {
appLogger.error('get approved tenders failed: $e'); appLogger.error('get submitted tenders failed: $e');
return Result.error(e); return Result.error(e);
} on Exception catch (e, stackTrace) { } 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)); return Result.error(Exception(e));
} }
} }
@@ -65,7 +65,7 @@ class TenderDetailViewModel with ChangeNotifier {
notifyListeners(); notifyListeners();
final result = await _tendersRepository.toggleApprovals( final result = await _tendersRepository.toggleApprovals(
tenderId: tenderId, tenderId: tenderId,
status: 'approved', status: 'submitted',
submissionMode: submissionMode, submissionMode: submissionMode,
); );
switch (result) { switch (result) {
@@ -27,17 +27,17 @@ class _TenderDetailDesktopPageState extends State<TenderDetailDesktopPage> {
void _viewModelListener() { void _viewModelListener() {
if (viewModel.status.isNotEmpty && if (viewModel.status.isNotEmpty &&
viewModel.status == 'approved' && viewModel.status == 'submitted' &&
viewModel.approvalStatus == true) { viewModel.approvalStatus == true) {
ScaffoldMessenger.of( ScaffoldMessenger.of(
context, context,
).showSnackBar(SnackBar(content: Text('tender approved successfully!'))); ).showSnackBar(SnackBar(content: Text('tender submitted successfully!')));
} }
if (viewModel.status.isNotEmpty && if (viewModel.status.isNotEmpty &&
viewModel.status == 'unapproved' && viewModel.status == 'unsubmitted' &&
viewModel.approvalStatus == true) { viewModel.approvalStatus == true) {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('tender approve removed sucessfully!')), SnackBar(content: Text('tender submitted removed sucessfully!')),
); );
} }
if (viewModel.status.isNotEmpty && if (viewModel.status.isNotEmpty &&
@@ -28,17 +28,17 @@ class _TenderDetailMobilePageState extends State<TenderDetailMobilePage> {
void _viewModelListener() { void _viewModelListener() {
if (viewModel.status.isNotEmpty && if (viewModel.status.isNotEmpty &&
viewModel.status == 'approved' && viewModel.status == 'submitted' &&
viewModel.approvalStatus == true) { viewModel.approvalStatus == true) {
ScaffoldMessenger.of( ScaffoldMessenger.of(
context, context,
).showSnackBar(SnackBar(content: Text('tender approved successfully!'))); ).showSnackBar(SnackBar(content: Text('tender submitted successfully!')));
} }
if (viewModel.status.isNotEmpty && if (viewModel.status.isNotEmpty &&
viewModel.status == 'unapproved' && viewModel.status == 'unsubmitted' &&
viewModel.approvalStatus == true) { viewModel.approvalStatus == true) {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('tender approve removed sucessfully!')), SnackBar(content: Text('tender submitted removed sucessfully!')),
); );
} }
if (viewModel.status.isNotEmpty && if (viewModel.status.isNotEmpty &&
@@ -29,17 +29,17 @@ class _TenderDetailTabletPageState extends State<TenderDetailTabletPage> {
void _viewModelListener() { void _viewModelListener() {
if (viewModel.status.isNotEmpty && if (viewModel.status.isNotEmpty &&
viewModel.status == 'approved' && viewModel.status == 'submitted' &&
viewModel.approvalStatus == true) { viewModel.approvalStatus == true) {
ScaffoldMessenger.of( ScaffoldMessenger.of(
context, context,
).showSnackBar(SnackBar(content: Text('tender approved successfully!'))); ).showSnackBar(SnackBar(content: Text('tender submitted successfully!')));
} }
if (viewModel.status.isNotEmpty && if (viewModel.status.isNotEmpty &&
viewModel.status == 'unapproved' && viewModel.status == 'unsubmitted' &&
viewModel.approvalStatus == true) { viewModel.approvalStatus == true) {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('tender approve removed sucessfully!')), SnackBar(content: Text('tender submitted removed sucessfully!')),
); );
} }
if (viewModel.status.isNotEmpty && if (viewModel.status.isNotEmpty &&
@@ -70,7 +70,7 @@ class TenderDetailActions extends StatelessWidget {
backgroundColor: AppColors.lightBlue, backgroundColor: AppColors.lightBlue,
textColor: AppColors.mainBlue, textColor: AppColors.mainBlue,
onPressed: () { onPressed: () {
if (viewModel.status == 'approved') { if (viewModel.status == 'submitted') {
viewModel.submitTenderApproval( viewModel.submitTenderApproval(
tenderId: detail.id!, tenderId: detail.id!,
submissionMode: 'self-apply', submissionMode: 'self-apply',
@@ -122,7 +122,7 @@ class TenderDetailActions extends StatelessWidget {
backgroundColor: AppColors.primary30, backgroundColor: AppColors.primary30,
textColor: AppColors.mainBlue, textColor: AppColors.mainBlue,
onPressed: () { onPressed: () {
if (viewModel.status == 'approved') { if (viewModel.status == 'submitted') {
viewModel.submitTenderApproval( viewModel.submitTenderApproval(
tenderId: detail.id!, tenderId: detail.id!,
submissionMode: 'self-apply', submissionMode: 'self-apply',
+29 -3
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tm_app/core/constants/strings.dart'; import 'package:tm_app/core/constants/strings.dart';
import 'package:tm_app/core/routes/app_routes.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/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/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/view_models/home_view_model.dart';
import 'package:tm_app/views/shared/desktop_navigation_widget.dart';
import '../widgets.dart'; import '../widgets.dart';
@@ -27,10 +29,31 @@ class DesktopHomePage extends StatelessWidget {
return Center(child: Text(homeViewModel.errorMessage!)); return Center(child: Text(homeViewModel.errorMessage!));
} }
return Center( 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( child: SizedBox(
width: 780, width: 780,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@@ -57,6 +80,9 @@ class DesktopHomePage extends StatelessWidget {
), ),
), ),
), ),
),
),
],
); );
}, },
), ),
@@ -117,7 +143,7 @@ class DesktopHomePage extends StatelessWidget {
iconPath: 'assets/icons/arrows.svg', iconPath: 'assets/icons/arrows.svg',
title: AppStrings.tenderSubmitted, title: AppStrings.tenderSubmitted,
amount: amount:
tenderApprovalsStateResponse.data!.approvedTenders.toString(), tenderApprovalsStateResponse.data!.submittedTenders.toString(),
// tenderApprovalsStateResponse // tenderApprovalsStateResponse
// .data! // .data!
// .approvalsBySubmission! // .approvalsBySubmission!
+1 -1
View File
@@ -117,7 +117,7 @@ class MobileHomePage extends StatelessWidget {
iconPath: AssetsManager.arrows, iconPath: AssetsManager.arrows,
title: AppStrings.tenderSubmitted, title: AppStrings.tenderSubmitted,
amount: amount:
tenderApprovalsStateResponse.data!.approvedTenders.toString(), tenderApprovalsStateResponse.data!.submittedTenders.toString(),
// tenderApprovalsStateResponse // tenderApprovalsStateResponse
// .data! // .data!
// .approvalsBySubmission! // .approvalsBySubmission!
+1 -1
View File
@@ -120,7 +120,7 @@ class TabletHomePage extends StatelessWidget {
iconPath: 'assets/icons/arrows.svg', iconPath: 'assets/icons/arrows.svg',
title: AppStrings.tenderSubmitted, title: AppStrings.tenderSubmitted,
amount: amount:
tenderApprovalsStateResponse.data!.approvedTenders.toString(), tenderApprovalsStateResponse.data!.submittedTenders.toString(),
// tenderApprovalsStateResponse // tenderApprovalsStateResponse
// .data! // .data!
// .approvalsBySubmission! // .approvalsBySubmission!
@@ -1,8 +1,8 @@
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tm_app/core/routes/app_routes.dart';
import 'package:tm_app/core/theme/colors.dart'; import 'package:tm_app/core/theme/colors.dart';
import '../../../core/constants/assets.dart'; import '../../../core/constants/assets.dart';
@@ -30,7 +30,7 @@ class _LoginDesktopPageState extends State<LoginDesktopPage> {
void _viewModelListener() { void _viewModelListener() {
if (viewModel.loggedInUser != null) { if (viewModel.loggedInUser != null) {
HomeRouteData().go(context); Router.neglect(context, () => context.go('/home'));
} else if (viewModel.errorMessage != null) { } else if (viewModel.errorMessage != null) {
ScaffoldMessenger.of( ScaffoldMessenger.of(
context, context,
+34 -5
View File
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tm_app/core/routes/app_routes.dart'; import 'package:tm_app/core/routes/app_routes.dart';
import 'package:tm_app/view_models/profile_view_model.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/constants/strings.dart';
import '../../../core/theme/colors.dart'; import '../../../core/theme/colors.dart';
import '../../../core/utils/size_config.dart'; import '../../../core/utils/size_config.dart';
import '../../shared/desktop_navigation_widget.dart';
import '../widgets/theme_toggle.dart'; import '../widgets/theme_toggle.dart';
import '../widgets/title_description.dart'; import '../widgets/title_description.dart';
@@ -63,10 +65,32 @@ class _DesktopProfilePageState extends State<DesktopProfilePage> {
return Center(child: Text(viewModel.errorMessage!)); return Center(child: Text(viewModel.errorMessage!));
} }
return Center( return Column(
child: SizedBox( 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, width: 740,
height: 662, // height: 662,
child: Column( child: Column(
children: [ children: [
SizedBox(height: 36.0.h()), SizedBox(height: 36.0.h()),
@@ -83,11 +107,15 @@ class _DesktopProfilePageState extends State<DesktopProfilePage> {
description: description:
viewModel.companyProfileData!.registrationNumber!, viewModel.companyProfileData!.registrationNumber!,
), ),
TitleDescription(title: 'Business Type', description: '-'), TitleDescription(
title: 'Business Type',
description: '-',
),
TitleDescription( TitleDescription(
title: 'Founded', title: 'Founded',
description: description:
viewModel.companyProfileData!.foundedYear!.toString(), viewModel.companyProfileData!.foundedYear!
.toString(),
), ),
SizedBox(height: 24.0.h()), SizedBox(height: 24.0.h()),
// Theme Toggle // Theme Toggle
@@ -158,6 +186,7 @@ class _DesktopProfilePageState extends State<DesktopProfilePage> {
], ],
), ),
), ),
],
); );
}, },
), ),
@@ -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,
),
),
],
),
),
);
}
}
+33 -2
View File
@@ -1,8 +1,11 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tm_app/core/theme/colors.dart'; import 'package:tm_app/core/theme/colors.dart';
import 'package:tm_app/core/utils/size_config.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/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'; import 'package:tm_app/views/tenders/widgets/main_tenders_slider.dart';
class DesktopTendersPage extends StatefulWidget { class DesktopTendersPage extends StatefulWidget {
@@ -51,7 +54,31 @@ class _DesktopTendersPageState extends State<DesktopTendersPage> {
return SafeArea( return SafeArea(
child: Scaffold( child: Scaffold(
backgroundColor: AppColors.backgroundColor, backgroundColor: AppColors.backgroundColor,
body: Center( 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;
}
},
),
Expanded(
child: Center(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Consumer<TendersViewModel>( child: Consumer<TendersViewModel>(
builder: (context, viewModel, child) { builder: (context, viewModel, child) {
@@ -71,7 +98,8 @@ class _DesktopTendersPageState extends State<DesktopTendersPage> {
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(vertical: 24.0.h()), padding: EdgeInsets.symmetric(vertical: 24.0.h()),
child: MainTendersSlider( child: MainTendersSlider(
tenders: viewModel.tendersResponse?.data?.tenders ?? [], tenders:
viewModel.tendersResponse?.data?.tenders ?? [],
isDesktop: true, isDesktop: true,
), ),
), ),
@@ -81,6 +109,9 @@ class _DesktopTendersPageState extends State<DesktopTendersPage> {
), ),
), ),
), ),
],
),
),
); );
} }
} }
@@ -104,7 +104,7 @@ class TenderActionButtonsRow extends StatelessWidget {
if (tender.id == null) return const SizedBox.shrink(); if (tender.id == null) return const SizedBox.shrink();
final approval = viewModel.getTenderApprovalForTender(tender.id!); final approval = viewModel.getTenderApprovalForTender(tender.id!);
final isApproved = approval?.status == 'approved'; final isApproved = approval?.status == 'submitted';
return Tooltip( return Tooltip(
message: AppStrings.submit, message: AppStrings.submit,
@@ -115,7 +115,7 @@ class TenderActionButtonsRow extends StatelessWidget {
viewModel.toggleApprovals( viewModel.toggleApprovals(
tenderId: tender.id!, tenderId: tender.id!,
submissionMode: approval?.submissionMode ?? 'self-apply', submissionMode: approval?.submissionMode ?? 'self-apply',
status: 'approved', status: 'submitted',
); );
} else { } else {
showModalBottomSheet( showModalBottomSheet(
@@ -127,7 +127,7 @@ class TenderActionButtonsRow extends StatelessWidget {
viewModel.toggleApprovals( viewModel.toggleApprovals(
tenderId: tender.id!, tenderId: tender.id!,
submissionMode: value, submissionMode: value,
status: 'approved', status: 'submitted',
); );
}, },
); );
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tm_app/core/constants/strings.dart'; import 'package:tm_app/core/constants/strings.dart';
import 'package:tm_app/core/theme/colors.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/tablet_desktop_appbar.dart';
import 'package:tm_app/views/your_tenders/widgets/tenders_submitted.dart'; import 'package:tm_app/views/your_tenders/widgets/tenders_submitted.dart';
import '../../shared/desktop_navigation_widget.dart';
class YourTendersDesktopPage extends StatefulWidget { class YourTendersDesktopPage extends StatefulWidget {
const YourTendersDesktopPage({super.key}); const YourTendersDesktopPage({super.key});
@@ -41,12 +44,34 @@ class _YourTendersDesktopPageState extends State<YourTendersDesktopPage>
child: Scaffold( child: Scaffold(
backgroundColor: AppColors.backgroundColor, backgroundColor: AppColors.backgroundColor,
body: Center( 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( child: SizedBox(
width: 740, width: 740,
child: Column( child: Column(
children: [ children: [
SizedBox(height: 128.0), SizedBox(height: 64.0),
TabletDesktopAppbar(), TabletDesktopAppbar(),
SizedBox(height: 20.0), SizedBox(height: 20.0),
MainTabBar( MainTabBar(
@@ -75,7 +100,9 @@ class _YourTendersDesktopPageState extends State<YourTendersDesktopPage>
controller: controller, controller: controller,
children: [ children: [
ApprovedTenders(tendersSubmitted: []), ApprovedTenders(tendersSubmitted: []),
TendersSubmitted(approvedTenders: viewModel.data!), TendersSubmitted(
approvedTenders: viewModel.data!,
),
], ],
); );
}, },
@@ -85,6 +112,8 @@ class _YourTendersDesktopPageState extends State<YourTendersDesktopPage>
), ),
), ),
), ),
],
),
), ),
); );
} }
@@ -13,7 +13,7 @@ class TendersSubmitted extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return approvedTenders.data == null return approvedTenders.data == null
? const Center(child: Text('No approved projects yet.')) ? const Center(child: Text('No submitted projects yet.'))
: ListView.builder( : ListView.builder(
padding: const EdgeInsets.only(top: 20), padding: const EdgeInsets.only(top: 20),
itemCount: approvedTenders.data!.length, itemCount: approvedTenders.data!.length,
@@ -31,31 +31,31 @@ class TendersSubmitted extends StatelessWidget {
backgroundColor: backgroundColor:
tender.status == 'Won' tender.status == 'Won'
? AppColors.green0 ? AppColors.green0
: tender.status == 'approved' : tender.status == 'submitted'
? AppColors.grey0 ? AppColors.grey0
: AppColors.red0.withValues(alpha: 0.2), : AppColors.red0.withValues(alpha: 0.2),
borderColor: borderColor:
tender.status == 'Won' tender.status == 'Won'
? AppColors.green10 ? AppColors.green10
: tender.status == 'approved' : tender.status == 'submitted'
? AppColors.grey30 ? AppColors.grey30
: AppColors.red0, : AppColors.red0,
statusIcon: statusIcon:
tender.status == 'Won' tender.status == 'Won'
? AssetsManager.tickCircle ? AssetsManager.tickCircle
: tender.status == 'approved' : tender.status == 'submitted'
? null ? null
: AssetsManager.closeCircle, : AssetsManager.closeCircle,
statusCardColor: statusCardColor:
tender.status == 'Won' tender.status == 'Won'
? AppColors.green20 ? AppColors.green20
: tender.status == 'approved' : tender.status == 'submitted'
? AppColors.green20 ? AppColors.green20
: AppColors.red0, : AppColors.red0,
statusTextColor: statusTextColor:
tender.status == 'Won' tender.status == 'Won'
? AppColors.green30 ? AppColors.green30
: tender.status == 'approved' : tender.status == 'submitted'
? AppColors.green30 ? AppColors.green30
: AppColors.red10, : AppColors.red10,
); );