Project section started
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:tasktracker/Data.dart';
|
||||
import 'package:tasktracker/NewProject.dart';
|
||||
@@ -30,7 +31,7 @@ class _ProjectsState extends State<Projects> {
|
||||
super.dispose();
|
||||
refreshSub?.close();
|
||||
}
|
||||
|
||||
int selectedPage = 0;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SafeArea(child: Scaffold(
|
||||
@@ -40,6 +41,18 @@ class _ProjectsState extends State<Projects> {
|
||||
},
|
||||
label: Text("New Project"),
|
||||
icon: Icon(Icons.add)),
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
items: <BottomNavigationBarItem>[
|
||||
BottomNavigationBarItem(icon: FaIcon(FontAwesomeIcons.newspaper),label:'Summary'),
|
||||
BottomNavigationBarItem(icon: FaIcon(FontAwesomeIcons.info),label:'Details'),
|
||||
],
|
||||
onTap: (val){
|
||||
selectedPage= val;
|
||||
setState(() {
|
||||
|
||||
});
|
||||
},
|
||||
),
|
||||
appBar: AppBar(
|
||||
title: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
@@ -72,7 +85,9 @@ class _ProjectsState extends State<Projects> {
|
||||
],
|
||||
)),
|
||||
drawer: navDrawer(context, 7),
|
||||
body: Container(
|
||||
body: (selectedPage == 0) ?
|
||||
Container(child:Text('Summary goes here'))
|
||||
:Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Column(
|
||||
children: printProjects(),
|
||||
@@ -100,49 +115,53 @@ class _ProjectsState extends State<Projects> {
|
||||
children:[
|
||||
Expanded(
|
||||
child: Card(
|
||||
child:InkWell(
|
||||
onLongPress: (){
|
||||
Dialogs.showProjectDetails(project);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(project.name ,style: TextStyle(fontSize: 18)),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: (project.cat!.productive) ?Colors.green : Colors.red,
|
||||
borderRadius: BorderRadius.circular(8)
|
||||
),
|
||||
child:Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 2),
|
||||
child: Text(project.cat!.name),
|
||||
))
|
||||
],
|
||||
),
|
||||
Divider(),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("${project.steps.length} steps"),
|
||||
Container(
|
||||
child:AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
height: 100,
|
||||
child: InkWell(
|
||||
onLongPress: (){
|
||||
Dialogs.showProjectDetails(project);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(project.name ,style: TextStyle(fontSize: 18)),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.redAccent,
|
||||
borderRadius: BorderRadius.circular(8)
|
||||
color: (project.cat!.productive) ?Colors.green : Colors.red,
|
||||
borderRadius: BorderRadius.circular(8)
|
||||
),
|
||||
child:Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 2),
|
||||
// padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 2),
|
||||
child: Text(durationToDays(timeLeft)),
|
||||
// child: Text("Deadline : " +DateFormat("yyyy-MM-dd").format(project.deadline)),
|
||||
))
|
||||
],
|
||||
)
|
||||
],
|
||||
child:Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 2),
|
||||
child: Text(project.cat!.name),
|
||||
))
|
||||
],
|
||||
),
|
||||
Divider(),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("${project.steps.length} steps"),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.redAccent,
|
||||
borderRadius: BorderRadius.circular(8)
|
||||
),
|
||||
child:Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 2),
|
||||
// padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 2),
|
||||
child: Text(durationToDays(timeLeft)),
|
||||
// child: Text("Deadline : " +DateFormat("yyyy-MM-dd").format(project.deadline)),
|
||||
))
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user