import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:on_field_work/view/employees/employee_detail_screen.dart'; import 'package:on_field_work/view/document/user_document_screen.dart'; import 'package:on_field_work/helpers/widgets/custom_app_bar.dart'; import 'package:on_field_work/helpers/utils/mixins/ui_mixin.dart'; class EmployeeProfilePage extends StatefulWidget { final String employeeId; const EmployeeProfilePage({super.key, required this.employeeId}); @override State createState() => _EmployeeProfilePageState(); } class _EmployeeProfilePageState extends State with SingleTickerProviderStateMixin, UIMixin { late TabController _tabController; @override void initState() { super.initState(); _tabController = TabController(length: 2, vsync: this); } @override void dispose() { _tabController.dispose(); super.dispose(); } @override Widget build(BuildContext context) { final Color appBarColor = contentTheme.primary; return Scaffold( backgroundColor: const Color(0xFFF1F1F1), appBar: CustomAppBar( title: "Employee Profile", onBackPressed: () => Get.back(), backgroundColor: appBarColor, ), body: Stack( children: [ // === Gradient at the top behind AppBar + TabBar === Container( height: 50, decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ appBarColor, appBarColor.withOpacity(0.0), ], ), ), ), SafeArea( top: false, bottom: true, child: Column( children: [ Container( decoration: const BoxDecoration(color: Colors.transparent), child: TabBar( controller: _tabController, labelColor: Colors.white, unselectedLabelColor: Colors.white70, indicatorColor: Colors.white, indicatorWeight: 3, tabs: const [ Tab(text: "Details"), Tab(text: "Documents"), ], ), ), Expanded( child: TabBarView( controller: _tabController, children: [ EmployeeDetailPage( employeeId: widget.employeeId, fromProfile: true, ), UserDocumentsPage( entityId: widget.employeeId, isEmployee: true, ), ], ), ), ], ), ), ], ), ); } }