Done all screen landscape responsive for mobile and tablet
This commit is contained in:
parent
a79ab9fcab
commit
f73643b391
@ -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/view/tenant/tenant_selection_screen.dart';
|
||||||
import 'package:on_field_work/controller/tenant/tenant_switch_controller.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: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 {
|
class UserProfileBar extends StatefulWidget {
|
||||||
final bool isCondensed;
|
final bool isCondensed;
|
||||||
@ -53,6 +65,7 @@ class _UserProfileBarState extends State<UserProfileBar>
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final bool isCondensed = widget.isCondensed;
|
final bool isCondensed = widget.isCondensed;
|
||||||
|
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(left: 14),
|
padding: const EdgeInsets.only(left: 14),
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
@ -146,6 +159,66 @@ class _UserProfileBarState extends State<UserProfileBar>
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
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<UserProfileBar>
|
|||||||
|
|
||||||
// ==================== EXISTING CODE (UNCHANGED) =====================
|
// ==================== EXISTING CODE (UNCHANGED) =====================
|
||||||
|
|
||||||
|
// ==================== EXISTING CODE (UNCHANGED) =====================
|
||||||
|
|
||||||
Widget _switchTenantRow() {
|
Widget _switchTenantRow() {
|
||||||
final TenantSwitchController tenantSwitchController =
|
final TenantSwitchController tenantSwitchController =
|
||||||
Get.put(TenantSwitchController());
|
Get.put(TenantSwitchController());
|
||||||
@ -257,6 +332,7 @@ class _UserProfileBarState extends State<UserProfileBar>
|
|||||||
child: const Center(child: CircularProgressIndicator(strokeWidth: 2)),
|
child: const Center(child: CircularProgressIndicator(strokeWidth: 2)),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// ⭐ FIXED — YOUR ORIGINAL INTENT, COMPLETED PROPERLY
|
||||||
// ⭐ FIXED — YOUR ORIGINAL INTENT, COMPLETED PROPERLY
|
// ⭐ FIXED — YOUR ORIGINAL INTENT, COMPLETED PROPERLY
|
||||||
Widget _noTenantContainer() => Container(
|
Widget _noTenantContainer() => Container(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
|
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
|
||||||
@ -267,6 +343,18 @@ class _UserProfileBarState extends State<UserProfileBar>
|
|||||||
color: Colors.blue.shade200,
|
color: Colors.blue.shade200,
|
||||||
width: 1,
|
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: const Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user