1
0
mirror of https://github.com/Uttkarsh-raj/Plannerly.git synced 2025-11-29 21:57:34 +02:00
This commit is contained in:
Uttkarsh-raj
2023-11-03 23:16:14 +05:30
parent 5770dc9106
commit 1cbbdf1677
2 changed files with 441 additions and 401 deletions

View File

@@ -89,9 +89,11 @@ class _HomeScreenState extends State<HomeScreen> {
final successState = state as HomeLoadedSuccessState; final successState = state as HomeLoadedSuccessState;
return Scaffold( return Scaffold(
backgroundColor: AppColors.backgroundDark, backgroundColor: AppColors.backgroundDark,
body: SingleChildScrollView( body: Padding(
child: Padding(
padding: const EdgeInsets.all(14.0), padding: const EdgeInsets.all(14.0),
child: Stack(
children: [
SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@@ -139,7 +141,8 @@ class _HomeScreenState extends State<HomeScreen> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(5.0), padding: const EdgeInsets.all(5.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
const Expanded( const Expanded(
child: TextField( child: TextField(
@@ -177,7 +180,8 @@ class _HomeScreenState extends State<HomeScreen> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(18.0), padding: const EdgeInsets.all(18.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
@@ -196,8 +200,8 @@ class _HomeScreenState extends State<HomeScreen> {
Text( Text(
"${state.totalRegularTasksCompleted + state.totalUrgentTasksCompleted}/${state.totalRegularTasks + state.totalUrgentTasks} task completed.", "${state.totalRegularTasksCompleted + state.totalUrgentTasksCompleted}/${state.totalRegularTasks + state.totalUrgentTasks} task completed.",
style: TextStyle( style: TextStyle(
color: color: AppColors.white
AppColors.white.withOpacity(0.4), .withOpacity(0.4),
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
), ),
@@ -225,8 +229,8 @@ class _HomeScreenState extends State<HomeScreen> {
valueColor: valueColor:
const AlwaysStoppedAnimation( const AlwaysStoppedAnimation(
AppColors.buttonBlue), AppColors.buttonBlue),
backgroundColor: backgroundColor: AppColors.white
AppColors.white.withOpacity(0.2), .withOpacity(0.2),
color: AppColors.white, color: AppColors.white,
), ),
), ),
@@ -293,18 +297,21 @@ class _HomeScreenState extends State<HomeScreen> {
SizedBox( SizedBox(
height: size.height * 0.1, height: size.height * 0.1,
width: size.height * 0.1, width: size.height * 0.1,
child: CircularProgressIndicator( child:
CircularProgressIndicator(
value: (state value: (state
.totalUrgentTasksCompleted == .totalUrgentTasksCompleted ==
0) 0)
? 0 ? 0
: (state.totalUrgentTasksCompleted / : (state.totalUrgentTasksCompleted /
state.totalUrgentTasks), state
.totalUrgentTasks),
strokeWidth: 7, strokeWidth: 7,
valueColor: valueColor:
AlwaysStoppedAnimation( AlwaysStoppedAnimation(
Colors.red[400]), Colors.red[400]),
backgroundColor: AppColors.white backgroundColor: AppColors
.white
.withOpacity(0.2), .withOpacity(0.2),
color: AppColors.white, color: AppColors.white,
), ),
@@ -322,7 +329,8 @@ class _HomeScreenState extends State<HomeScreen> {
color: AppColors.white color: AppColors.white
.withOpacity(0.8), .withOpacity(0.8),
fontSize: 22, fontSize: 22,
fontWeight: FontWeight.w600, fontWeight:
FontWeight.w600,
), ),
), ),
), ),
@@ -380,7 +388,8 @@ class _HomeScreenState extends State<HomeScreen> {
SizedBox( SizedBox(
height: size.height * 0.1, height: size.height * 0.1,
width: size.height * 0.1, width: size.height * 0.1,
child: CircularProgressIndicator( child:
CircularProgressIndicator(
value: (state value: (state
.totalRegularTasksCompleted == .totalRegularTasksCompleted ==
0) 0)
@@ -392,7 +401,8 @@ class _HomeScreenState extends State<HomeScreen> {
valueColor: valueColor:
AlwaysStoppedAnimation( AlwaysStoppedAnimation(
Colors.green[400]), Colors.green[400]),
backgroundColor: AppColors.white backgroundColor: AppColors
.white
.withOpacity(0.2), .withOpacity(0.2),
color: AppColors.white, color: AppColors.white,
), ),
@@ -410,7 +420,8 @@ class _HomeScreenState extends State<HomeScreen> {
color: AppColors.white color: AppColors.white
.withOpacity(0.8), .withOpacity(0.8),
fontSize: 22, fontSize: 22,
fontWeight: FontWeight.w600, fontWeight:
FontWeight.w600,
), ),
), ),
), ),
@@ -452,8 +463,8 @@ class _HomeScreenState extends State<HomeScreen> {
), ),
TextButton( TextButton(
onPressed: () { onPressed: () {
homeBloc homeBloc.add(
.add(HomeUrgentTasksViewAllClickedEvent()); HomeUrgentTasksViewAllClickedEvent());
}, },
child: const Text( child: const Text(
'View all', 'View all',
@@ -476,7 +487,8 @@ class _HomeScreenState extends State<HomeScreen> {
itemCount: (successState.urgentTasks.length < 2) itemCount: (successState.urgentTasks.length < 2)
? successState.urgentTasks.length ? successState.urgentTasks.length
: 2, : 2,
separatorBuilder: (BuildContext context, int index) { separatorBuilder:
(BuildContext context, int index) {
return const SizedBox(height: 15); return const SizedBox(height: 15);
}, },
), ),
@@ -494,8 +506,8 @@ class _HomeScreenState extends State<HomeScreen> {
), ),
TextButton( TextButton(
onPressed: () { onPressed: () {
homeBloc homeBloc.add(
.add(HomeRegularTasksViewAllClickedEvent()); HomeRegularTasksViewAllClickedEvent());
}, },
child: const Text( child: const Text(
'View all', 'View all',
@@ -518,13 +530,41 @@ class _HomeScreenState extends State<HomeScreen> {
itemCount: (successState.regularTasks.length < 2) itemCount: (successState.regularTasks.length < 2)
? successState.regularTasks.length ? successState.regularTasks.length
: 2, : 2,
separatorBuilder: (BuildContext context, int index) { separatorBuilder:
(BuildContext context, int index) {
return const SizedBox(height: 15); return const SizedBox(height: 15);
}, },
), ),
SizedBox(height: size.height * 0.1),
], ],
), ),
), ),
Positioned(
width: size.width,
bottom: 8,
child: Center(
child: Container(
width: size.width * 0.7,
height: size.height * 0.07,
decoration: BoxDecoration(
color: AppColors.buttonBlue,
borderRadius: BorderRadius.circular(16),
),
child: const Center(
child: Text(
"Add new task +",
style: TextStyle(
color: AppColors.white,
fontSize: 20,
fontWeight: FontWeight.w400,
),
),
),
),
),
),
],
),
), ),
); );
case HomeLoadedErrorState: case HomeLoadedErrorState:

View File

@@ -1,4 +1,4 @@
//just for testing //just for testing
var baseUrl = "http://192.168.235.52:8000"; var baseUrl = "http://192.168.2.52:8000";
var token = var token =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6ImpvaG4uZG9lQGdtYWlsLmNvbSIsIkZpcnN0X25hbWUiOiJKb2huIiwiTGFzdF9uYW1lIjoiRG9lIiwiVWlkIjoiNjUzYTJmNzFlMjMzMGFjMzY5ZTkzYzliIiwiZXhwIjoxNjk5MDI4NDM4fQ.1doJ9tOyRHosZAYM3dD1rxGhbxPg3laHVzYvGeGHKGQ"; "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6ImpvaG4uZG9lQGdtYWlsLmNvbSIsIkZpcnN0X25hbWUiOiJKb2huIiwiTGFzdF9uYW1lIjoiRG9lIiwiVWlkIjoiNjUzYTJmNzFlMjMzMGFjMzY5ZTkzYzliIiwiZXhwIjoxNjk5MTE1MTQxfQ.l-yfrvG282TdOXrkR5rUsokNI97OimWNf4eI3uR4UPY";