diff --git a/lib/new_views/pages/land_page/dashboard_page.dart b/lib/new_views/pages/land_page/dashboard_page.dart index 8368265d..c856f5d7 100644 --- a/lib/new_views/pages/land_page/dashboard_page.dart +++ b/lib/new_views/pages/land_page/dashboard_page.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:test_sa/controllers/providers/api/all_requests_provider.dart'; +import 'package:test_sa/controllers/providers/api/user_provider.dart'; import 'package:test_sa/extensions/context_extension.dart'; import 'package:test_sa/extensions/int_extensions.dart'; import 'package:test_sa/extensions/text_extensions.dart'; @@ -36,6 +37,7 @@ class _DashboardPageState extends State { @override Widget build(BuildContext context) { + final user = Provider.of(context, listen: false).user; return Scaffold( appBar: AppBar( automaticallyImplyLeading: false, @@ -98,7 +100,7 @@ class _DashboardPageState extends State { style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral20), ), Text( - "Eng Mahmoud", + user.username ?? "Eng Mahmoud", style: AppTextStyles.heading2.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50, fontWeight: FontWeight.w600), ), 24.height, diff --git a/lib/views/pages/user/requests/work_order/work_orders_list_page.dart b/lib/views/pages/user/requests/work_order/work_orders_list_page.dart index 334f8cc9..0425d7ad 100644 --- a/lib/views/pages/user/requests/work_order/work_orders_list_page.dart +++ b/lib/views/pages/user/requests/work_order/work_orders_list_page.dart @@ -37,10 +37,10 @@ class WorkOrderListPage extends StatelessWidget { } print("serviceRequest.statusValue:${serviceRequest.statusValue}"); return Scaffold( - appBar: DefaultAppBar(title: context.translation.workOrders), - //backgroundColor: const Color(0xfff8f9fb), - body: SafeArea( - child: FutureBuilder( + appBar: DefaultAppBar(title: context.translation.workOrders), + //backgroundColor: const Color(0xfff8f9fb), + body: SafeArea( + child: FutureBuilder( future: serviceRequestsProvider.searchWorkOrders(callId: serviceRequest.requestCode), builder: (context, snap) { workOrders = snap.data as List; @@ -72,7 +72,7 @@ class WorkOrderListPage extends StatelessWidget { children: [ StatusLabel(label: workOrders[index].currentSituation.name, textColor: AppColor.orange60, backgroundColor: AppColor.orange40), 8.height, - Text(serviceRequest.requestCode, style: AppTextStyles.heading5.copyWith(color: context.isDark?AppColor.neutral30:const Color(0xFF3B3D4A))), + Text(serviceRequest.requestCode, style: AppTextStyles.heading5.copyWith(color: context.isDark ? AppColor.neutral30 : const Color(0xFF3B3D4A))), ], ).expanded, if (_userProvider.user.type == UsersTypes.engineer && serviceRequest.statusValue != 5 && serviceRequest.statusValue != 3) @@ -93,15 +93,16 @@ class WorkOrderListPage extends StatelessWidget { children: [ Text( '${context.translation.assetName}: ${workOrders[index].callRequest.asset.modelDefinition.assetName}', - style: AppTextStyles.bodyText.copyWith(color: context.isDark?AppColor.neutral10:const Color(0xFF757575)), + style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : const Color(0xFF757575)), ), Text( '${context.translation.status}: ${workOrders[index].currentSituation.name}', - style: AppTextStyles.bodyText.copyWith(color: context.isDark?AppColor.neutral10:const Color(0xFF757575)), + style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : const Color(0xFF757575)), ), ], ).expanded, - Text(workOrders[index].visitDate?.toServiceRequestCardFormat ?? "", textAlign: TextAlign.end, style: AppTextStyles.tinyFont.copyWith(color: context.isDark?AppColor.neutral30:const Color(0xFF3B3D4A))), + Text(workOrders[index].visitDate?.toServiceRequestCardFormat ?? "", + textAlign: TextAlign.end, style: AppTextStyles.tinyFont.copyWith(color: context.isDark ? AppColor.neutral30 : const Color(0xFF3B3D4A))), ], ), 16.height, @@ -122,7 +123,7 @@ class WorkOrderListPage extends StatelessWidget { ); }), ], - ).paddingAll(16).onPress(() { + ).onPress(() { // onPressed(request); }), ], @@ -140,6 +141,8 @@ class WorkOrderListPage extends StatelessWidget { ], ); }, - ))); + ), + ), + ); } }