Desktop test
This commit is contained in:
@@ -96,7 +96,7 @@ class Queries{
|
||||
}
|
||||
|
||||
class Project{
|
||||
Project(this.name, this.category, this.steps, this.deadline);
|
||||
Project(this.name, this.category, this.steps, this.deadline,{this.cat});
|
||||
|
||||
String name;
|
||||
String category;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:tasktracker/Data.dart';
|
||||
import 'package:tasktracker/NewProject.dart';
|
||||
import 'User.dart' as User;
|
||||
@@ -65,6 +66,7 @@ class _ProjectsState extends State<Projects> {
|
||||
List<Widget> projectWidgets = [];
|
||||
|
||||
for (var element in User.projects) {
|
||||
if(element.cat==null){print(element.name + " has no cat");continue;}
|
||||
projectWidgets.add(ProjectCard(element));
|
||||
}
|
||||
|
||||
@@ -82,22 +84,42 @@ class _ProjectsState extends State<Projects> {
|
||||
onTap: (){},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Row(
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(project.name),
|
||||
Text(project.name ,style: TextStyle(fontSize: 18)),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.green,
|
||||
color: (project.cat!.productive) ?Colors.green : Colors.red,
|
||||
borderRadius: BorderRadius.circular(8)
|
||||
),
|
||||
child:Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 2),
|
||||
child: Text("Work"),
|
||||
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),
|
||||
child: Text("Deadline : " +DateFormat("yyyy-MM-dd").format(project.deadline)),
|
||||
))
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
@@ -12,10 +12,10 @@ import 'package:http/http.dart' as http;
|
||||
import 'dart:convert';
|
||||
import 'Data.dart';
|
||||
import 'package:sqflite/sqflite.dart';
|
||||
import 'package:sqflite_common_ffi/sqflite_ffi.dart' as SqlFF;
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:sqflite_common/sqlite_api.dart';
|
||||
import 'package:sqflite_common_ffi/sqflite_ffi.dart' as SqlFF;
|
||||
import 'Tasks.dart';
|
||||
import 'Dialogs.dart';
|
||||
|
||||
@@ -564,7 +564,7 @@ Future<List<Project>> GetProjects(bool forceOffline) async {
|
||||
});
|
||||
// print(steps);
|
||||
|
||||
_projects.add(Project(name.replaceAll(username, ""),category,steps,DateTime.parse(deadline)));
|
||||
_projects.add(Project(name.replaceAll(username, ""),category,steps,DateTime.parse(deadline),cat: cat));
|
||||
}
|
||||
projects = _projects;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user