From 6bae9e389c01ed5f443782fab0b9701f4aa7f155 Mon Sep 17 00:00:00 2001 From: Manish Date: Tue, 18 Nov 2025 16:25:25 +0530 Subject: [PATCH] Done all screen landscape responsive for mobile and tablet --- lib/view/layouts/user_profile_right_bar.dart | 88 ++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/lib/view/layouts/user_profile_right_bar.dart b/lib/view/layouts/user_profile_right_bar.dart index 17ef20d..a067379 100644 --- a/lib/view/layouts/user_profile_right_bar.dart +++ b/lib/view/layouts/user_profile_right_bar.dart @@ -15,6 +15,18 @@ import 'package:on_field_work/helpers/services/tenant_service.dart'; import 'package:on_field_work/view/tenant/tenant_selection_screen.dart'; import 'package:on_field_work/controller/tenant/tenant_switch_controller.dart'; import 'package:on_field_work/helpers/theme/theme_editor_widget.dart'; +import 'package:marco/helpers/services/storage/local_storage.dart'; +import 'package:marco/helpers/utils/mixins/ui_mixin.dart'; +import 'package:marco/helpers/widgets/my_spacing.dart'; +import 'package:marco/helpers/widgets/my_text.dart'; +import 'package:marco/helpers/widgets/avatar.dart'; +import 'package:marco/model/employees/employee_info.dart'; +import 'package:marco/controller/auth/mpin_controller.dart'; +import 'package:marco/view/employees/employee_profile_screen.dart'; +import 'package:marco/helpers/services/tenant_service.dart'; +import 'package:marco/view/tenant/tenant_selection_screen.dart'; +import 'package:marco/controller/tenant/tenant_switch_controller.dart'; +import 'package:marco/helpers/theme/theme_editor_widget.dart'; class UserProfileBar extends StatefulWidget { final bool isCondensed; @@ -53,6 +65,7 @@ class _UserProfileBarState extends State Widget build(BuildContext context) { final bool isCondensed = widget.isCondensed; + return Padding( padding: const EdgeInsets.only(left: 14), child: ClipRRect( @@ -146,6 +159,66 @@ class _UserProfileBarState extends State ], ), ), + bottom: true, + child: Stack( + children: [ + // ======================= MAIN PROFILE SIDEBAR ======================= + Offstage( + offstage: _isThemeEditorVisible, + child: LayoutBuilder( + builder: (context, constraints) { + return SingleChildScrollView( + physics: const ClampingScrollPhysics(), + child: ConstrainedBox( + constraints: BoxConstraints( + minHeight: constraints.maxHeight), + child: IntrinsicHeight( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + _isLoading + ? const _LoadingSection() + : _userProfileSection(isCondensed), + if (!_isLoading && !isCondensed) + _switchTenantRow(), + MySpacing.height(12), + Divider( + indent: 18, + endIndent: 18, + thickness: 0.7, + color: Colors.grey.withOpacity(0.25), + ), + MySpacing.height(12), + _supportAndSettingsMenu(isCondensed), + const Spacer(), + Divider( + indent: 18, + endIndent: 18, + thickness: 0.35, + color: Colors.grey.withOpacity(0.18), + ), + _logoutButton(isCondensed), + ], + ), + ), + ), + ); + }, + ), + ), + + // ======================= THEME EDITOR VIEW ======================= + Offstage( + offstage: !_isThemeEditorVisible, + child: ThemeEditorWidget( + onClose: () { + setState(() => _isThemeEditorVisible = false); + }, + ), + ), + ], + ), + ), ), ), ), @@ -154,6 +227,8 @@ class _UserProfileBarState extends State // ==================== EXISTING CODE (UNCHANGED) ===================== + // ==================== EXISTING CODE (UNCHANGED) ===================== + Widget _switchTenantRow() { final TenantSwitchController tenantSwitchController = Get.put(TenantSwitchController()); @@ -257,6 +332,7 @@ class _UserProfileBarState extends State child: const Center(child: CircularProgressIndicator(strokeWidth: 2)), ); + // ⭐ FIXED — YOUR ORIGINAL INTENT, COMPLETED PROPERLY // ⭐ FIXED — YOUR ORIGINAL INTENT, COMPLETED PROPERLY Widget _noTenantContainer() => Container( padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16), @@ -267,7 +343,19 @@ class _UserProfileBarState extends State color: Colors.blue.shade200, width: 1, ), + border: Border.all( + color: Colors.blue.shade200, + width: 1, + ), ), + child: const Center( + child: Text( + "No organizations available", + style: TextStyle( + fontWeight: FontWeight.w600, + color: Colors.black87, + ), + ), child: const Center( child: Text( "No organizations available",