Related Project added to TaskType
This commit is contained in:
@@ -31,13 +31,20 @@ class _ProjectsState extends State<Projects> {
|
||||
super.dispose();
|
||||
refreshSub?.close();
|
||||
}
|
||||
|
||||
void refresh(){
|
||||
setState(() {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
int selectedPage = 0;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SafeArea(child: Scaffold(
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context) => NewProject())).then((value) => {User.refreshUserData().then((va) => {})});
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context) => NewProject())).then((value) => {User.refreshUserData().then((va) => {refresh()})});
|
||||
},
|
||||
label: Text("New Project"),
|
||||
icon: Icon(Icons.add)),
|
||||
@@ -69,7 +76,9 @@ class _ProjectsState extends State<Projects> {
|
||||
? Icon(Icons.signal_cellular_connected_no_internet_4_bar_outlined)
|
||||
: InkWell(
|
||||
onTap: () async{
|
||||
await User.refreshUserData();
|
||||
User.refreshUserData().then((val){setState(() {
|
||||
|
||||
});});
|
||||
setState(() {
|
||||
//LoadStats();
|
||||
|
||||
@@ -86,11 +95,19 @@ class _ProjectsState extends State<Projects> {
|
||||
)),
|
||||
drawer: navDrawer(context, 7),
|
||||
body: (selectedPage == 0) ?
|
||||
Container(child:Text('Summary goes here'))
|
||||
Container(child: Column(
|
||||
children: [
|
||||
|
||||
],
|
||||
))
|
||||
:Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Column(
|
||||
children: printProjects(),
|
||||
children: [
|
||||
Column(
|
||||
children: printProjects(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
@@ -98,8 +115,9 @@ class _ProjectsState extends State<Projects> {
|
||||
|
||||
List<Widget> printProjects(){
|
||||
List<Widget> projectWidgets = [];
|
||||
|
||||
print(User.projects.length);
|
||||
for (var element in User.projects) {
|
||||
print(element.name);
|
||||
if(element.cat==null){print(element.name + " has no cat");continue;}
|
||||
projectWidgets.add(ProjectCard(element));
|
||||
}
|
||||
@@ -146,7 +164,7 @@ class _ProjectsState extends State<Projects> {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("${project.steps.length} steps"),
|
||||
(project.steps.length > 0) ? Text("${project.steps.length} steps") : Container(),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.redAccent,
|
||||
|
||||
Reference in New Issue
Block a user