fixed update tender intenders after in details updated and web issues inmobile and tablet
This commit is contained in:
@@ -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),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user