Files
tm_app/lib/home/home_page.dart
T
2025-08-03 09:44:43 +03:30

175 lines
4.2 KiB
Dart

import 'package:flutter/material.dart';
import '../../bottom_navigation.dart';
import '../../constants/app_strings.dart';
import '../../size_config.dart';
import 'widgets.dart';
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: _body(),
bottomNavigationBar: BottomNavigation(),
);
}
SafeArea _body() {
return SafeArea(
child: ListView(
children: [
Padding(
padding: EdgeInsetsDirectional.fromSTEB(
24.0.w(),
26.0.h(),
24.0.w(),
24.0.h(),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_appbar(),
SizedBox(height: 32.0.h()),
_progressBarsRow(),
SizedBox(height: 32.0.h()),
_firstStatisticsRow(),
SizedBox(height: 8.0.h()),
_secondStatisticsRow(),
SizedBox(height: 32.0.h()),
_yourTenderText(),
SizedBox(height: 28.0.h()),
_bottomListView(),
],
),
),
],
),
);
}
Widget _appbar() {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
AppStrings.home,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Color(0xFF222222),
),
),
Image.asset(
'assets/icons/tenderLogo.png',
width: 59.0.w(),
height: 28.0.h(),
fit: BoxFit.cover,
),
],
);
}
Widget _progressBarsRow() {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ProgressBarColumn(
text: AppStrings.partnership,
value: 0.75,
amount: '75%',
),
ProgressBarColumn(
text: AppStrings.selfApply,
value: 0.88,
amount: '12',
),
ProgressBarColumn(
text: AppStrings.contracting,
value: 0.36,
amount: '36',
),
],
);
}
Widget _firstStatisticsRow() {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
StatisticsCard(
backgroundColor: Color(0xFFE5EFFF),
iconPath: 'assets/icons/arrows.svg',
title: AppStrings.tenderSubmitting,
amount: '12',
textColor: Color(0xFF0164FF),
enableTap: true,
onTap: () {},
),
StatisticsCard(
backgroundColor: Color(0xFFEAF8F9),
iconPath: 'assets/icons/thumb.svg',
title: AppStrings.approvedTenders,
amount: '03',
textColor: Color(0xFF24848E),
enableTap: true,
onTap: () {},
),
],
);
}
Widget _secondStatisticsRow() {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
StatisticsCard(
backgroundColor: Color(0xFFFFF2E0),
iconPath: 'assets/icons/shield.svg',
title: AppStrings.tenderValue,
amount: '\$250,000',
textColor: Color(0xFFE5821E),
enableTap: true,
onTap: () {},
),
StatisticsCard(
backgroundColor: Color(0xFFF4F4F4),
iconPath: 'assets/icons/edit.svg',
title: AppStrings.thunderStatus,
amount: '23',
textColor: Color(0xFF9E9E9E),
enableTap: false,
onTap: () {},
),
],
);
}
Widget _yourTenderText() {
return Text(
AppStrings.yourTenders,
style: TextStyle(
fontSize: 20.0.sp(),
fontWeight: FontWeight.w600,
color: Color(0xFF777777),
),
);
}
Widget _bottomListView() {
return SizedBox(
width: double.infinity,
height: 310.0.h(),
child: ListView.builder(
itemCount: 10,
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
return TendersListItem();
},
),
);
}
}