Projects section usable, Sticky headers added
This commit is contained in:
@@ -51,11 +51,12 @@ class _ProjectDetailsState extends State<ProjectDetails> {
|
||||
(chartRange == null) || (chartRange != null && chartRange!.start.isBefore(element.startTime) && chartRange!.end.isAfter(element.endTime));
|
||||
if (element.taskType.relatedProject != null && element.taskType.relatedProject!.name == project.name) {
|
||||
print('here');
|
||||
|
||||
if (firstDateTime == null) {
|
||||
firstDateTime = element.startTime;
|
||||
}
|
||||
lastDateTime = element.startTime;
|
||||
if (withinRange) {
|
||||
if (firstDateTime == null) {
|
||||
firstDateTime = element.startTime;
|
||||
}
|
||||
lastDateTime = element.startTime;
|
||||
|
||||
if (lastDay != element.startTime.day) {
|
||||
if (totalTimeSpent > 0) {
|
||||
@@ -321,11 +322,37 @@ class _ProjectDetailsState extends State<ProjectDetails> {
|
||||
child: Column(
|
||||
children: [
|
||||
Text('Actions'),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
if(project.steps.length<=0)ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.green,
|
||||
),
|
||||
onPressed: () {
|
||||
Dialogs.showQuestionDialog("WARNING!", 'You will lose all data about this project if you continue!\nAre you sure you want to delete?', onResponse: (value){
|
||||
|
||||
});
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
FaIcon(FontAwesomeIcons.check),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text('Complete'),
|
||||
],
|
||||
)),
|
||||
ElevatedButton(
|
||||
onPressed: () {},
|
||||
onPressed: () {
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context)=>NewProject(multiline: project.steps.isNotEmpty, projectName: project.name, selectedCategory: project.cat!.name,m_steps: project.steps,)));
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
FaIcon(FontAwesomeIcons.edit),
|
||||
@@ -339,7 +366,11 @@ class _ProjectDetailsState extends State<ProjectDetails> {
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.red,
|
||||
),
|
||||
onPressed: () {},
|
||||
onPressed: () {
|
||||
Dialogs.showQuestionDialog("WARNING!", 'You will lose all data about this project if you continue!\nAre you sure you want to delete?', onResponse: (value){
|
||||
|
||||
});
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
FaIcon(FontAwesomeIcons.deleteLeft),
|
||||
@@ -370,10 +401,25 @@ class _ProjectDetailsState extends State<ProjectDetails> {
|
||||
ProjectStep value = project.steps[i];
|
||||
_steps.add(Row(
|
||||
children: [
|
||||
InkWell(onTap: (){
|
||||
Dialogs.completeStepDialog(project,(date) {
|
||||
User.UserOperations.CompleteProjectStep(project, project.steps[i], date);
|
||||
}, project.steps[i]);
|
||||
InkWell(onTap: ()async{
|
||||
if(project.steps[i].finishedDate!= null){
|
||||
await Dialogs.showQuestionDialog('Are you sure?', 'Do you want to undone following step?\n\n${project.steps[i].stepName}', onResponse: (value)async{
|
||||
if(value==true){
|
||||
await User.UserOperations.UndoProjectStep(project, project.steps[i]);
|
||||
}
|
||||
|
||||
});
|
||||
setState(() {
|
||||
|
||||
});
|
||||
}else {
|
||||
await Dialogs.completeStepDialog(project, (date)async {
|
||||
await User.UserOperations.CompleteProjectStep(project, project.steps[i], date);
|
||||
}, project.steps[i]);
|
||||
setState(() {
|
||||
|
||||
});
|
||||
}
|
||||
},child: Container(margin:EdgeInsets.all(2),child: Icon((project.steps[i].finishedDate!= null) ?Icons.check_box : Icons.check_box_outline_blank))),
|
||||
Expanded(
|
||||
child: Container(
|
||||
|
||||
Reference in New Issue
Block a user