refactor: Replace header implementation with ReportsHeader widget for cleaner code
This commit is contained in:
@@ -86,88 +86,10 @@ class _ReportsPageState extends State<ReportsPage>
|
|||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
// Header
|
// Header with title and tabs
|
||||||
Container(
|
ReportsHeader(
|
||||||
padding: const EdgeInsets.only(
|
tabController: _tabController,
|
||||||
top: 60,
|
onTabChanged: _loadSummary,
|
||||||
left: 20,
|
|
||||||
right: 20,
|
|
||||||
bottom: 32,
|
|
||||||
),
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
gradient: LinearGradient(
|
|
||||||
colors: [
|
|
||||||
UiColors.primary,
|
|
||||||
UiColors.buttonPrimaryHover,
|
|
||||||
],
|
|
||||||
begin: Alignment.topLeft,
|
|
||||||
end: Alignment.bottomRight,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
GestureDetector(
|
|
||||||
onTap: () => Modular.to.toClientHome(),
|
|
||||||
child: Container(
|
|
||||||
width: 40,
|
|
||||||
height: 40,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: UiColors.white.withOpacity(0.2),
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
),
|
|
||||||
child: const Icon(
|
|
||||||
UiIcons.arrowLeft,
|
|
||||||
color: UiColors.white,
|
|
||||||
size: 20,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 12),
|
|
||||||
Text(
|
|
||||||
context.t.client_reports.title,
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: UiColors.white,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(height: 24),
|
|
||||||
// Tabs
|
|
||||||
Container(
|
|
||||||
height: 44,
|
|
||||||
padding: const EdgeInsets.all(4)
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: UiColors.white.withOpacity(0.2)
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
),
|
|
||||||
child: TabBar(
|
|
||||||
controller: _tabController,
|
|
||||||
indicator: BoxDecoration(
|
|
||||||
color: UiColors.white,
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
labelColor: UiColors.primary,
|
|
||||||
unselectedLabelColor: UiColors.white,
|
|
||||||
labelStyle: const TextStyle(
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
fontSize: 14,
|
|
||||||
),
|
|
||||||
indicatorSize: TabBarIndicatorSize.tab,
|
|
||||||
dividerColor: Colors.transparent,
|
|
||||||
tabs: [
|
|
||||||
Tab(text: context.t.client_reports.tabs.today),
|
|
||||||
Tab(text: context.t.client_reports.tabs.week),
|
|
||||||
Tab(text: context.t.client_reports.tabs.month),
|
|
||||||
Tab(text: context.t.client_reports.tabs.quarter),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
|
||||||
// Content
|
// Content
|
||||||
|
|||||||
Reference in New Issue
Block a user