merged login and home

This commit is contained in:
amirrezaghabeli
2025-08-03 09:44:43 +03:30
parent 24e14b325a
commit 7aa082c6c8
40 changed files with 979 additions and 49 deletions
+174
View File
@@ -0,0 +1,174 @@
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();
},
),
);
}
}
+104
View File
@@ -0,0 +1,104 @@
import 'package:flutter/material.dart';
import '../size_config.dart';
class ProgressBarColumn extends StatefulWidget {
const ProgressBarColumn({
super.key,
required this.text,
required this.value,
required this.amount,
});
final String text;
final double value;
final String amount;
@override
State<ProgressBarColumn> createState() => _ProgressBarColumnState();
}
class _ProgressBarColumnState extends State<ProgressBarColumn>
with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _animation;
@override
void initState() {
super.initState();
// Initialize the animation controller
_controller = AnimationController(
vsync: this,
duration: Duration(milliseconds: 1500), // duration of the animation
);
// Create a Tween animation from 0.0 to 0.75
_animation = Tween<double>(
begin: 0.0,
end: widget.value,
).animate(CurvedAnimation(parent: _controller, curve: Curves.easeOut));
// Start the animation
_controller.forward();
}
@override
void dispose() {
_controller.dispose(); // clean up controller
super.dispose();
}
@override
Widget build(BuildContext context) {
return Column(
children: [
Stack(
alignment: Alignment.center,
children: [_progressIndicator(), _centerText()],
),
SizedBox(height: 12.0.h()),
_titleText(),
],
);
}
Widget _progressIndicator() {
return SizedBox(
width: 96.0.w(),
height: 96.0.w(),
child: AnimatedBuilder(
animation: _animation,
builder:
(context, child) => CircularProgressIndicator(
backgroundColor: Color(0xFFE1E1E1),
strokeCap: StrokeCap.round,
strokeWidth: 8.0,
valueColor: AlwaysStoppedAnimation<Color>(Color(0xFF34BCCB)),
value: _animation.value,
),
),
);
}
Widget _centerText() {
return Center(
child: Text(
widget.amount,
style: TextStyle(fontSize: 24.0.sp(), fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
),
);
}
Widget _titleText() {
return Text(
widget.text,
style: TextStyle(
fontSize: 16.0.sp(),
fontWeight: FontWeight.bold,
color: Color(0xFF222222),
),
);
}
}
+73
View File
@@ -0,0 +1,73 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import '../size_config.dart';
class StatisticsCard extends StatelessWidget {
const StatisticsCard({
super.key,
required this.backgroundColor,
required this.iconPath,
required this.title,
required this.amount,
required this.textColor,
required this.onTap,
required this.enableTap,
});
final Color backgroundColor;
final String iconPath;
final String title;
final String amount;
final Color textColor;
final VoidCallback onTap;
final bool enableTap;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: enableTap ? onTap : null,
child: Container(
width: 178.0.w(),
height: 148.0.h(),
padding: EdgeInsets.symmetric(horizontal: 16.0.w(), vertical: 12.0.h()),
decoration: BoxDecoration(
color: backgroundColor,
borderRadius: BorderRadius.circular(8),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SvgPicture.asset(iconPath),
SizedBox(height: 4.0.h()),
Text(
title,
style: TextStyle(
fontSize: 16.0.sp(),
fontWeight: FontWeight.bold,
color: Color(0xFF777777),
),
),
Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
amount,
style: TextStyle(
fontSize: 24.0.sp(),
fontWeight: FontWeight.bold,
color: textColor,
),
),
enableTap
? SvgPicture.asset('assets/icons/arrow-right.svg')
: SizedBox(),
],
),
],
),
),
);
}
}
+111
View File
@@ -0,0 +1,111 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import '../size_config.dart';
class TendersListItem extends StatelessWidget {
const TendersListItem({super.key});
@override
Widget build(BuildContext context) {
return SizedBox(
width: 327.0.w(),
height: 309.0.h(),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.0.w(), vertical: 16.0.h()),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'2025-05-21',
style: TextStyle(
fontSize: 12.0.sp(),
fontWeight: FontWeight.w400,
color: Color(0xFF777777),
),
),
Container(
width: 91.0.w(),
height: 24.0.h(),
decoration: BoxDecoration(
color: Color(0xFFDAF8D6),
borderRadius: BorderRadius.circular(8),
),
alignment: Alignment.center,
child: Text(
'Completed',
style: TextStyle(
fontSize: 12.0.sp(),
fontWeight: FontWeight.w500,
color: Color(0xFF289744),
),
),
),
],
),
SizedBox(height: 12.0.h()),
Text(
'Lorem ipsum dolor sit amet consectetur. Sed mi tortor eu purus senectus.',
style: TextStyle(
fontSize: 16.0.sp(),
fontWeight: FontWeight.w600,
color: Color(0xFF222222),
),
),
SizedBox(height: 8.0.h()),
Text(
'Lorem ipsum dolor sit amet consectetur. Volutpat velit tincidunt amet diam. Placerat congue ut Sed facilisis faucibus porttitor. Proin suspendisse eu euismod sit lorem quis. Suscipit ...',
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w400,
color: Color(0xFF222222),
),
),
SizedBox(height: 24.0.h()),
Row(
children: [
SvgPicture.asset('assets/icons/location.svg'),
SizedBox(width: 1.0.w()),
Text(
'Location',
style: TextStyle(
fontSize: 12.0.sp(),
fontWeight: FontWeight.w400,
color: Color(0xFF777777),
),
),
SizedBox(width: 8.0.w()),
SizedBox(
width: 32.0.w(),
height: 21.0.h(),
child: Image.asset('assets/icons/SE.png', fit: BoxFit.cover),
),
Spacer(),
Container(
width: 96.0.w(),
height: 24.0.h(),
decoration: BoxDecoration(
color: Color(0xFFE4E4E4),
borderRadius: BorderRadius.circular(88),
border: Border.all(color: Color(0xFFDADADA)),
),
alignment: Alignment.center,
child: Text(
'Self Control',
style: TextStyle(
fontSize: 12.0.sp(),
fontWeight: FontWeight.w500,
color: Color(0xFF777777),
),
),
),
],
),
],
),
),
);
}
}
+3
View File
@@ -0,0 +1,3 @@
export 'progress_bar_column.dart';
export 'statistics_card.dart';
export 'tenders_list_item.dart';