fixed load again
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'package:tm_app/core/routes/app_shell/desktop_shell_page.dart';
|
import 'package:tm_app/core/routes/app_shell/desktop_shell_page.dart';
|
||||||
import 'package:tm_app/core/routes/app_shell/mobile_shell_page.dart';
|
import 'package:tm_app/core/routes/app_shell/mobile_shell_page.dart';
|
||||||
import 'package:tm_app/core/routes/app_shell/tablet_shell_page.dart';
|
import 'package:tm_app/core/routes/app_shell/tablet_shell_page.dart';
|
||||||
|
import 'package:tm_app/view_models/home_view_model.dart';
|
||||||
import 'package:tm_app/views/shared/responsive_builder.dart';
|
import 'package:tm_app/views/shared/responsive_builder.dart';
|
||||||
|
|
||||||
class AppShellScreen extends StatelessWidget {
|
class AppShellScreen extends StatelessWidget {
|
||||||
@@ -10,11 +12,12 @@ class AppShellScreen extends StatelessWidget {
|
|||||||
|
|
||||||
final StatefulNavigationShell navigationShell;
|
final StatefulNavigationShell navigationShell;
|
||||||
|
|
||||||
void _gotoBranch(int index) {
|
void _gotoBranch(int index, BuildContext context) {
|
||||||
navigationShell.goBranch(
|
navigationShell.goBranch(
|
||||||
index,
|
index,
|
||||||
initialLocation: index == navigationShell.currentIndex,
|
initialLocation: index == navigationShell.currentIndex,
|
||||||
);
|
);
|
||||||
|
context.read<HomeViewModel>().init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -22,15 +25,15 @@ class AppShellScreen extends StatelessWidget {
|
|||||||
return ResponsiveBuilder(
|
return ResponsiveBuilder(
|
||||||
mobile: MobileShellPage(
|
mobile: MobileShellPage(
|
||||||
navigationShell: navigationShell,
|
navigationShell: navigationShell,
|
||||||
onTap: _gotoBranch,
|
onTap: (value) => _gotoBranch(value, context),
|
||||||
),
|
),
|
||||||
tablet: TabletShellPage(
|
tablet: TabletShellPage(
|
||||||
navigationShell: navigationShell,
|
navigationShell: navigationShell,
|
||||||
onTap: _gotoBranch,
|
onTap: (value) => _gotoBranch(value, context),
|
||||||
),
|
),
|
||||||
desktop: DesktopShellPage(
|
desktop: DesktopShellPage(
|
||||||
navigationShell: navigationShell,
|
navigationShell: navigationShell,
|
||||||
onTap: _gotoBranch,
|
onTap: (value) => _gotoBranch(value, context),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -231,6 +231,9 @@ class TendersViewModel with ChangeNotifier {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Error<TenderApprovalsByIdResponse>():
|
case Error<TenderApprovalsByIdResponse>():
|
||||||
|
// Remove the tender from tenderApprovals if an error occurs for this tenderId
|
||||||
|
|
||||||
|
tenderApprovals.removeWhere((a) => a.tenderId == tenderId);
|
||||||
_errorMessage = result.error.toString();
|
_errorMessage = result.error.toString();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class _ProgressBarColumnState extends State<ProgressBarColumn>
|
|||||||
Widget _centerText() {
|
Widget _centerText() {
|
||||||
return Center(
|
return Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'${widget.amount}%',
|
'${double.parse(widget.amount).round()}%',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24.0.sp(),
|
fontSize: 24.0.sp(),
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:country_flags/country_flags.dart';
|
import 'package:country_flags/country_flags.dart';
|
||||||
import 'package:flutter/material.dart' hide DateUtils;
|
import 'package:flutter/material.dart' hide DateUtils;
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.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';
|
||||||
import 'package:tm_app/data/services/model/tender_data/tender_data.dart';
|
import 'package:tm_app/data/services/model/tender_data/tender_data.dart';
|
||||||
@@ -9,6 +10,7 @@ import '../../../core/constants/assets.dart';
|
|||||||
import '../../../core/theme/colors.dart';
|
import '../../../core/theme/colors.dart';
|
||||||
import '../../../core/utils/date_utils.dart';
|
import '../../../core/utils/date_utils.dart';
|
||||||
import '../../../core/utils/size_config.dart';
|
import '../../../core/utils/size_config.dart';
|
||||||
|
import '../../../view_models/tenders_view_model.dart';
|
||||||
import 'tender_action_buttons_row.dart';
|
import 'tender_action_buttons_row.dart';
|
||||||
|
|
||||||
class TenderCard extends StatelessWidget {
|
class TenderCard extends StatelessWidget {
|
||||||
@@ -319,7 +321,13 @@ class TenderCard extends StatelessWidget {
|
|||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (tender.id != null) {
|
if (tender.id != null) {
|
||||||
TenderDetailRouteData(tenderId: tender.id!).push(context);
|
TenderDetailRouteData(tenderId: tender.id!).push(context).then((
|
||||||
|
value,
|
||||||
|
) {
|
||||||
|
if (context.mounted) {
|
||||||
|
context.read<TendersViewModel>().getTenderApprovals(tender.id!);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|||||||
Reference in New Issue
Block a user