- Replaced existing AppBar implementations with CustomAppBar in multiple screens including PaymentRequestDetailScreen, PaymentRequestMainScreen, ServiceProjectDetailsScreen, JobDetailsScreen, DailyProgressReportScreen, DailyTaskPlanningScreen, and ServiceProjectScreen. - Enhanced visual hierarchy by adding gradient backgrounds behind app bars for better aesthetics. - Streamlined SafeArea usage to ensure proper content display across different devices. - Improved code readability and maintainability by removing redundant code and consolidating UI elements.
102 lines
3.0 KiB
Dart
102 lines
3.0 KiB
Dart
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<EmployeeProfilePage> createState() => _EmployeeProfilePageState();
|
|
}
|
|
|
|
class _EmployeeProfilePageState extends State<EmployeeProfilePage>
|
|
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,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|