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,14 +8,12 @@ import 'package:tm_app/views/detail/strings/tender_details_strings.dart';
|
||||
import 'package:tm_app/views/detail/widgets/deadline_item.dart';
|
||||
import 'package:tm_app/views/detail/widgets/info_item.dart';
|
||||
|
||||
// AI-NOTE (for PR reviewer): This widget was rewritten to render ONLY the
|
||||
// backend-driven fields requested for the tender-details page (notice type,
|
||||
// form type, languages, issue/publication dates, procedure, value, duration,
|
||||
// deadlines, buyer org/address, lots, status, ids). Design is unchanged — it
|
||||
// still uses InfoItem/DeadlineItem. The _infoItem() helper returns an empty
|
||||
// list when a value is null/blank so empty fields don't render as blank rows
|
||||
// (this is why each entry is spread with `...`). The old hard-coded
|
||||
// "Reference Number" row was dropped because it isn't in the requested set.
|
||||
// Renders only the backend-driven fields for the tender-details page (notice
|
||||
// type, form type, languages, issue/publication dates, procedure, value,
|
||||
// duration, deadlines, buyer org/address, lots, status, ids), using
|
||||
// InfoItem/DeadlineItem. The _infoItem() helper returns an empty list when a
|
||||
// value is null/blank so empty fields don't render as blank rows (this is why
|
||||
// each entry is spread with `...`).
|
||||
class TenderDetailInfoSection extends StatelessWidget {
|
||||
final bool isScreenBig;
|
||||
final TenderData detail;
|
||||
@@ -112,8 +110,8 @@ class TenderDetailInfoSection extends StatelessWidget {
|
||||
SizedBox(height: 8.0.h()),
|
||||
for (final lot in lots) ...[
|
||||
..._infoItem(TenderDetailsStrings.lotId, lot.lotId),
|
||||
..._infoItem('Title', lot.title),
|
||||
..._infoItem('Description', lot.description),
|
||||
..._infoItem(TenderDetailsStrings.lotTitle, lot.title),
|
||||
..._infoItem(TenderDetailsStrings.lotDescription, lot.description),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user