1
0
mirror of https://github.com/Uttkarsh-raj/Plannerly.git synced 2025-12-05 22:06:27 +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;
return Scaffold(
backgroundColor: AppColors.backgroundDark,
body: SingleChildScrollView(
child: Padding(
body: Padding(
padding: const EdgeInsets.all(14.0),
child: Stack(
children: [
SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -139,7 +141,8 @@ class _HomeScreenState extends State<HomeScreen> {
child: Padding(
padding: const EdgeInsets.all(5.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
const Expanded(
child: TextField(
@@ -177,7 +180,8 @@ class _HomeScreenState extends State<HomeScreen> {
child: Padding(
padding: const EdgeInsets.all(18.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
@@ -196,8 +200,8 @@ class _HomeScreenState extends State<HomeScreen> {
Text(
"${state.totalRegularTasksCompleted + state.totalUrgentTasksCompleted}/${state.totalRegularTasks + state.totalUrgentTasks} task completed.",
style: TextStyle(
color:
AppColors.white.withOpacity(0.4),
color: AppColors.white
.withOpacity(0.4),
fontSize: 14,
fontWeight: FontWeight.w400,
),
@@ -225,8 +229,8 @@ class _HomeScreenState extends State<HomeScreen> {
valueColor:
const AlwaysStoppedAnimation(
AppColors.buttonBlue),
backgroundColor:
AppColors.white.withOpacity(0.2),
backgroundColor: AppColors.white
.withOpacity(0.2),
color: AppColors.white,
),
),
@@ -293,18 +297,21 @@ class _HomeScreenState extends State<HomeScreen> {
SizedBox(
height: size.height * 0.1,
width: size.height * 0.1,
child: CircularProgressIndicator(
child:
CircularProgressIndicator(
value: (state
.totalUrgentTasksCompleted ==
0)
? 0
: (state.totalUrgentTasksCompleted /
state.totalUrgentTasks),
state
.totalUrgentTasks),
strokeWidth: 7,
valueColor:
AlwaysStoppedAnimation(
Colors.red[400]),
backgroundColor: AppColors.white
backgroundColor: AppColors
.white
.withOpacity(0.2),
color: AppColors.white,
),
@@ -322,7 +329,8 @@ class _HomeScreenState extends State<HomeScreen> {
color: AppColors.white
.withOpacity(0.8),
fontSize: 22,
fontWeight: FontWeight.w600,
fontWeight:
FontWeight.w600,
),
),
),
@@ -380,7 +388,8 @@ class _HomeScreenState extends State<HomeScreen> {
SizedBox(
height: size.height * 0.1,
width: size.height * 0.1,
child: CircularProgressIndicator(
child:
CircularProgressIndicator(
value: (state
.totalRegularTasksCompleted ==
0)
@@ -392,7 +401,8 @@ class _HomeScreenState extends State<HomeScreen> {
valueColor:
AlwaysStoppedAnimation(
Colors.green[400]),
backgroundColor: AppColors.white
backgroundColor: AppColors
.white
.withOpacity(0.2),
color: AppColors.white,
),
@@ -410,7 +420,8 @@ class _HomeScreenState extends State<HomeScreen> {
color: AppColors.white
.withOpacity(0.8),
fontSize: 22,
fontWeight: FontWeight.w600,
fontWeight:
FontWeight.w600,
),
),
),
@@ -452,8 +463,8 @@ class _HomeScreenState extends State<HomeScreen> {
),
TextButton(
onPressed: () {
homeBloc
.add(HomeUrgentTasksViewAllClickedEvent());
homeBloc.add(
HomeUrgentTasksViewAllClickedEvent());
},
child: const Text(
'View all',
@@ -476,7 +487,8 @@ class _HomeScreenState extends State<HomeScreen> {
itemCount: (successState.urgentTasks.length < 2)
? successState.urgentTasks.length
: 2,
separatorBuilder: (BuildContext context, int index) {
separatorBuilder:
(BuildContext context, int index) {
return const SizedBox(height: 15);
},
),
@@ -494,8 +506,8 @@ class _HomeScreenState extends State<HomeScreen> {
),
TextButton(
onPressed: () {
homeBloc
.add(HomeRegularTasksViewAllClickedEvent());
homeBloc.add(
HomeRegularTasksViewAllClickedEvent());
},
child: const Text(
'View all',
@@ -518,13 +530,41 @@ class _HomeScreenState extends State<HomeScreen> {
itemCount: (successState.regularTasks.length < 2)
? successState.regularTasks.length
: 2,
separatorBuilder: (BuildContext context, int index) {
separatorBuilder:
(BuildContext context, int index) {
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:

View File

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