Project section started
This commit is contained in:
@@ -118,6 +118,7 @@ class Project{
|
||||
static String colCat="category_id";
|
||||
static String colSteps = "steps";
|
||||
static String colDeadline = "deadline";
|
||||
static String colEta = "eta";
|
||||
}
|
||||
|
||||
class ProjectStep{
|
||||
|
||||
@@ -31,6 +31,7 @@ class _NewTaskState extends State<NewTask> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<String> cats = getCategoryNames();
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text('New Task Type')),
|
||||
body: Container(
|
||||
@@ -77,7 +78,7 @@ class _NewTaskState extends State<NewTask> {
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
value: selectedCat,
|
||||
isExpanded: true,
|
||||
items: getCategoryNames().map<DropdownMenuItem<String>>(
|
||||
items: cats.map<DropdownMenuItem<String>>(
|
||||
(String value) {
|
||||
|
||||
return DropdownMenuItem<String>(
|
||||
|
||||
@@ -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,7 +115,10 @@ class _ProjectsState extends State<Projects> {
|
||||
children:[
|
||||
Expanded(
|
||||
child: Card(
|
||||
child:InkWell(
|
||||
child:AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
height: 100,
|
||||
child: InkWell(
|
||||
onLongPress: (){
|
||||
Dialogs.showProjectDetails(project);
|
||||
},
|
||||
@@ -145,6 +163,7 @@ class _ProjectsState extends State<Projects> {
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -210,7 +210,7 @@ void onCacheDatabaseCreate(Database db, int newVersion) async {
|
||||
await db.execute(ActivityTableSQL);
|
||||
|
||||
String ProjectsTableSQL =
|
||||
'CREATE TABLE Projects(id TEXT PRIMARY KEY, ${Project.colName} TEXT, ${Project.colCat} TEXT, ${Project.colSteps} TEXT, ${Project.colDeadline} DATETIME)';
|
||||
'CREATE TABLE Projects(id TEXT PRIMARY KEY, ${Project.colName} TEXT, ${Project.colCat} TEXT, ${Project.colSteps} TEXT, ${Project.colEta} INT, ${Project.colDeadline} DATETIME)';
|
||||
await db.execute(ProjectsTableSQL);
|
||||
|
||||
String QueriesTableSQL = 'CREATE TABLE Queries(id INTEGER PRIMARY KEY AUTOINCREMENT, ${Queries.colLink} TEXT,${Queries.colData} TEXT)';
|
||||
@@ -327,7 +327,7 @@ Future<void> UpdateCategoriesFromServer() async {
|
||||
|
||||
print(response.body);
|
||||
List<String> data = response.body.split("<td>");
|
||||
// await cacheDb.delete("Categories");
|
||||
await cacheDb.delete("Categories");
|
||||
for (var value in data) {
|
||||
Map<String, dynamic> cat = jsonDecode(value);
|
||||
//print(catData);
|
||||
|
||||
Reference in New Issue
Block a user