Refactor tender detail models and UI components for improved clarity and functionality
- Updated the `Lot`, `Organization`, and `OrganizationAddress` models to enhance data mapping for tender details. - Revised the `TenderData` model to include additional fields reflecting the API response structure. - Improved UI components across desktop, mobile, and tablet views by commenting out unused sections for future use. - Added new string constants for lot details in the tender information section. - Enhanced unit tests to cover new model fields and ensure resilience to partial API payloads.
This commit is contained in:
@@ -8,11 +8,6 @@ import '../../../core/constants/assets.dart';
|
||||
import '../../../core/theme/colors.dart';
|
||||
import '../../../core/utils/date_utils.dart';
|
||||
import '../../../core/utils/size_config.dart';
|
||||
// AI-NOTE (for PR reviewer): Import kept (commented) because the match-percentage
|
||||
// section it feeds (TenderDetailsStrings.tenderMatchProfile) is disabled, not
|
||||
// removed. Re-enable alongside _matchPercentage()/_progressBar() below when the
|
||||
// "match with profile" value comes from the backend.
|
||||
// import '../../detail/strings/tender_details_strings.dart';
|
||||
import '../../shared/flag.dart';
|
||||
import '../strings/tenders_strings.dart';
|
||||
import 'tender_action_buttons_row.dart';
|
||||
@@ -87,18 +82,6 @@ class TenderCard extends StatelessWidget {
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
// AI-NOTE (for PR reviewer): The "Match with your profile"
|
||||
// label, the 45% value and the progress bar are disabled on
|
||||
// purpose (kept for future use). They show a hard-coded 45%,
|
||||
// not a backend value, so they are commented out, not deleted.
|
||||
// // Match percentage
|
||||
// _matchPercentage(),
|
||||
// SizedBox(height: isDesktop ? 4.0.h() : 8.0.h()),
|
||||
//
|
||||
// // Progress bar
|
||||
// _progressBar(),
|
||||
// SizedBox(height: isDesktop ? 8.0.h() : 16.0.h()),
|
||||
|
||||
// Location and apply button
|
||||
Row(
|
||||
children: [
|
||||
@@ -251,57 +234,6 @@ class TenderCard extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
// AI-NOTE (for PR reviewer): _matchPercentage() and _progressBar() are
|
||||
// preserved as commented-out code. Both render a hard-coded 45% placeholder
|
||||
// (no backend source yet), so they are disabled rather than removed. Keep them
|
||||
// for when the profile-match score becomes available from the API.
|
||||
/*
|
||||
Widget _matchPercentage() {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
TenderDetailsStrings.tenderMatchProfile,
|
||||
style: TextStyle(
|
||||
color: AppColors.grey80,
|
||||
fontSize: isDesktop ? 12.0.sp() : 14.0.sp(),
|
||||
fontWeight: isDesktop ? FontWeight.w400 : FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${45}%',
|
||||
style: TextStyle(
|
||||
color: AppColors.secondaryTextColor,
|
||||
fontSize: isDesktop ? 12.0.sp() : 16.0.sp(),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _progressBar() {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
height: 4.0.h(),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.grey20,
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
),
|
||||
child: FractionallySizedBox(
|
||||
alignment: Alignment.centerLeft,
|
||||
widthFactor: (45) / 100,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.secondary50,
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
*/
|
||||
|
||||
Widget _locationInfo() {
|
||||
return Expanded(
|
||||
child: Row(
|
||||
|
||||
Reference in New Issue
Block a user