fixed update tender intenders after in details updated and web issues inmobile and tablet

This commit is contained in:
amirrezaghabeli
2025-08-30 09:16:21 +03:30
parent f4d5d16959
commit f868dc7659
6 changed files with 150 additions and 116 deletions
+43 -31
View File
@@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:tm_app/core/constants/strings.dart';
@@ -73,42 +74,53 @@ class _TenderDetailMobilePageState extends State<TenderDetailMobilePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.backgroundColor,
appBar: appBar(context: context, title: AppStrings.tenderDetailTitle),
body: Consumer<TenderDetailViewModel>(
builder: (context, tenderViewModel, child) {
if (tenderViewModel.isLoading) {
return const Center(
child: CircularProgressIndicator(color: AppColors.secondary50),
return PopScope(
onPopInvokedWithResult: (didPop, result) {
if (kIsWeb) {
WidgetsBinding.instance.addPostFrameCallback((_) {
context.read<TenderDetailViewModel>().updateTenderApprovals(
widget.tenderId,
);
}
});
}
},
child: Scaffold(
backgroundColor: AppColors.backgroundColor,
appBar: appBar(context: context, title: AppStrings.tenderDetailTitle),
body: Consumer<TenderDetailViewModel>(
builder: (context, tenderViewModel, child) {
if (tenderViewModel.isLoading) {
return const Center(
child: CircularProgressIndicator(color: AppColors.secondary50),
);
}
if (tenderViewModel.errorMessage != null) {
return Center(child: Text(tenderViewModel.errorMessage!));
}
if (tenderViewModel.errorMessage != null) {
return Center(child: Text(tenderViewModel.errorMessage!));
}
final detail = tenderViewModel.tenderDetail;
if (detail == null) {
return const Center(child: Text(AppStrings.tenderNoData));
}
final detail = tenderViewModel.tenderDetail;
if (detail == null) {
return const Center(child: Text(AppStrings.tenderNoData));
}
return SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TenderDetailHeader(isScreenBig: false, detail: detail),
SizedBox(height: 24.0.h()),
TenderDetailCard(detail: detail),
SizedBox(height: 24.0.h()),
TenderDetailActions(isScreenBig: false, detail: detail),
],
return SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TenderDetailHeader(isScreenBig: false, detail: detail),
SizedBox(height: 24.0.h()),
TenderDetailCard(detail: detail),
SizedBox(height: 24.0.h()),
TenderDetailActions(isScreenBig: false, detail: detail),
],
),
),
),
);
},
);
},
),
),
);
}