diff --git a/analysis_options.yaml b/analysis_options.yaml index 650dc2d..eda19cf 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -15,7 +15,6 @@ linter: # always_use_package_imports: true avoid_annotating_with_dynamic: true avoid_bool_literals_in_conditional_expressions: true - avoid_catches_without_on_clauses: true avoid_catching_errors: true avoid_final_parameters: true avoid_function_literals_in_foreach_calls: true diff --git a/lib/core/routes/app_routes.dart b/lib/core/routes/app_routes.dart index 9089cfa..69d63be 100644 --- a/lib/core/routes/app_routes.dart +++ b/lib/core/routes/app_routes.dart @@ -197,13 +197,16 @@ class LikedTendersRouteData extends GoRouteData with _$LikedTendersRouteData { } } -@TypedGoRoute(path: '/completion-of-documents') -class CompletionOfDocumentsMobileRouteData extends GoRouteData with _$CompletionOfDocumentsMobileRouteData { +@TypedGoRoute( + path: '/completion-of-documents', +) +class CompletionOfDocumentsMobileRouteData extends GoRouteData + with _$CompletionOfDocumentsMobileRouteData { const CompletionOfDocumentsMobileRouteData(); @override Widget build(BuildContext context, GoRouterState state) { - return CompletionOfDocumentsMobilePage(); + return const CompletionOfDocumentsMobilePage(); } } diff --git a/lib/core/theme/colors.dart b/lib/core/theme/colors.dart index 77265b4..d182d1b 100644 --- a/lib/core/theme/colors.dart +++ b/lib/core/theme/colors.dart @@ -114,7 +114,9 @@ class AppColors { : const Color(0xFFFFF2DE); static Color get orange0 => - _isDarkMode ? const Color(0xFF8379694D) : const Color(0xFFFEFBF8); + _isDarkMode + ? const Color.fromRGBO(50, 48, 48, 0.85) + : const Color(0xFFFEFBF8); static Color get white => _isDarkMode ? const Color(0xFFFFFFFF) : const Color(0xFFFFFFFF); diff --git a/lib/main.dart b/lib/main.dart index 71f98bb..f6082e0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -65,7 +65,7 @@ class _MyAppState extends State { return MaterialApp.router( title: 'OppLens', debugShowCheckedModeBanner: false, - scrollBehavior: MaterialScrollBehavior().copyWith( + scrollBehavior: const MaterialScrollBehavior().copyWith( dragDevices: { PointerDeviceKind.mouse, PointerDeviceKind.touch, diff --git a/lib/views/completion_of_documents/pages/m_completion_of_documents_page.dart b/lib/views/completion_of_documents/pages/m_completion_of_documents_page.dart index 6c1f4a2..96cef20 100644 --- a/lib/views/completion_of_documents/pages/m_completion_of_documents_page.dart +++ b/lib/views/completion_of_documents/pages/m_completion_of_documents_page.dart @@ -79,7 +79,7 @@ class CompletionOfDocumentsMobilePage extends StatelessWidget { fontWeight: FontWeight.w400, ), ), - Spacer(), + const Spacer(), Text( '75%', style: TextStyle( @@ -96,7 +96,7 @@ class CompletionOfDocumentsMobilePage extends StatelessWidget { Expanded( child: LinearProgressIndicator( value: 0.75, - backgroundColor: Color(0xFFE0E0E0), + backgroundColor: const Color(0xFFE0E0E0), color: AppColors.cyanTeal, minHeight: 6, borderRadius: BorderRadius.circular(10), @@ -199,7 +199,7 @@ class CompletionOfDocumentsMobilePage extends StatelessWidget { SizedBox(height: 16.0.h()), Container( - padding: EdgeInsets.all(12), + padding: const EdgeInsets.all(12), height: 100.0.h(), decoration: BoxDecoration( border: Border.all(color: AppColors.borderColor), @@ -208,7 +208,7 @@ class CompletionOfDocumentsMobilePage extends StatelessWidget { ), child: TextField( maxLines: null, - decoration: InputDecoration.collapsed( + decoration: const InputDecoration.collapsed( hintText: CompletionOfDocumentsStrings.note, ), style: TextStyle( @@ -247,7 +247,7 @@ class CompletionOfDocumentsMobilePage extends StatelessWidget { return Container( width: double.infinity, margin: EdgeInsets.only(bottom: 12.0.h()), - padding: EdgeInsets.all(12), + padding: const EdgeInsets.all(12), decoration: BoxDecoration( color: backgroundColor, border: Border( @@ -260,9 +260,9 @@ class CompletionOfDocumentsMobilePage extends StatelessWidget { Row( children: [ if (tag != null) ...[ - Spacer(), + const Spacer(), Container( - margin: EdgeInsets.only(right: 8), + margin: const EdgeInsets.only(right: 8), height: 32.0.h(), width: 91.0.w(), decoration: BoxDecoration( @@ -281,7 +281,7 @@ class CompletionOfDocumentsMobilePage extends StatelessWidget { ), ), ], - if (tag == null) Spacer(), + if (tag == null) const Spacer(), Container( height: 32.0.h(), width: 91.0.w(), diff --git a/lib/views/detail/pages/detail_desktop_page.dart b/lib/views/detail/pages/detail_desktop_page.dart index c9e2d90..dd7dfa1 100644 --- a/lib/views/detail/pages/detail_desktop_page.dart +++ b/lib/views/detail/pages/detail_desktop_page.dart @@ -105,7 +105,7 @@ class _TenderDetailDesktopPageState extends State { return Column( children: [ - DesktopNavigationWidget( + const DesktopNavigationWidget( currentIndex: 1, // Home index ), Expanded( diff --git a/lib/views/detail/pages/detail_tablet_page.dart b/lib/views/detail/pages/detail_tablet_page.dart index 5299eba..a57b9b1 100644 --- a/lib/views/detail/pages/detail_tablet_page.dart +++ b/lib/views/detail/pages/detail_tablet_page.dart @@ -94,7 +94,7 @@ class _TenderDetailTabletPageState extends State { key: key, ), - drawer: TabletNavigationWidget( + drawer: const TabletNavigationWidget( currentIndex: 1, // Home is index 0 ), body: Consumer( diff --git a/lib/views/detail/widgets/deadline_item.dart b/lib/views/detail/widgets/deadline_item.dart index 55eda72..6845a54 100644 --- a/lib/views/detail/widgets/deadline_item.dart +++ b/lib/views/detail/widgets/deadline_item.dart @@ -21,7 +21,7 @@ class DeadlineItem extends StatelessWidget { Widget build(BuildContext context) { return isScreenBig ? Padding( - padding: EdgeInsets.symmetric(vertical: 0), + padding: const EdgeInsets.symmetric(vertical: 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -101,7 +101,7 @@ class DeadlineItem extends StatelessWidget { ), ) : Padding( - padding: EdgeInsets.symmetric(vertical: 0), + padding: const EdgeInsets.symmetric(vertical: 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/views/detail/widgets/select_meeting_time_bottom_sheet.dart b/lib/views/detail/widgets/select_meeting_time_bottom_sheet.dart index 5b0e7f4..e5c3394 100644 --- a/lib/views/detail/widgets/select_meeting_time_bottom_sheet.dart +++ b/lib/views/detail/widgets/select_meeting_time_bottom_sheet.dart @@ -35,7 +35,7 @@ class _SelectMeetingTimeBottomSheetState padding: EdgeInsets.fromLTRB(24.0.w(), 24.0.h(), 24.0.w(), 33.0.h()), decoration: BoxDecoration( color: AppColors.backgroundColor, - borderRadius: BorderRadius.only( + borderRadius: const BorderRadius.only( topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0), ), @@ -76,7 +76,7 @@ class _SelectMeetingTimeBottomSheetState SizedBox(height: 8.0.h()), InkWell( onTap: () { - CompletionOfDocumentsMobileRouteData().push(context); + const CompletionOfDocumentsMobileRouteData().push(context); //context.pop(); }, child: Container( @@ -131,7 +131,7 @@ class _SelectMeetingTimeBottomSheetState horizontal: 10.0.w(), vertical: 10.0.h(), ), - padding: EdgeInsets.all(3), + padding: const EdgeInsets.all(3), decoration: BoxDecoration( shape: BoxShape.circle, border: Border.all( @@ -158,7 +158,7 @@ class _SelectMeetingTimeBottomSheetState color: AppColors.grey80, ), ), - Spacer(), + const Spacer(), Text( time, style: TextStyle( diff --git a/lib/views/detail/widgets/tender_detail_action.dart b/lib/views/detail/widgets/tender_detail_action.dart index 33793c5..7e1c3ea 100644 --- a/lib/views/detail/widgets/tender_detail_action.dart +++ b/lib/views/detail/widgets/tender_detail_action.dart @@ -38,7 +38,7 @@ class TenderDetailActions extends StatelessWidget { color: AppColors.primary30, borderRadius: BorderRadius.circular(100.0), ), - child: Center( + child: const Center( child: CircularProgressIndicator( color: AppColors.mainBlue, ), @@ -119,7 +119,7 @@ class TenderDetailActions extends StatelessWidget { Row _webActions() { return Row( children: [ - Spacer(), + const Spacer(), Consumer( builder: (context, viewModel, child) { return viewModel.isRejectApprovalLoading diff --git a/lib/views/detail/widgets/tender_detail_card.dart b/lib/views/detail/widgets/tender_detail_card.dart index 0e5f118..b94b65b 100644 --- a/lib/views/detail/widgets/tender_detail_card.dart +++ b/lib/views/detail/widgets/tender_detail_card.dart @@ -49,7 +49,9 @@ class TenderDetailCard extends StatelessWidget { child: LinearProgressIndicator( value: 0.75, backgroundColor: AppColors.grey20, - valueColor: AlwaysStoppedAnimation(AppColors.jellyBean), + valueColor: const AlwaysStoppedAnimation( + AppColors.jellyBean, + ), minHeight: 6.0.h(), ), ), diff --git a/lib/views/forget_password_create/pages/d_forget_password_create_page.dart b/lib/views/forget_password_create/pages/d_forget_password_create_page.dart index 2a81b49..4598a41 100644 --- a/lib/views/forget_password_create/pages/d_forget_password_create_page.dart +++ b/lib/views/forget_password_create/pages/d_forget_password_create_page.dart @@ -118,7 +118,7 @@ class DesktopForgotPasswordCreatePage extends StatelessWidget { ), SizedBox(height: 80.0.h()), viewModel.isLoading - ? BaseButton( + ? const BaseButton( isEnabled: false, text: ForgotPasswordCreateStrings.resetLink, onPressed: null, diff --git a/lib/views/forget_password_create/pages/forgot_password_create_screen.dart b/lib/views/forget_password_create/pages/forgot_password_create_screen.dart index 05523e9..301f9a8 100644 --- a/lib/views/forget_password_create/pages/forgot_password_create_screen.dart +++ b/lib/views/forget_password_create/pages/forgot_password_create_screen.dart @@ -10,7 +10,7 @@ class ForgotPasswordCreateScreen extends StatelessWidget { @override Widget build(BuildContext context) { - return ResponsiveBuilder( + return const ResponsiveBuilder( mobile: MobileForgotPasswordCreatePage(), tablet: TabletForgotPasswordCreatePage(), desktop: DesktopForgotPasswordCreatePage(), diff --git a/lib/views/forget_password_create/pages/m_forget_password_create_page.dart b/lib/views/forget_password_create/pages/m_forget_password_create_page.dart index 2c904ff..8495e3b 100644 --- a/lib/views/forget_password_create/pages/m_forget_password_create_page.dart +++ b/lib/views/forget_password_create/pages/m_forget_password_create_page.dart @@ -115,7 +115,7 @@ class MobileForgotPasswordCreatePage extends StatelessWidget { ), SizedBox(height: 80.0.h()), viewModel.isLoading - ? BaseButton( + ? const BaseButton( isEnabled: false, text: ForgotPasswordCreateStrings.resetLink, onPressed: null, diff --git a/lib/views/forget_password_create/pages/t_forget_password_create_page.dart b/lib/views/forget_password_create/pages/t_forget_password_create_page.dart index 121b6e4..597c595 100644 --- a/lib/views/forget_password_create/pages/t_forget_password_create_page.dart +++ b/lib/views/forget_password_create/pages/t_forget_password_create_page.dart @@ -118,7 +118,7 @@ class TabletForgotPasswordCreatePage extends StatelessWidget { ), SizedBox(height: 80.0.h()), viewModel.isLoading - ? BaseButton( + ? const BaseButton( isEnabled: false, text: ForgotPasswordCreateStrings.resetLink, onPressed: null, diff --git a/lib/views/forget_password_otp.dart/pages/d_forget_password_otp.dart_page.dart b/lib/views/forget_password_otp.dart/pages/d_forget_password_otp.dart_page.dart index 91ddc05..1ff166c 100644 --- a/lib/views/forget_password_otp.dart/pages/d_forget_password_otp.dart_page.dart +++ b/lib/views/forget_password_otp.dart/pages/d_forget_password_otp.dart_page.dart @@ -82,7 +82,7 @@ class DesktopForgotPasswordOtpPage extends StatelessWidget { ), SizedBox(height: 24.0.h()), viewModel.isLoading - ? BaseButton( + ? const BaseButton( isEnabled: false, text: ForgotPasswordOtpStrings.resetLink, onPressed: null, @@ -105,7 +105,7 @@ class DesktopForgotPasswordOtpPage extends StatelessWidget { } : null, ), - SizedBox(height: 12.0), + const SizedBox(height: 12.0), TextButton( onPressed: () { diff --git a/lib/views/forget_password_otp.dart/pages/forgot_password_otp_screen.dart b/lib/views/forget_password_otp.dart/pages/forgot_password_otp_screen.dart index 24e9c6d..fdb4b91 100644 --- a/lib/views/forget_password_otp.dart/pages/forgot_password_otp_screen.dart +++ b/lib/views/forget_password_otp.dart/pages/forgot_password_otp_screen.dart @@ -10,7 +10,7 @@ class ForgotPasswordOtpScreen extends StatelessWidget { @override Widget build(BuildContext context) { - return ResponsiveBuilder( + return const ResponsiveBuilder( mobile: MobileForgotPasswordOtpPage(), tablet: TabletForgotPasswordOtpPage(), desktop: DesktopForgotPasswordOtpPage(), diff --git a/lib/views/forget_password_otp.dart/pages/m_forget_password_otp.dart_page.dart b/lib/views/forget_password_otp.dart/pages/m_forget_password_otp.dart_page.dart index d26e9ad..964a5f3 100644 --- a/lib/views/forget_password_otp.dart/pages/m_forget_password_otp.dart_page.dart +++ b/lib/views/forget_password_otp.dart/pages/m_forget_password_otp.dart_page.dart @@ -78,7 +78,7 @@ class MobileForgotPasswordOtpPage extends StatelessWidget { ), SizedBox(height: 24.0.h()), viewModel.isLoading - ? BaseButton( + ? const BaseButton( isEnabled: false, text: ForgotPasswordOtpStrings.resetLink, onPressed: null, diff --git a/lib/views/forget_password_otp.dart/pages/t_forget_password_otp.dart_page.dart b/lib/views/forget_password_otp.dart/pages/t_forget_password_otp.dart_page.dart index 57714d4..7e503ac 100644 --- a/lib/views/forget_password_otp.dart/pages/t_forget_password_otp.dart_page.dart +++ b/lib/views/forget_password_otp.dart/pages/t_forget_password_otp.dart_page.dart @@ -82,7 +82,7 @@ class TabletForgotPasswordOtpPage extends StatelessWidget { ), SizedBox(height: 24.0.h()), viewModel.isLoading - ? BaseButton( + ? const BaseButton( isEnabled: false, text: ForgotPasswordOtpStrings.resetLink, onPressed: null, @@ -105,7 +105,7 @@ class TabletForgotPasswordOtpPage extends StatelessWidget { } : null, ), - SizedBox(height: 12.0), + const SizedBox(height: 12.0), TextButton( onPressed: () { diff --git a/lib/views/forgot_password/pages/d_forgot_apssword_page.dart b/lib/views/forgot_password/pages/d_forgot_apssword_page.dart index 23941ac..cfd7e4e 100644 --- a/lib/views/forgot_password/pages/d_forgot_apssword_page.dart +++ b/lib/views/forgot_password/pages/d_forgot_apssword_page.dart @@ -83,7 +83,7 @@ class DesktopForgotPasswordPage extends StatelessWidget { // ), SizedBox(height: 70.0.h()), viewModel.isLoading - ? BaseButton( + ? const BaseButton( isEnabled: false, text: ForgotPasswordStrings.resetLink, onPressed: null, @@ -105,7 +105,7 @@ class DesktopForgotPasswordPage extends StatelessWidget { } : null, ), - SizedBox(height: 12), + const SizedBox(height: 12), TextButton( onPressed: () { context.pop(); diff --git a/lib/views/forgot_password/pages/forgot_password_screen.dart b/lib/views/forgot_password/pages/forgot_password_screen.dart index 617ad98..ca421cd 100644 --- a/lib/views/forgot_password/pages/forgot_password_screen.dart +++ b/lib/views/forgot_password/pages/forgot_password_screen.dart @@ -10,7 +10,7 @@ class ForgotPasswordScreen extends StatelessWidget { @override Widget build(BuildContext context) { - return ResponsiveBuilder( + return const ResponsiveBuilder( mobile: MobileForgotPasswordPage(), tablet: TabletForgotPasswordPage(), desktop: DesktopForgotPasswordPage(), diff --git a/lib/views/forgot_password/pages/m_forgot_password_page.dart b/lib/views/forgot_password/pages/m_forgot_password_page.dart index 72e599a..5694646 100644 --- a/lib/views/forgot_password/pages/m_forgot_password_page.dart +++ b/lib/views/forgot_password/pages/m_forgot_password_page.dart @@ -78,7 +78,7 @@ class MobileForgotPasswordPage extends StatelessWidget { // ), // SizedBox(height: 70.0.h()), viewModel.isLoading - ? BaseButton( + ? const BaseButton( isEnabled: false, text: ForgotPasswordStrings.resetLink, onPressed: null, diff --git a/lib/views/forgot_password/pages/t_forgot_password_page.dart b/lib/views/forgot_password/pages/t_forgot_password_page.dart index 2c5194a..0c1cafb 100644 --- a/lib/views/forgot_password/pages/t_forgot_password_page.dart +++ b/lib/views/forgot_password/pages/t_forgot_password_page.dart @@ -77,7 +77,7 @@ class TabletForgotPasswordPage extends StatelessWidget { // ), // SizedBox(height: 70.0.h()), viewModel.isLoading - ? BaseButton( + ? const BaseButton( isEnabled: false, text: ForgotPasswordStrings.resetLink, onPressed: null, @@ -100,7 +100,7 @@ class TabletForgotPasswordPage extends StatelessWidget { : null, ), - SizedBox(height: 12), + const SizedBox(height: 12), TextButton( onPressed: () { context.pop(); diff --git a/lib/views/home/pages/d_home_page.dart b/lib/views/home/pages/d_home_page.dart index 5b68a31..06861c0 100644 --- a/lib/views/home/pages/d_home_page.dart +++ b/lib/views/home/pages/d_home_page.dart @@ -18,7 +18,7 @@ class DesktopHomePage extends StatelessWidget { return Scaffold( body: Column( children: [ - DesktopNavigationWidget( + const DesktopNavigationWidget( currentIndex: 0, // Home index ), Expanded( @@ -45,9 +45,9 @@ class DesktopHomePage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox(height: 55), + const SizedBox(height: 55), // SizedBox(width: 780, child: NotificationCard()), - SizedBox(height: 40.0), + const SizedBox(height: 40.0), _progressBarsRow(homeViewModel), SizedBox(height: 32.0.h()), Padding( @@ -89,7 +89,7 @@ class DesktopHomePage extends StatelessWidget { circularProgressIndicatorHeight: 176, strokeWidth: 9, ), - SizedBox(width: 106), + const SizedBox(width: 106), ProgressBarColumn( text: HomeStrings.selfApply, value: homeViewModel.selfApplyPercent, @@ -126,11 +126,11 @@ class DesktopHomePage extends StatelessWidget { width: 178, height: 148, onTap: () { - YourTendersRouteData().push(context); + const YourTendersRouteData().push(context); }, ), ), - SizedBox(width: 10), + const SizedBox(width: 10), Expanded( child: TenderCard( backgroundColor: AppColors.primary10, @@ -142,11 +142,11 @@ class DesktopHomePage extends StatelessWidget { width: 178, height: 148, onTap: () { - YourTendersRouteData().push(context); + const YourTendersRouteData().push(context); }, ), ), - SizedBox(width: 10), + const SizedBox(width: 10), TenderCard( backgroundColor: AppColors.orange10, iconPath: AssetsManager.shield, @@ -158,7 +158,7 @@ class DesktopHomePage extends StatelessWidget { height: 148, onTap: () {}, ), - SizedBox(width: 10), + const SizedBox(width: 10), TenderCard( backgroundColor: AppColors.grey10, iconPath: AssetsManager.thumbLike, @@ -169,7 +169,7 @@ class DesktopHomePage extends StatelessWidget { width: 178, height: 148, onTap: () { - LikedTendersRouteData().push(context); + const LikedTendersRouteData().push(context); }, ), ], @@ -180,7 +180,7 @@ class DesktopHomePage extends StatelessWidget { final isYourTenders = homeViewModel.data?.data?.tenders!.isNotEmpty ?? false; return ConstrainedBox( - constraints: BoxConstraints(maxWidth: 740), + constraints: const BoxConstraints(maxWidth: 740), child: Align( alignment: Alignment.centerLeft, child: Text( @@ -216,7 +216,7 @@ class DesktopHomePage extends StatelessWidget { return false; }, child: ListView.builder( - padding: EdgeInsets.only(bottom: 20), + padding: const EdgeInsets.only(bottom: 20), itemCount: homeViewModel.tenders.length + (homeViewModel.isLoadingMore ? 1 : 0), @@ -225,7 +225,7 @@ class DesktopHomePage extends StatelessWidget { if (index < homeViewModel.tenders.length) { return TendersListItem(tender: homeViewModel.tenders[index]); } else { - return Center( + return const Center( child: Padding( padding: EdgeInsets.all(16.0), child: CircularProgressIndicator( diff --git a/lib/views/home/pages/home_screen.dart b/lib/views/home/pages/home_screen.dart index 4052657..cf5dc33 100644 --- a/lib/views/home/pages/home_screen.dart +++ b/lib/views/home/pages/home_screen.dart @@ -10,7 +10,7 @@ class HomeScreen extends StatelessWidget { @override Widget build(BuildContext context) { SizeConfig.init(context); - return ResponsiveBuilder( + return const ResponsiveBuilder( mobile: MobileHomePage(), tablet: TabletHomePage(), desktop: DesktopHomePage(), diff --git a/lib/views/home/pages/m_home_page.dart b/lib/views/home/pages/m_home_page.dart index 2b042d1..b0e75fe 100644 --- a/lib/views/home/pages/m_home_page.dart +++ b/lib/views/home/pages/m_home_page.dart @@ -68,21 +68,21 @@ class MobileHomePage extends StatelessWidget { padding: EdgeInsets.symmetric(horizontal: 24.0.w()), child: Row( children: [ - Spacer(), + const Spacer(), SizedBox(width: 20.0.w()), ProgressBarColumn( text: HomeStrings.partnership, value: homeViewModel.partnershipPercent, amount: homeViewModel.partnershipPercent.toString(), ), - Spacer(), + const Spacer(), ProgressBarColumn( text: HomeStrings.selfApply, value: homeViewModel.selfApplyPercent, amount: homeViewModel.selfApplyPercent.toString(), ), SizedBox(width: 20.0.w()), - Spacer(), + const Spacer(), ], ), ); @@ -106,7 +106,7 @@ class MobileHomePage extends StatelessWidget { textColor: AppColors.mainBlue, enableTap: true, onTap: () { - YourTendersRouteData().push(context); + const YourTendersRouteData().push(context); }, ), TenderCard( @@ -118,7 +118,7 @@ class MobileHomePage extends StatelessWidget { textColor: AppColors.jellyBean, enableTap: true, onTap: () { - YourTendersRouteData().push(context); + const YourTendersRouteData().push(context); }, ), ], @@ -152,7 +152,7 @@ class MobileHomePage extends StatelessWidget { textColor: AppColors.grey80, enableTap: true, onTap: () { - LikedTendersRouteData().push(context).then((value) { + const LikedTendersRouteData().push(context).then((value) { homeViewModel.init(); }); }, @@ -211,7 +211,7 @@ class MobileHomePage extends StatelessWidget { if (index < homeViewModel.tenders.length) { return TendersListItem(tender: homeViewModel.tenders[index]); } else { - return Center( + return const Center( child: Padding( padding: EdgeInsets.all(16.0), child: CircularProgressIndicator( diff --git a/lib/views/home/pages/t_home_page.dart b/lib/views/home/pages/t_home_page.dart index 33eb811..fd2cc73 100644 --- a/lib/views/home/pages/t_home_page.dart +++ b/lib/views/home/pages/t_home_page.dart @@ -24,7 +24,7 @@ class TabletHomePage extends StatelessWidget { appBar: tabletAppBar(title: HomeStrings.home, key: key), - drawer: TabletNavigationWidget( + drawer: const TabletNavigationWidget( currentIndex: 0, // Home is index 0 ), body: Consumer( @@ -83,7 +83,7 @@ class TabletHomePage extends StatelessWidget { Widget _progressBarsRow(HomeViewModel homeViewModel) { return Row( children: [ - Spacer(), + const Spacer(), SizedBox(width: 20.0.w()), ProgressBarColumn( text: HomeStrings.partnership, @@ -93,7 +93,7 @@ class TabletHomePage extends StatelessWidget { circularProgressIndicatorHeight: 176.0, strokeWidth: 8.0, ), - Spacer(), + const Spacer(), ProgressBarColumn( text: HomeStrings.selfApply, value: homeViewModel.selfApplyPercent, @@ -103,7 +103,7 @@ class TabletHomePage extends StatelessWidget { strokeWidth: 8.0, ), SizedBox(width: 20.0.w()), - Spacer(), + const Spacer(), ], ); } @@ -128,11 +128,11 @@ class TabletHomePage extends StatelessWidget { width: double.infinity, height: 148, onTap: () { - YourTendersRouteData().push(context); + const YourTendersRouteData().push(context); }, ), ), - SizedBox(width: 16.0), + const SizedBox(width: 16.0), Expanded( child: TenderCard( backgroundColor: AppColors.primary10, @@ -145,7 +145,7 @@ class TabletHomePage extends StatelessWidget { width: double.infinity, height: 148, onTap: () { - YourTendersRouteData().push(context); + const YourTendersRouteData().push(context); }, ), ), @@ -174,7 +174,7 @@ class TabletHomePage extends StatelessWidget { onTap: () {}, ), ), - SizedBox(width: 16.0), + const SizedBox(width: 16.0), Expanded( child: TenderCard( backgroundColor: AppColors.grey10, @@ -186,7 +186,7 @@ class TabletHomePage extends StatelessWidget { width: double.infinity, height: 148, onTap: () { - LikedTendersRouteData().push(context); + const LikedTendersRouteData().push(context); }, ), ), @@ -234,7 +234,7 @@ class TabletHomePage extends StatelessWidget { if (index < homeViewModel.tenders.length) { return TendersListItem(tender: homeViewModel.tenders[index]); } else { - return Center( + return const Center( child: Padding( padding: EdgeInsets.all(16.0), child: CircularProgressIndicator( diff --git a/lib/views/home/progress_bar_column.dart b/lib/views/home/progress_bar_column.dart index 4a799a0..039146e 100644 --- a/lib/views/home/progress_bar_column.dart +++ b/lib/views/home/progress_bar_column.dart @@ -37,7 +37,7 @@ class _ProgressBarColumnState extends State // Initialize the animation controller _controller = AnimationController( vsync: this, - duration: Duration(milliseconds: 2000), // duration of the animation + duration: const Duration(milliseconds: 2000), // duration of the animation ); // Create a Tween animation from 0.0 to 0.75 @@ -81,7 +81,9 @@ class _ProgressBarColumnState extends State backgroundColor: AppColors.grey10, strokeCap: StrokeCap.round, strokeWidth: widget.strokeWidth ?? 6.0, - valueColor: AlwaysStoppedAnimation(AppColors.jellyBean), + valueColor: const AlwaysStoppedAnimation( + AppColors.jellyBean, + ), value: _animation.value, ), ), diff --git a/lib/views/home/tender_card.dart b/lib/views/home/tender_card.dart index b739d42..2660767 100644 --- a/lib/views/home/tender_card.dart +++ b/lib/views/home/tender_card.dart @@ -44,7 +44,7 @@ class TenderCard extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SvgPicture.asset(iconPath,width: 32.0.w(),height: 32.0.h(),), + SvgPicture.asset(iconPath, width: 32.0.w(), height: 32.0.h()), SizedBox(height: 4.0.h()), Text( title, @@ -54,7 +54,7 @@ class TenderCard extends StatelessWidget { color: AppColors.grey80, ), ), - Spacer(), + const Spacer(), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -68,7 +68,7 @@ class TenderCard extends StatelessWidget { ), enableTap ? SvgPicture.asset(AssetsManager.arrowRight) - : SizedBox(), + : const SizedBox(), ], ), ], diff --git a/lib/views/home/tenders_list_item.dart b/lib/views/home/tenders_list_item.dart index c81f393..a27cb60 100644 --- a/lib/views/home/tenders_list_item.dart +++ b/lib/views/home/tenders_list_item.dart @@ -97,8 +97,8 @@ class TendersListItem extends StatelessWidget { ), ), ), - Spacer(), - TenderCardProgressBar(), + const Spacer(), + const TenderCardProgressBar(), SizedBox(height: 15.0.h()), Row( @@ -117,7 +117,7 @@ class TendersListItem extends StatelessWidget { tender.countryCode != null ? Flag(countryCode: tender.countryCode!) : const Flag(countryCode: ''), - Spacer(), + const Spacer(), ], ), ], diff --git a/lib/views/home/widgets/tender_card_progress_bar.dart b/lib/views/home/widgets/tender_card_progress_bar.dart index 6e6e5e9..43f89f6 100644 --- a/lib/views/home/widgets/tender_card_progress_bar.dart +++ b/lib/views/home/widgets/tender_card_progress_bar.dart @@ -39,7 +39,9 @@ class TenderCardProgressBar extends StatelessWidget { child: LinearProgressIndicator( value: 0.75, backgroundColor: AppColors.grey20, - valueColor: AlwaysStoppedAnimation(AppColors.secondary50), + valueColor: const AlwaysStoppedAnimation( + AppColors.secondary50, + ), minHeight: 6.0.h(), ), ), diff --git a/lib/views/liked_tenders/pages/liked_tenders_mobile_page.dart b/lib/views/liked_tenders/pages/liked_tenders_mobile_page.dart index ce05989..ab957be 100644 --- a/lib/views/liked_tenders/pages/liked_tenders_mobile_page.dart +++ b/lib/views/liked_tenders/pages/liked_tenders_mobile_page.dart @@ -242,7 +242,7 @@ class _LikedTendersMobilePageState extends State { child: SizedBox( width: 24.0.w(), height: 24.0.h(), - child: CircularProgressIndicator( + child: const CircularProgressIndicator( color: AppColors.secondary50, strokeWidth: 2, ), diff --git a/lib/views/liked_tenders/pages/liked_tenders_screen.dart b/lib/views/liked_tenders/pages/liked_tenders_screen.dart index 642c998..429c9ab 100644 --- a/lib/views/liked_tenders/pages/liked_tenders_screen.dart +++ b/lib/views/liked_tenders/pages/liked_tenders_screen.dart @@ -29,7 +29,7 @@ class _LikedTendersScreenState extends State { @override Widget build(BuildContext context) { SizeConfig.init(context); - return ResponsiveBuilder( + return const ResponsiveBuilder( mobile: LikedTendersMobilePage(), tablet: LikedTendersTabletPage(), desktop: LikedTendersDesktopPage(), diff --git a/lib/views/liked_tenders/pages/liked_tenders_tablet_page.dart b/lib/views/liked_tenders/pages/liked_tenders_tablet_page.dart index cd0d277..1ad142e 100644 --- a/lib/views/liked_tenders/pages/liked_tenders_tablet_page.dart +++ b/lib/views/liked_tenders/pages/liked_tenders_tablet_page.dart @@ -147,7 +147,7 @@ class _LikedTendersTabletPageState extends State { ), ), //tabletAppBar(title: LikedTendersStrings.likedTenders, key: key), - drawer: TabletNavigationWidget(currentIndex: 1), + drawer: const TabletNavigationWidget(currentIndex: 1), body: Center( child: SizedBox( width: 720, diff --git a/lib/views/liked_tenders/widgets/liked_tenders_list_item.dart b/lib/views/liked_tenders/widgets/liked_tenders_list_item.dart index 77c8596..437c697 100644 --- a/lib/views/liked_tenders/widgets/liked_tenders_list_item.dart +++ b/lib/views/liked_tenders/widgets/liked_tenders_list_item.dart @@ -151,7 +151,7 @@ class LikedListItem extends StatelessWidget { ), ), ), - Spacer(), + const Spacer(), Row( children: [ @@ -168,8 +168,8 @@ class LikedListItem extends StatelessWidget { SizedBox(width: 8.0.w()), tender.countryCode != null ? Flag(countryCode: tender.countryCode!) - : Flag(countryCode: ''), - Spacer(), + : const Flag(countryCode: ''), + const Spacer(), InkWell( onTap: () { viewModel.rejectTenderApproval( diff --git a/lib/views/login/pages/login_desktop_page.dart b/lib/views/login/pages/login_desktop_page.dart index 087e298..58f602e 100644 --- a/lib/views/login/pages/login_desktop_page.dart +++ b/lib/views/login/pages/login_desktop_page.dart @@ -31,7 +31,7 @@ class _LoginDesktopPageState extends State { void _viewModelListener() { if (viewModel.loggedInUser != null) { - Router.neglect(context, () => HomeRouteData().go(context)); + Router.neglect(context, () => const HomeRouteData().go(context)); } else if (viewModel.errorMessage != null) { AppToast.error(context, viewModel.errorMessage!); } @@ -92,7 +92,7 @@ class _LoginDesktopPageState extends State { ), SizedBox(height: 32.0.h()), if (viewModel.isLoading) - BaseButton( + const BaseButton( isEnabled: false, onPressed: null, isLoading: true, diff --git a/lib/views/login/pages/login_mobile_page.dart b/lib/views/login/pages/login_mobile_page.dart index 4898ca3..e6549c5 100644 --- a/lib/views/login/pages/login_mobile_page.dart +++ b/lib/views/login/pages/login_mobile_page.dart @@ -29,7 +29,7 @@ class _LoginMobilePageState extends State { void _viewModelListener() { if (viewModel.loggedInUser != null) { - Router.neglect(context, () => HomeRouteData().go(context)); + Router.neglect(context, () => const HomeRouteData().go(context)); } if (viewModel.errorMessage != null) { AppToast.error(context, viewModel.errorMessage!); diff --git a/lib/views/login/pages/login_screen.dart b/lib/views/login/pages/login_screen.dart index 6a0e0e7..0cb3522 100644 --- a/lib/views/login/pages/login_screen.dart +++ b/lib/views/login/pages/login_screen.dart @@ -8,13 +8,13 @@ import 'package:tm_app/views/shared/responsive_builder.dart'; class LoginScreen extends StatelessWidget { const LoginScreen({super.key}); - @override + @override Widget build(BuildContext context) { SizeConfig.init(context); - return ResponsiveBuilder( - mobile: LoginMobilePage(), + return const ResponsiveBuilder( + mobile: LoginMobilePage(), tablet: LoginTabletPage(), desktop: LoginDesktopPage(), ); } -} \ No newline at end of file +} diff --git a/lib/views/login/pages/login_tablet_page.dart b/lib/views/login/pages/login_tablet_page.dart index a0979ff..55475cc 100644 --- a/lib/views/login/pages/login_tablet_page.dart +++ b/lib/views/login/pages/login_tablet_page.dart @@ -29,7 +29,7 @@ class _LoginTabletPageState extends State { void _viewModelListener() { if (viewModel.loggedInUser != null) { - Router.neglect(context, () => HomeRouteData().go(context)); + Router.neglect(context, () => const HomeRouteData().go(context)); } if (viewModel.errorMessage != null) { AppToast.error(context, viewModel.errorMessage!); @@ -84,7 +84,7 @@ class _LoginTabletPageState extends State { ), SizedBox(height: 32.0.h()), if (viewModel.isLoading) - BaseButton( + const BaseButton( isEnabled: false, onPressed: null, isLoading: true, diff --git a/lib/views/login/widgets/login_textfield.dart b/lib/views/login/widgets/login_textfield.dart index b2351a1..7b25f46 100644 --- a/lib/views/login/widgets/login_textfield.dart +++ b/lib/views/login/widgets/login_textfield.dart @@ -90,7 +90,7 @@ class LoginTextField extends StatelessWidget { borderSide: BorderSide(color: AppColors.grey40), ), focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: AppColors.borderBlue), + borderSide: const BorderSide(color: AppColors.borderBlue), borderRadius: BorderRadius.circular(borderRedus ?? 12.0.w()), ), ), diff --git a/lib/views/notification/pages/d_notification_page.dart b/lib/views/notification/pages/d_notification_page.dart index 0247447..5d00836 100644 --- a/lib/views/notification/pages/d_notification_page.dart +++ b/lib/views/notification/pages/d_notification_page.dart @@ -41,7 +41,7 @@ class _DesktopNotificationPageState extends State backgroundColor: AppColors.backgroundColor, body: Column( children: [ - DesktopNavigationWidget(currentIndex: 3), + const DesktopNavigationWidget(currentIndex: 3), SizedBox(height: 60.0.h()), diff --git a/lib/views/notification/pages/m_notification_page.dart b/lib/views/notification/pages/m_notification_page.dart index 22ba539..5a517f6 100644 --- a/lib/views/notification/pages/m_notification_page.dart +++ b/lib/views/notification/pages/m_notification_page.dart @@ -80,7 +80,7 @@ class _MobileNotificationPageState extends State Expanded( child: TabBarView( controller: controller, - children: [ + children: const [ NotificationAllTab(), NotificationUnreadTab(), NotificationImportantTab(), diff --git a/lib/views/notification/pages/notification_screen.dart b/lib/views/notification/pages/notification_screen.dart index 472961d..d1faf3b 100644 --- a/lib/views/notification/pages/notification_screen.dart +++ b/lib/views/notification/pages/notification_screen.dart @@ -11,7 +11,7 @@ class NotificationScreen extends StatelessWidget { @override Widget build(BuildContext context) { SizeConfig.init(context); - return ResponsiveBuilder( + return const ResponsiveBuilder( mobile: MobileNotificationPage(), tablet: TabletNotificationPage(), desktop: DesktopNotificationPage(), diff --git a/lib/views/notification/pages/t_notification_page.dart b/lib/views/notification/pages/t_notification_page.dart index 2bb9941..4457363 100644 --- a/lib/views/notification/pages/t_notification_page.dart +++ b/lib/views/notification/pages/t_notification_page.dart @@ -45,7 +45,7 @@ class _TabletNotificationPageState extends State title: NotificationStrings.notificationTitle, key: key, ), - drawer: TabletNavigationWidget(currentIndex: 3), + drawer: const TabletNavigationWidget(currentIndex: 3), body: Center( child: SizedBox( width: 720, @@ -92,7 +92,7 @@ class _TabletNotificationPageState extends State Expanded( child: TabBarView( controller: controller, - children: [ + children: const [ NotificationAllTab(), NotificationUnreadTab(), NotificationImportantTab(), diff --git a/lib/views/profile/pages/d_profile_page.dart b/lib/views/profile/pages/d_profile_page.dart index 82e944c..0ec481d 100644 --- a/lib/views/profile/pages/d_profile_page.dart +++ b/lib/views/profile/pages/d_profile_page.dart @@ -35,7 +35,7 @@ class _DesktopProfilePageState extends State { AppToast.error(context, viewModel.errorMessage!); } if (viewModel.loggedOut) { - Router.neglect(context, () => LoginScreenRoute().go(context)); + Router.neglect(context, () => const LoginScreenRoute().go(context)); } } @@ -52,7 +52,7 @@ class _DesktopProfilePageState extends State { body: Consumer( builder: (context, viewModel, child) { if (viewModel.isLoading) { - return Center( + return const Center( child: CircularProgressIndicator(color: AppColors.secondary50), ); } @@ -61,12 +61,12 @@ class _DesktopProfilePageState extends State { } if (viewModel.companyProfileData == null) { - return Center(child: Text(CommonStrings.noData)); + return const Center(child: Text(CommonStrings.noData)); } return Column( children: [ - DesktopNavigationWidget( + const DesktopNavigationWidget( currentIndex: 4, // Tenders index ), SizedBox( @@ -87,7 +87,7 @@ class _DesktopProfilePageState extends State { description: viewModel.companyProfileData!.registrationNumber!, ), - TitleDescription( + const TitleDescription( title: ProfileStrings.businessType, description: '-', ), @@ -122,13 +122,13 @@ class _DesktopProfilePageState extends State { color: AppColors.grey70, ), ), - Spacer(), + const Spacer(), SvgPicture.asset(AssetsManager.sun), SizedBox(width: 12.0.w()), SizedBox( width: 52.0.w(), height: 32.0.h(), - child: ThemeToggle(), + child: const ThemeToggle(), ), SizedBox(width: 12.0.w()), SvgPicture.asset(AssetsManager.moon), diff --git a/lib/views/profile/pages/m_profile_page.dart b/lib/views/profile/pages/m_profile_page.dart index bf3cc4b..ab9cc35 100644 --- a/lib/views/profile/pages/m_profile_page.dart +++ b/lib/views/profile/pages/m_profile_page.dart @@ -35,7 +35,7 @@ class _MobileProfilePageState extends State { AppToast.error(context, viewModel.errorMessage!); } if (viewModel.loggedOut) { - Router.neglect(context, () => LoginScreenRoute().go(context)); + Router.neglect(context, () => const LoginScreenRoute().go(context)); } } @@ -53,7 +53,7 @@ class _MobileProfilePageState extends State { body: Consumer( builder: (context, viewModel, child) { if (viewModel.isLoading) { - return Center( + return const Center( child: CircularProgressIndicator(color: AppColors.secondary50), ); } @@ -63,7 +63,7 @@ class _MobileProfilePageState extends State { } if (viewModel.companyProfileData == null) { - return Center(child: Text(CommonStrings.noData)); + return const Center(child: Text(CommonStrings.noData)); } return Padding( @@ -87,7 +87,7 @@ class _MobileProfilePageState extends State { description: viewModel.companyProfileData!.registrationNumber!, ), - TitleDescription( + const TitleDescription( title: ProfileStrings.businessType, description: '-', ), @@ -121,13 +121,13 @@ class _MobileProfilePageState extends State { color: AppColors.grey70, ), ), - Spacer(), + const Spacer(), SvgPicture.asset(AssetsManager.sun), SizedBox(width: 12.0.w()), SizedBox( width: 52.0.w(), height: 32.0.h(), - child: ThemeToggle(), + child: const ThemeToggle(), ), SizedBox(width: 12.0.w()), SvgPicture.asset(AssetsManager.moon), @@ -137,7 +137,7 @@ class _MobileProfilePageState extends State { SizedBox(height: 24.0.h()), Divider(color: AppColors.dividerColor, thickness: 1), SizedBox(height: 24.0.h()), - Spacer(), + const Spacer(), InkWell( onTap: () => viewModel.logout(), borderRadius: BorderRadius.circular(100), diff --git a/lib/views/profile/pages/profile_screen.dart b/lib/views/profile/pages/profile_screen.dart index 299c06f..31f53e1 100644 --- a/lib/views/profile/pages/profile_screen.dart +++ b/lib/views/profile/pages/profile_screen.dart @@ -10,7 +10,7 @@ class ProfileScreen extends StatelessWidget { @override Widget build(BuildContext context) { - return ResponsiveBuilder( + return const ResponsiveBuilder( mobile: MobileProfilePage(), tablet: TabletProfilePage(), desktop: DesktopProfilePage(), diff --git a/lib/views/profile/pages/t_profile_page.dart b/lib/views/profile/pages/t_profile_page.dart index 0a8c44d..19a5c49 100644 --- a/lib/views/profile/pages/t_profile_page.dart +++ b/lib/views/profile/pages/t_profile_page.dart @@ -36,7 +36,7 @@ class _TabletProfilePageState extends State { AppToast.error(context, viewModel.errorMessage!); } if (viewModel.loggedOut) { - Router.neglect(context, () => LoginScreenRoute().go(context)); + Router.neglect(context, () => const LoginScreenRoute().go(context)); } } @@ -52,7 +52,7 @@ class _TabletProfilePageState extends State { return Consumer( builder: (context, viewModel, child) { if (viewModel.isLoading) { - return Center( + return const Center( child: CircularProgressIndicator(color: AppColors.secondary50), ); } @@ -61,7 +61,7 @@ class _TabletProfilePageState extends State { } if (viewModel.companyProfileData == null) { - return Center(child: Text(CommonStrings.noData)); + return const Center(child: Text(CommonStrings.noData)); } return SafeArea( @@ -70,7 +70,7 @@ class _TabletProfilePageState extends State { backgroundColor: AppColors.backgroundColor, appBar: tabletAppBar(title: ProfileStrings.profileTitle, key: key), - drawer: TabletNavigationWidget(currentIndex: 4), + drawer: const TabletNavigationWidget(currentIndex: 4), body: Padding( padding: EdgeInsets.symmetric( horizontal: 24.0.w(), @@ -92,7 +92,7 @@ class _TabletProfilePageState extends State { description: viewModel.companyProfileData!.registrationNumber!, ), - TitleDescription( + const TitleDescription( title: ProfileStrings.businessType, description: '-', ), @@ -127,13 +127,13 @@ class _TabletProfilePageState extends State { color: AppColors.grey70, ), ), - Spacer(), + const Spacer(), SvgPicture.asset(AssetsManager.sun), SizedBox(width: 12.0.w()), SizedBox( width: 52.0.w(), height: 32.0.h(), - child: ThemeToggle(), + child: const ThemeToggle(), ), SizedBox(width: 12.0.w()), SvgPicture.asset(AssetsManager.moon), diff --git a/lib/views/shared/cached_svg.dart b/lib/views/shared/cached_svg.dart index 76f7146..64115d7 100644 --- a/lib/views/shared/cached_svg.dart +++ b/lib/views/shared/cached_svg.dart @@ -75,7 +75,7 @@ class _CachedSvgState extends State { @override Widget build(BuildContext context) { if (_isLoading) { - return SizedBox(); + return const SizedBox(); } if (_svgData == null) { diff --git a/lib/views/shared/desktop_navigation_widget.dart b/lib/views/shared/desktop_navigation_widget.dart index 70cfabe..93d3171 100644 --- a/lib/views/shared/desktop_navigation_widget.dart +++ b/lib/views/shared/desktop_navigation_widget.dart @@ -34,9 +34,9 @@ class DesktopNavigationWidget extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox(width: 40), + const SizedBox(width: 40), SvgPicture.asset(AssetsManager.logoSmall), - Spacer(), + const Spacer(), _navigationItem( context: context, text: HomeStrings.home, @@ -45,14 +45,17 @@ class DesktopNavigationWidget extends StatelessWidget { if (currentIndex == 0) { return; } else { - Router.neglect(context, () => HomeRouteData().go(context)); + Router.neglect( + context, + () => const HomeRouteData().go(context), + ); context.read().init(); } }, iconPath: AssetsManager.home, activeIconPath: AssetsManager.homeActive, ), - SizedBox(width: 24), + const SizedBox(width: 24), _navigationItem( context: context, text: TendersStrings.tendersTitle, @@ -61,14 +64,17 @@ class DesktopNavigationWidget extends StatelessWidget { if (currentIndex == 1) { return; } else { - Router.neglect(context, () => TendersRouteData().go(context)); + Router.neglect( + context, + () => const TendersRouteData().go(context), + ); context.read().getTenders(); } }, iconPath: AssetsManager.tenders, activeIconPath: AssetsManager.tendersActive, ), - SizedBox(width: 24), + const SizedBox(width: 24), _navigationItem( context: context, text: TendersStrings.contracts, @@ -84,7 +90,7 @@ class DesktopNavigationWidget extends StatelessWidget { iconPath: AssetsManager.contracts, activeIconPath: AssetsManager.contracts, ), - SizedBox(width: 24), + const SizedBox(width: 24), _navigationItem( context: context, text: TendersStrings.notifications, @@ -95,7 +101,7 @@ class DesktopNavigationWidget extends StatelessWidget { } else { Router.neglect( context, - () => NotificationRouteData().go(context), + () => const NotificationRouteData().go(context), ); //context.read().getTenders(); } @@ -103,7 +109,7 @@ class DesktopNavigationWidget extends StatelessWidget { iconPath: AssetsManager.notify, activeIconPath: AssetsManager.notifyActive, ), - SizedBox(width: 24), + const SizedBox(width: 24), _navigationItem( context: context, text: ProfileStrings.profileTitle, @@ -112,13 +118,16 @@ class DesktopNavigationWidget extends StatelessWidget { if (currentIndex == 4) { return; } else { - Router.neglect(context, () => ProfileRouteData().go(context)); + Router.neglect( + context, + () => const ProfileRouteData().go(context), + ); } }, iconPath: AssetsManager.profile, activeIconPath: AssetsManager.profileActive, ), - Spacer(), + const Spacer(), if (haveFilter) Builder( builder: @@ -133,7 +142,7 @@ class DesktopNavigationWidget extends StatelessWidget { }, ), ), - SizedBox(width: 68), + const SizedBox(width: 68), ], ), ); @@ -157,7 +166,7 @@ class DesktopNavigationWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ SvgPicture.asset(isActive ? activeIconPath : iconPath), - SizedBox(width: 8), + const SizedBox(width: 8), Text( text, style: TextStyle( diff --git a/lib/views/shared/main_tab_bar.dart b/lib/views/shared/main_tab_bar.dart index 0d8c7df..fe62df3 100644 --- a/lib/views/shared/main_tab_bar.dart +++ b/lib/views/shared/main_tab_bar.dart @@ -36,7 +36,7 @@ class _MainTabBarState extends State { BoxShadow( color: Colors.black.withValues(alpha: 0.12), blurRadius: 4, - offset: Offset(0, 2), + offset: const Offset(0, 2), ), ], ), diff --git a/lib/views/shared/select_submission_bottom_sheet.dart b/lib/views/shared/select_submission_bottom_sheet.dart index 89e30cf..824eeb4 100644 --- a/lib/views/shared/select_submission_bottom_sheet.dart +++ b/lib/views/shared/select_submission_bottom_sheet.dart @@ -30,7 +30,7 @@ class _SelectSubmissionBottomSheetState padding: EdgeInsets.fromLTRB(24.0.w(), 24.0.h(), 24.0.w(), 33.0.h()), decoration: BoxDecoration( color: AppColors.backgroundColor, - borderRadius: BorderRadius.only( + borderRadius: const BorderRadius.only( topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0), ), @@ -115,7 +115,7 @@ class _SelectSubmissionBottomSheetState horizontal: 10.0.w(), vertical: 10.0.h(), ), - padding: EdgeInsets.all(3), + padding: const EdgeInsets.all(3), decoration: BoxDecoration( shape: BoxShape.circle, border: Border.all( diff --git a/lib/views/shared/select_submission_dialog.dart b/lib/views/shared/select_submission_dialog.dart index a15ce13..51afc56 100644 --- a/lib/views/shared/select_submission_dialog.dart +++ b/lib/views/shared/select_submission_dialog.dart @@ -114,7 +114,7 @@ class _SelectSubmissionDialogState extends State { horizontal: 10.0.w(), vertical: 10.0.h(), ), - padding: EdgeInsets.all(3), + padding: const EdgeInsets.all(3), decoration: BoxDecoration( shape: BoxShape.circle, border: Border.all( diff --git a/lib/views/shared/tablet_navigation_widget.dart b/lib/views/shared/tablet_navigation_widget.dart index 4ef8fb6..daf533d 100644 --- a/lib/views/shared/tablet_navigation_widget.dart +++ b/lib/views/shared/tablet_navigation_widget.dart @@ -35,7 +35,10 @@ class TabletNavigationWidget extends StatelessWidget { if (currentIndex == 0) { return; } else { - Router.neglect(context, () => HomeRouteData().go(context)); + Router.neglect( + context, + () => const HomeRouteData().go(context), + ); context.read().init(); } }, @@ -50,7 +53,10 @@ class TabletNavigationWidget extends StatelessWidget { if (currentIndex == 1) { return; } else { - Router.neglect(context, () => TendersRouteData().go(context)); + Router.neglect( + context, + () => const TendersRouteData().go(context), + ); context.read().getTenders(); } }, @@ -65,8 +71,8 @@ class TabletNavigationWidget extends StatelessWidget { if (currentIndex == 2) { return; } else { - // context.pop(); - // Router.neglect(context, () => ProfileRouteData().go(context)); + // context.pop(); + // Router.neglect(context, () => ProfileRouteData().go(context)); } }, iconPath: AssetsManager.contracts, @@ -81,7 +87,10 @@ class TabletNavigationWidget extends StatelessWidget { return; } else { context.pop(); - Router.neglect(context, () => NotificationRouteData().go(context)); + Router.neglect( + context, + () => const NotificationRouteData().go(context), + ); } }, iconPath: AssetsManager.notify, @@ -96,7 +105,10 @@ class TabletNavigationWidget extends StatelessWidget { return; } else { context.pop(); - Router.neglect(context, () => ProfileRouteData().go(context)); + Router.neglect( + context, + () => const ProfileRouteData().go(context), + ); } }, iconPath: AssetsManager.profile, @@ -135,7 +147,7 @@ class TabletNavigationWidget extends StatelessWidget { color: isActive ? AppColors.primaryColor : AppColors.grey60, ), ), - Spacer(), + const Spacer(), Container( width: 4.0.w(), height: 64.0.h(), diff --git a/lib/views/tenders/pages/d_tenders_page.dart b/lib/views/tenders/pages/d_tenders_page.dart index 9193a05..5ec9d4e 100644 --- a/lib/views/tenders/pages/d_tenders_page.dart +++ b/lib/views/tenders/pages/d_tenders_page.dart @@ -46,14 +46,14 @@ class _DesktopTendersPageState extends State { backgroundColor: AppColors.backgroundColor, body: Column( children: [ - DesktopNavigationWidget( + const DesktopNavigationWidget( currentIndex: 1, // Tenders index ), Expanded( child: Consumer( builder: (context, viewModel, child) { if (viewModel.isLoading) { - return Expanded( + return const Expanded( child: Center( child: CircularProgressIndicator( color: AppColors.jellyBean, @@ -67,7 +67,7 @@ class _DesktopTendersPageState extends State { if ((viewModel.tendersResponse?.data?.tenders == null || viewModel.tendersResponse!.data!.tenders!.isEmpty) && viewModel.isLoading == false) { - return Center(child: Text(CommonStrings.noData)); + return const Center(child: Text(CommonStrings.noData)); } return SingleChildScrollView( child: SizedBox( diff --git a/lib/views/tenders/pages/m_tenders_page.dart b/lib/views/tenders/pages/m_tenders_page.dart index 28912fb..db43482 100644 --- a/lib/views/tenders/pages/m_tenders_page.dart +++ b/lib/views/tenders/pages/m_tenders_page.dart @@ -49,7 +49,7 @@ class _MobileTendersPageState extends State { body: Consumer( builder: (context, viewModel, child) { if (viewModel.isLoading) { - return Center( + return const Center( child: CircularProgressIndicator(color: AppColors.jellyBean), ); } @@ -60,7 +60,7 @@ class _MobileTendersPageState extends State { if ((viewModel.tendersResponse?.data?.tenders == null || viewModel.tendersResponse!.data!.tenders!.isEmpty) && viewModel.isLoading == false) { - return Center(child: Text(CommonStrings.noData)); + return const Center(child: Text(CommonStrings.noData)); } return Padding( diff --git a/lib/views/tenders/pages/t_tenders_page.dart b/lib/views/tenders/pages/t_tenders_page.dart index 792af49..f2f1846 100644 --- a/lib/views/tenders/pages/t_tenders_page.dart +++ b/lib/views/tenders/pages/t_tenders_page.dart @@ -33,12 +33,12 @@ class _TabletTendersPageState extends State { key: key, backgroundColor: AppColors.backgroundColor, appBar: tabletAppBar(title: TendersStrings.tendersTitle, key: key), - drawer: TabletNavigationWidget(currentIndex: 1), + drawer: const TabletNavigationWidget(currentIndex: 1), body: SingleChildScrollView( child: Consumer( builder: (context, viewModel, child) { if (viewModel.isLoading) { - return Center( + return const Center( child: CircularProgressIndicator(color: AppColors.jellyBean), ); } @@ -48,7 +48,7 @@ class _TabletTendersPageState extends State { if ((viewModel.tendersResponse?.data?.tenders == null || viewModel.tendersResponse!.data!.tenders!.isEmpty) && viewModel.isLoading == false) { - return Center(child: Text(CommonStrings.noData)); + return const Center(child: Text(CommonStrings.noData)); } return Padding( padding: EdgeInsets.only(right: 24.0.w(), top: 128.0.h()), diff --git a/lib/views/tenders/pages/tenders_screen.dart b/lib/views/tenders/pages/tenders_screen.dart index b8bae90..d84ad64 100644 --- a/lib/views/tenders/pages/tenders_screen.dart +++ b/lib/views/tenders/pages/tenders_screen.dart @@ -10,7 +10,7 @@ class TendersScreen extends StatelessWidget { @override Widget build(BuildContext context) { - return ResponsiveBuilder( + return const ResponsiveBuilder( mobile: MobileTendersPage(), tablet: TabletTendersPage(), desktop: DesktopTendersPage(), diff --git a/lib/views/tenders/widgets/main_tenders_slider.dart b/lib/views/tenders/widgets/main_tenders_slider.dart index 210a89c..4c3526b 100644 --- a/lib/views/tenders/widgets/main_tenders_slider.dart +++ b/lib/views/tenders/widgets/main_tenders_slider.dart @@ -33,7 +33,7 @@ class _MainTendersSliderState extends State { } pageController.previousPage( - duration: Duration(milliseconds: 300), + duration: const Duration(milliseconds: 300), curve: Curves.easeInOutCubic, ); setState(() { @@ -57,7 +57,7 @@ class _MainTendersSliderState extends State { } pageController.nextPage( - duration: Duration(milliseconds: 300), + duration: const Duration(milliseconds: 300), curve: Curves.easeInOutCubic, ); setState(() { @@ -177,7 +177,7 @@ class _MainTendersSliderState extends State { child: SizedBox( width: 16.0.w(), height: 16.0.w(), - child: CircularProgressIndicator( + child: const CircularProgressIndicator( strokeWidth: 2.0, color: AppColors.jellyBean, ), diff --git a/lib/views/tenders/widgets/tender_card.dart b/lib/views/tenders/widgets/tender_card.dart index 392a2cb..5c76bc1 100644 --- a/lib/views/tenders/widgets/tender_card.dart +++ b/lib/views/tenders/widgets/tender_card.dart @@ -75,7 +75,7 @@ class TenderCard extends StatelessWidget { ], ), ), - Spacer(), + const Spacer(), // Bottom section with progress and actions Padding( padding: EdgeInsets.all(16.0.w()), @@ -254,7 +254,7 @@ class TenderCard extends StatelessWidget { // Country flag placeholder tender.countryCode != null ? Flag(countryCode: tender.countryCode!) - : Flag(countryCode: ''), + : const Flag(countryCode: ''), ], ), ); diff --git a/lib/views/your_tenders/pages/your_tenders_desktop_page.dart b/lib/views/your_tenders/pages/your_tenders_desktop_page.dart index 2c1c574..4198e44 100644 --- a/lib/views/your_tenders/pages/your_tenders_desktop_page.dart +++ b/lib/views/your_tenders/pages/your_tenders_desktop_page.dart @@ -41,7 +41,7 @@ class _YourTendersDesktopPageState extends State backgroundColor: AppColors.backgroundColor, body: Column( children: [ - DesktopNavigationWidget(currentIndex: 1), // Tenders index + const DesktopNavigationWidget(currentIndex: 1), // Tenders index Expanded( child: SizedBox( width: 740, @@ -117,7 +117,7 @@ class _YourTendersDesktopPageState extends State color: AppColors.grey60, ), ), - SizedBox(width: 10.0.w()), + SizedBox(width: 10.0.w()), InkWell( onTap: () async { final selectedPage = await showDialog( @@ -126,7 +126,9 @@ class _YourTendersDesktopPageState extends State return AlertDialog( backgroundColor: AppColors.backgroundColor, - title: const Text(YourTendersStrings.selectPage), + title: const Text( + YourTendersStrings.selectPage, + ), content: SizedBox( width: 200.0.w(), height: 300.0.h(), @@ -165,7 +167,7 @@ class _YourTendersDesktopPageState extends State ), child: Row( children: [ - SizedBox(width: 5.0.w()), + SizedBox(width: 5.0.w()), Text( '${viewModel.currentPage}', style: TextStyle( @@ -174,14 +176,14 @@ class _YourTendersDesktopPageState extends State color: AppColors.grey70, ), ), - SizedBox(width: 5.0.w()), + SizedBox(width: 5.0.w()), const Icon(Icons.arrow_drop_down), - SizedBox(width: 5.0.w()), + SizedBox(width: 5.0.w()), ], ), ), ), - SizedBox(width: 5.0.w()), + SizedBox(width: 5.0.w()), Text( YourTendersStrings.of, style: TextStyle( @@ -190,7 +192,7 @@ class _YourTendersDesktopPageState extends State color: AppColors.grey60, ), ), - SizedBox(width: 5.0.w()), + SizedBox(width: 5.0.w()), Text( '${viewModel.totalPages}', style: TextStyle( diff --git a/lib/views/your_tenders/pages/your_tenders_mobile_page.dart b/lib/views/your_tenders/pages/your_tenders_mobile_page.dart index e587392..e4ca33c 100644 --- a/lib/views/your_tenders/pages/your_tenders_mobile_page.dart +++ b/lib/views/your_tenders/pages/your_tenders_mobile_page.dart @@ -40,7 +40,7 @@ class _YourTendersMobilePageState extends State { appBar: appBar(context: context, title: YourTendersStrings.yourTenders), body: Column( children: [ - FilterButton(platformType: PlatformType.mobile), + const FilterButton(platformType: PlatformType.mobile), Expanded( child: Consumer( builder: (context, viewModel, child) { diff --git a/lib/views/your_tenders/pages/your_tenders_screen.dart b/lib/views/your_tenders/pages/your_tenders_screen.dart index a4b67e2..453be77 100644 --- a/lib/views/your_tenders/pages/your_tenders_screen.dart +++ b/lib/views/your_tenders/pages/your_tenders_screen.dart @@ -31,7 +31,7 @@ class _YourTendersScreenState extends State { @override Widget build(BuildContext context) { SizeConfig.init(context); - return ResponsiveBuilder( + return const ResponsiveBuilder( mobile: YourTendersMobilePage(), tablet: YourTendersTabletPage(), desktop: YourTendersDesktopPage(), diff --git a/lib/views/your_tenders/pages/your_tenders_tablet_page.dart b/lib/views/your_tenders/pages/your_tenders_tablet_page.dart index 00a137c..95eafa9 100644 --- a/lib/views/your_tenders/pages/your_tenders_tablet_page.dart +++ b/lib/views/your_tenders/pages/your_tenders_tablet_page.dart @@ -7,6 +7,7 @@ import 'package:tm_app/views/your_tenders/widgets/filter_button.dart'; import 'package:tm_app/views/your_tenders/widgets/liked_disliked_tenders_list.dart'; import 'package:tm_app/views/your_tenders/widgets/tablet_desktop_appbar.dart'; import 'package:tm_app/views/your_tenders/widgets/tenders_submitted.dart'; + import '../../../core/constants/tender_feedback.dart'; import '../../shared/tablet_navigation_widget.dart'; import '../../shared/tender_app_bar.dart'; @@ -42,19 +43,19 @@ class _YourTendersTabletPageState extends State key: key, backgroundColor: AppColors.backgroundColor, appBar: tabletAppBar(title: YourTendersStrings.yourTenders, key: key), - drawer: TabletNavigationWidget(currentIndex: 1), + drawer: const TabletNavigationWidget(currentIndex: 1), body: Center( child: SizedBox( width: 720, child: Column( children: [ - SizedBox(height: 64.0), + const SizedBox(height: 64.0), Padding( padding: EdgeInsets.symmetric(horizontal: 8.0.w()), - child: TabletDesktopAppbar(), + child: const TabletDesktopAppbar(), ), SizedBox(height: 24.0.h()), - FilterButton(platformType: PlatformType.tabletDesktop), + const FilterButton(platformType: PlatformType.tabletDesktop), Expanded( child: Consumer( @@ -108,7 +109,7 @@ class _YourTendersTabletPageState extends State return Column( children: [ Expanded(child: content), - SizedBox(height: 10.0.h()), + SizedBox(height: 10.0.h()), Row( children: [ @@ -121,15 +122,18 @@ class _YourTendersTabletPageState extends State color: AppColors.grey60, ), ), - SizedBox(width: 10.0.w()), + SizedBox(width: 10.0.w()), InkWell( onTap: () async { final selectedPage = await showDialog( context: context, builder: (context) { return AlertDialog( - backgroundColor: AppColors.backgroundColor, - title: const Text(YourTendersStrings.selectPage), + backgroundColor: + AppColors.backgroundColor, + title: const Text( + YourTendersStrings.selectPage, + ), content: SizedBox( width: 200.0.w(), height: 300.0.h(), @@ -138,11 +142,14 @@ class _YourTendersTabletPageState extends State itemBuilder: (context, index) { final pageNumber = index + 1; return ListTile( - title: Text('${YourTendersStrings.page} $pageNumber'), - onTap: () => Navigator.pop( - context, - pageNumber, + title: Text( + '${YourTendersStrings.page} $pageNumber', ), + onTap: + () => Navigator.pop( + context, + pageNumber, + ), ); }, ), @@ -165,7 +172,7 @@ class _YourTendersTabletPageState extends State ), child: Row( children: [ - SizedBox(width: 5.0.w()), + SizedBox(width: 5.0.w()), Text( '${viewModel.currentPage}', style: TextStyle( @@ -174,14 +181,14 @@ class _YourTendersTabletPageState extends State color: AppColors.grey70, ), ), - SizedBox(width: 5.0.w()), + SizedBox(width: 5.0.w()), const Icon(Icons.arrow_drop_down), - SizedBox(width: 5.0.w()), + SizedBox(width: 5.0.w()), ], ), ), ), - SizedBox(width: 5.0), + const SizedBox(width: 5.0), Text( YourTendersStrings.page, style: TextStyle( @@ -190,7 +197,7 @@ class _YourTendersTabletPageState extends State color: AppColors.grey60, ), ), - SizedBox(width: 5.0.w()), + SizedBox(width: 5.0.w()), Text( '${viewModel.totalPages}', style: TextStyle( diff --git a/lib/views/your_tenders/widgets/filter_button.dart b/lib/views/your_tenders/widgets/filter_button.dart index df23428..d10eb6f 100644 --- a/lib/views/your_tenders/widgets/filter_button.dart +++ b/lib/views/your_tenders/widgets/filter_button.dart @@ -55,8 +55,8 @@ class FilterButton extends StatelessWidget { child: Row( mainAxisSize: MainAxisSize.min, children: [ - Icon(Icons.filter_list, color: Colors.blue), - SizedBox(width: 8), + const Icon(Icons.filter_list, color: Colors.blue), + const SizedBox(width: 8), Text( YourTendersStrings.filter, style: TextStyle( diff --git a/lib/views/your_tenders/widgets/tender_card.dart b/lib/views/your_tenders/widgets/tender_card.dart index b368aab..9b6e388 100644 --- a/lib/views/your_tenders/widgets/tender_card.dart +++ b/lib/views/your_tenders/widgets/tender_card.dart @@ -145,7 +145,7 @@ class TenderCard extends StatelessWidget { ), overflow: TextOverflow.ellipsis, ), - Spacer(), + const Spacer(), // Bottom section with location and action button Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -171,14 +171,14 @@ class TenderCard extends StatelessWidget { SizedBox(width: 8.0.w()), tender.countryCode != null ? Flag(countryCode: tender.countryCode!) - : Flag(countryCode: ''), + : const Flag(countryCode: ''), ], ), ), // Self Control button status == TenderApprovalStatus.rejected.value - ? SizedBox.shrink() + ? const SizedBox.shrink() : Container( padding: EdgeInsets.symmetric( horizontal: 16.0.w(), diff --git a/lib/views/your_tenders/widgets/tenders_submitted.dart b/lib/views/your_tenders/widgets/tenders_submitted.dart index f63f1fa..6675ed4 100644 --- a/lib/views/your_tenders/widgets/tenders_submitted.dart +++ b/lib/views/your_tenders/widgets/tenders_submitted.dart @@ -91,7 +91,7 @@ class _TendersSubmittedState extends State { child: SizedBox( width: 24.0.w(), height: 24.0.h(), - child: CircularProgressIndicator( + child: const CircularProgressIndicator( color: AppColors.secondary50, strokeWidth: 2, ),