From c401c6c8d97e18df6d565d90c5e86ce9e6107f68 Mon Sep 17 00:00:00 2001 From: amirrezaghabeli Date: Wed, 27 Aug 2025 13:33:47 +0330 Subject: [PATCH] handle null error in profile --- lib/core/constants/strings.dart | 3 +++ lib/views/profile/pages/m_profile_page.dart | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/lib/core/constants/strings.dart b/lib/core/constants/strings.dart index 3a2b088..f1013a7 100644 --- a/lib/core/constants/strings.dart +++ b/lib/core/constants/strings.dart @@ -1,5 +1,8 @@ class AppStrings { AppStrings._(); + + static const String noData = 'No data'; + // App Titles static const String appName = 'My Awesome App'; static const String loginTitle = 'Welcome Back'; diff --git a/lib/views/profile/pages/m_profile_page.dart b/lib/views/profile/pages/m_profile_page.dart index 5cae8c6..9da448c 100644 --- a/lib/views/profile/pages/m_profile_page.dart +++ b/lib/views/profile/pages/m_profile_page.dart @@ -65,6 +65,10 @@ class _MobileProfilePageState extends State { return Center(child: Text(viewModel.errorMessage!)); } + if (viewModel.companyProfileData == null) { + return Center(child: Text(AppStrings.noData)); + } + return Padding( padding: EdgeInsets.symmetric( horizontal: 24.0.w(),