Todo delete + Debug Logging to User
This commit is contained in:
23
lib/DebugHelper.dart
Normal file
23
lib/DebugHelper.dart
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
class Debug{
|
||||||
|
static bool enableLogging = true;
|
||||||
|
static bool enableResponseLogging = true;
|
||||||
|
static bool enableErrorLoggin = true;
|
||||||
|
|
||||||
|
static void LogResponse(Object? response, {Object src= ''}){
|
||||||
|
if(!enableLogging){return;}
|
||||||
|
if(!enableResponseLogging) {return;}
|
||||||
|
print('\x1B[32m$src response\n$response\x1B[0m');
|
||||||
|
}
|
||||||
|
|
||||||
|
static void LogError(Object? msg){
|
||||||
|
if(!enableLogging){return;}
|
||||||
|
if(!enableErrorLoggin) {return;}
|
||||||
|
print('\x1B[31m$msg\x1B[0m');
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Log(Object? msg){
|
||||||
|
if(!enableErrorLoggin) {return;}
|
||||||
|
print('\x1B[0m$msg');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -323,7 +323,7 @@ class Dialogs{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(journalId < 0){return;}
|
if(journalId < 0){return;}
|
||||||
String title= '${(User.journal[journalId].title!= null && User.journal[journalId].title!.isNotEmpty) ? User.journal[journalId].title : DateFormat('MMMM-dd').format(date)}';
|
String title= (User.journal[journalId].title!= null && User.journal[journalId].title!.isNotEmpty) ? (User.journal[journalId].title! + ' (${(DateFormat('MMMM-dd').format(date))})') : DateFormat('MMMM-dd').format(date);
|
||||||
String description = User.journal[journalId].description ?? '';
|
String description = User.journal[journalId].description ?? '';
|
||||||
if(description.length > 60){
|
if(description.length > 60){
|
||||||
description = description.substring(0,60) + '...(click more for more)';
|
description = description.substring(0,60) + '...(click more for more)';
|
||||||
@@ -347,13 +347,13 @@ class Dialogs{
|
|||||||
onPressed: (){
|
onPressed: (){
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
child: Text('No', style:TextStyle(color: Colors.red)),
|
child: Text('Back', style:TextStyle(color: Colors.red)),
|
||||||
),
|
),
|
||||||
MaterialButton(
|
MaterialButton(
|
||||||
onPressed: (){
|
onPressed: (){
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
child: Text('Yes', style:TextStyle(color: Colors.green)),
|
child: Text('More', style:TextStyle(color: Colors.green)),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ class _NewActivity extends State<NewTodo> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await User.UserOperations.addTodo(selectedCat, metadataController.text, dueDate, notificationTime);
|
await User.UserOperations.addTodo(selectedCat,((selectedStep!=null && selectedStep != 'None') ? '[$selectedStep]' : '')+ metadataController.text, dueDate, notificationTime);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
246
lib/Todos.dart
246
lib/Todos.dart
@@ -1,4 +1,5 @@
|
|||||||
import 'package:firebase_auth/firebase_auth.dart';
|
import 'package:firebase_auth/firebase_auth.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_colorpicker/flutter_colorpicker.dart';
|
import 'package:flutter_colorpicker/flutter_colorpicker.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
@@ -7,6 +8,7 @@ import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
|
|||||||
import 'package:tasktracker/NewJournal.dart';
|
import 'package:tasktracker/NewJournal.dart';
|
||||||
import 'package:tasktracker/NewTodo.dart';
|
import 'package:tasktracker/NewTodo.dart';
|
||||||
import 'package:tasktracker/main.dart';
|
import 'package:tasktracker/main.dart';
|
||||||
|
import 'Data.dart';
|
||||||
import 'User.dart' as User;
|
import 'User.dart' as User;
|
||||||
import 'Dialogs.dart';
|
import 'Dialogs.dart';
|
||||||
|
|
||||||
@@ -19,7 +21,6 @@ class TodosPage extends StatefulWidget {
|
|||||||
|
|
||||||
class _TodosPageState extends State<TodosPage> {
|
class _TodosPageState extends State<TodosPage> {
|
||||||
bool selecting = false;
|
bool selecting = false;
|
||||||
List<int> selectedIndexes = [];
|
|
||||||
int expandedIndex = -1;
|
int expandedIndex = -1;
|
||||||
var refreshStream;
|
var refreshStream;
|
||||||
|
|
||||||
@@ -42,8 +43,27 @@ class _TodosPageState extends State<TodosPage> {
|
|||||||
refreshStream?.close();
|
refreshStream?.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map<String, List<Todo>> projects = <String, List<Todo>>{};
|
||||||
|
List<Todo> simpleTodos = [];
|
||||||
|
List<String> expandedProjects = [];
|
||||||
|
bool expandedSimpleTodos = false;
|
||||||
|
List<String> selectedProjects = [];
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
projects = <String, List<Todo>>{};
|
||||||
|
simpleTodos = [];
|
||||||
|
for (var todo in User.todos) {
|
||||||
|
if (todo.task!.relatedProject != null) {
|
||||||
|
String projectName = todo.task!.relatedProject!.name;
|
||||||
|
if (projects.containsKey(projectName)) {
|
||||||
|
projects[projectName]!.add(todo);
|
||||||
|
} else {
|
||||||
|
projects.putIfAbsent(projectName, () => [todo]);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
simpleTodos.add(todo);
|
||||||
|
}
|
||||||
|
}
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
floatingActionButton: FloatingActionButton.extended(
|
floatingActionButton: FloatingActionButton.extended(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
@@ -68,13 +88,11 @@ class _TodosPageState extends State<TodosPage> {
|
|||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
if (selecting && selectedIndexes.length > 0)
|
if (selecting && selectedProjects.length > 0)
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () async {
|
onTap: () {
|
||||||
selecting = false;
|
selecting = false;
|
||||||
for (int element in selectedIndexes) {
|
deleteTodos();
|
||||||
await User.UserOperations.deleteJournal(User.todos[element].id);
|
|
||||||
}
|
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
child: Container(margin: EdgeInsets.all(8), child: Icon(Icons.delete))),
|
child: Container(margin: EdgeInsets.all(8), child: Icon(Icons.delete))),
|
||||||
@@ -100,51 +118,131 @@ class _TodosPageState extends State<TodosPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
drawer: navDrawer(context, 9),
|
drawer: navDrawer(context, 9),
|
||||||
body: Container(
|
body: SingleChildScrollView(
|
||||||
padding: EdgeInsets.all(8),
|
// margin: EdgeInsets.fromLTRB(2, 10, 0, 10),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.all(8),
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 10),
|
||||||
|
decoration: BoxDecoration(color: Colors.black26, borderRadius: BorderRadius.circular(10)),
|
||||||
|
child: (projects.length <=0) ?Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text('No Todos Related to Projects'),
|
||||||
|
],
|
||||||
|
) :ScrollablePositionedList.builder(
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: projects.length,
|
||||||
|
itemBuilder: (context, i) {
|
||||||
|
String thisProject= projects.keys.toList()[i];
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 0,vertical: 8),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
InkWell(
|
||||||
|
onTap: (){
|
||||||
|
if(expandedProjects.contains(thisProject)){
|
||||||
|
expandedProjects.remove(thisProject);
|
||||||
|
}else{
|
||||||
|
expandedProjects.add(thisProject);
|
||||||
|
|
||||||
|
}
|
||||||
|
setState(() {
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon((!expandedProjects.contains(thisProject)) ? Icons.keyboard_arrow_right_outlined : Icons.keyboard_arrow_down_outlined),
|
||||||
|
Text('${projects.keys.toList()[i]} (${projects.values.toList()[i].length})',style: TextStyle(fontSize: 18)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Container(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if(expandedProjects.contains(thisProject))Container(
|
||||||
|
padding: EdgeInsets.fromLTRB(8, 0, 8, 0),
|
||||||
child: ScrollablePositionedList.builder(
|
child: ScrollablePositionedList.builder(
|
||||||
itemCount: User.todos.length,
|
shrinkWrap: true,
|
||||||
|
itemCount: projects.values.toList()[i].length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
int maxCharCount = 100;
|
int maxCharCount = 100;
|
||||||
bool containsStepData = User.todos[index].metadata.contains('[') && User.todos[index].metadata.contains(']');
|
Todo todo = projects.values.toList()[i][index];
|
||||||
|
|
||||||
|
print('$i : $index');
|
||||||
|
return todoCard(todo);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.all(8),
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 10),
|
||||||
|
decoration: BoxDecoration(color: Colors.black26, borderRadius: BorderRadius.circular(15)),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
InkWell(
|
||||||
|
onTap: (){expandedSimpleTodos=!expandedSimpleTodos;setState(() {
|
||||||
|
|
||||||
|
});},
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon((!expandedSimpleTodos) ? Icons.keyboard_arrow_right_outlined : Icons.keyboard_arrow_down_outlined),
|
||||||
|
Text('Typical Todos (${simpleTodos.length})',style: TextStyle(fontSize: 18)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Container(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if(expandedSimpleTodos)Container(
|
||||||
|
padding: EdgeInsets.fromLTRB(8, 0, 8, 0),
|
||||||
|
child: ScrollablePositionedList.builder(
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: simpleTodos.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
int maxCharCount = 100;
|
||||||
|
Todo todo = simpleTodos[index];
|
||||||
|
return todoCard(todo);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget todoCard(Todo todo){
|
||||||
|
|
||||||
|
bool containsStepData = todo.metadata.contains('[') && todo.metadata.contains(']');
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
|
||||||
if (selecting) {
|
|
||||||
if (selectedIndexes.contains(index)) {
|
|
||||||
selectedIndexes.remove(index);
|
|
||||||
} else {
|
|
||||||
selectedIndexes.add(index);
|
|
||||||
}
|
|
||||||
setState(() {});
|
|
||||||
} else {
|
|
||||||
if (expandedIndex == index) {
|
|
||||||
expandedIndex = -1;
|
|
||||||
//_controller..reverse(from: 0.5);
|
|
||||||
} else {
|
|
||||||
expandedIndex = index;
|
|
||||||
// _controller..forward(from: 0);
|
|
||||||
}
|
|
||||||
setState(() {});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLongPress: () {
|
|
||||||
selecting = !selecting;
|
|
||||||
if (!selectedIndexes.contains(index)) {
|
|
||||||
selectedIndexes.add(index);
|
|
||||||
}
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (selecting)
|
if (selecting)
|
||||||
Checkbox(
|
Checkbox(
|
||||||
value: selectedIndexes.contains(index),
|
value: selectedProjects.contains(todo.id),
|
||||||
onChanged: (newVal) {
|
onChanged: (newVal) {
|
||||||
if (selectedIndexes.contains(index)) {
|
if (selectedProjects.contains(todo.id)) {
|
||||||
selectedIndexes.remove(index);
|
selectedProjects.remove(todo.id);
|
||||||
} else {
|
} else {
|
||||||
selectedIndexes.add(index);
|
selectedProjects.add(todo.id);
|
||||||
}
|
}
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
@@ -156,18 +254,26 @@ class _TodosPageState extends State<TodosPage> {
|
|||||||
|
|
||||||
// color: color,
|
// color: color,
|
||||||
elevation: 30,
|
elevation: 30,
|
||||||
shadowColor: colorFromHex(User.todos[index].task!.cat!.color),
|
shadowColor: colorFromHex(todo.task!.cat!.color),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
//Open Respective Category
|
//Open Respective Category
|
||||||
if (selecting) {
|
if (selecting) {
|
||||||
//OnItemSelected(activity);
|
if (selectedProjects.contains(todo.id)) {
|
||||||
|
selectedProjects.remove(todo.id);
|
||||||
|
} else {
|
||||||
|
selectedProjects.add(todo.id);
|
||||||
}
|
}
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
} else {
|
||||||
|
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onLongPress: () {
|
onLongPress: () {
|
||||||
print('gonna delete');
|
print('gonna delete');
|
||||||
selecting = !selecting;
|
selecting = !selecting;
|
||||||
|
selectedProjects=[];
|
||||||
// selectedActivities = [activity];
|
// selectedActivities = [activity];
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
@@ -176,7 +282,7 @@ class _TodosPageState extends State<TodosPage> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Row(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, children: [
|
Row(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, children: [
|
||||||
Text(User.todos[index].task!.name, style: TextStyle(fontSize: 17)),
|
Text(todo.task!.name, style: TextStyle(fontSize: 17)),
|
||||||
Row(mainAxisAlignment: MainAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [
|
Row(mainAxisAlignment: MainAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [
|
||||||
Icon(
|
Icon(
|
||||||
Icons.arrow_forward_outlined,
|
Icons.arrow_forward_outlined,
|
||||||
@@ -186,8 +292,8 @@ class _TodosPageState extends State<TodosPage> {
|
|||||||
width: MediaQuery.of(context).size.width / 3,
|
width: MediaQuery.of(context).size.width / 3,
|
||||||
child: Text(
|
child: Text(
|
||||||
(containsStepData)
|
(containsStepData)
|
||||||
? User.todos[index].metadata.substring(User.todos[index].metadata!.indexOf(']') + 1)
|
? todo.metadata.substring(todo.metadata!.indexOf(']') + 1)
|
||||||
: (User.todos[index].metadata ?? ''),
|
: (todo.metadata ?? ''),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
@@ -200,13 +306,13 @@ class _TodosPageState extends State<TodosPage> {
|
|||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 2),
|
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 2),
|
||||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.blue),
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.blue),
|
||||||
child: Text(DateFormat('yyyy-MM-dd').format(User.todos[index].dueDate))),
|
child: Text(DateFormat('yyyy-MM-dd').format(todo.dueDate))),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 20,
|
width: 20,
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
(User.todos[index].task!.relatedProject != null)
|
(todo.task!.relatedProject != null)
|
||||||
? Row(
|
? Row(
|
||||||
children: [
|
children: [
|
||||||
if (containsStepData)
|
if (containsStepData)
|
||||||
@@ -214,17 +320,16 @@ class _TodosPageState extends State<TodosPage> {
|
|||||||
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 2),
|
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 2),
|
||||||
decoration:
|
decoration:
|
||||||
BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.black26),
|
BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.black26),
|
||||||
child: Text(User.todos[index].metadata!
|
child: Text(todo.metadata!
|
||||||
.substring(1, User.todos[index].metadata!.indexOf(']')) ??
|
.substring(1, todo.metadata!.indexOf(']')) ??
|
||||||
'n/a')),
|
'n/a')),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 8,
|
width: 8,
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 2),
|
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 2),
|
||||||
decoration:
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.black26),
|
||||||
BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.black26),
|
child: Text(todo.task!.relatedProject!.name ?? 'n/a')),
|
||||||
child: Text(User.todos[index].task!.relatedProject!.name ?? 'n/a')),
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
: Container(),
|
: Container(),
|
||||||
@@ -235,8 +340,8 @@ class _TodosPageState extends State<TodosPage> {
|
|||||||
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 2),
|
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 2),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
color: (User.todos[index].task!.cat!.productive) ? Colors.green : Colors.red),
|
color: (todo.task!.cat!.productive) ? Colors.green : Colors.red),
|
||||||
child: Text(User.todos[index].task!.cat?.name ?? 'n/a')),
|
child: Text(todo.task!.cat?.name ?? 'n/a')),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
// Icon(Icons.circle,
|
// Icon(Icons.circle,
|
||||||
@@ -251,7 +356,7 @@ class _TodosPageState extends State<TodosPage> {
|
|||||||
height: 2,
|
height: 2,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(flex: 100, child: Container(color: colorFromHex(User.todos[index].task!.cat!.color))),
|
Expanded(flex: 100, child: Container(color: colorFromHex(todo.task!.cat!.color))),
|
||||||
Expanded(flex: 0, child: Container())
|
Expanded(flex: 0, child: Container())
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
@@ -261,7 +366,7 @@ class _TodosPageState extends State<TodosPage> {
|
|||||||
if (selecting)
|
if (selecting)
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// Navigator.of(context).push(MaterialPageRoute(builder: (context) => NewJournal(date: User.todos[index].day, title: User.todos[index].title, text: User.todos[index].description,))).then((val) {
|
// Navigator.of(context).push(MaterialPageRoute(builder: (context) => NewJournal(date: todo.day, title: todo.title, text: todo.description,))).then((val) {
|
||||||
// setState(() {});
|
// setState(() {});
|
||||||
// });
|
// });
|
||||||
selecting = false;
|
selecting = false;
|
||||||
@@ -271,8 +376,31 @@ class _TodosPageState extends State<TodosPage> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void deleteTodos() async{
|
||||||
|
if(selectedProjects.length > 0){
|
||||||
|
User.todos.forEach((list) {
|
||||||
|
selectedProjects.forEach((selected) {
|
||||||
|
if(list.id == selected){
|
||||||
|
User.UserOperations.deleteTodo(selected,bulk: true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
await User.UserOperations.executeQueries();
|
||||||
|
|
||||||
|
}else{
|
||||||
|
Dialogs.showAlertDialog(context, 'Non-Selected', 'Select some tasks to delete, This message should not be shown btw');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// List<Widget> todos() {
|
||||||
|
// List<Widget> _todos = [];
|
||||||
|
// for (int i = 0; i < projects.length; i++) {
|
||||||
|
// _todos.add(;
|
||||||
|
// }
|
||||||
|
// return _todos;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
423
lib/User.dart
423
lib/User.dart
File diff suppressed because it is too large
Load Diff
@@ -740,7 +740,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
dataLabelMapper: (ProductivityMapData sales, _) => sales.productivity.toStringAsFixed(1) + "%",
|
dataLabelMapper: (ProductivityMapData sales, _) => sales.productivity.toStringAsFixed(1) + "%",
|
||||||
dataLabelSettings: DataLabelSettings(overflowMode: OverflowMode.hide, showZeroValue: false, isVisible: true),
|
dataLabelSettings: DataLabelSettings(overflowMode: OverflowMode.hide, showZeroValue: false, isVisible: true),
|
||||||
onPointTap: (ChartPointDetails point){
|
onPointTap: (ChartPointDetails point){
|
||||||
Dialogs.showJournalLink(dFormat.parse(productivityData[productivityData.length-point.pointIndex!-1].day));
|
Dialogs.showJournalLink(dFormat.parse(productivityData[productivityData.length-point.pointIndex!].day));
|
||||||
//showAlertDialog(context, productivityData[point.pointIndex!].day, "I'll show you detailed info about this day in future, When my master creates the feature");
|
//showAlertDialog(context, productivityData[point.pointIndex!].day, "I'll show you detailed info about this day in future, When my master creates the feature");
|
||||||
},
|
},
|
||||||
pointColorMapper: (ProductivityMapData sales, _)=> (User.journalExists(dFormat.parse(sales.day)) ? Colors.lightGreenAccent : Colors.green)
|
pointColorMapper: (ProductivityMapData sales, _)=> (User.journalExists(dFormat.parse(sales.day)) ? Colors.lightGreenAccent : Colors.green)
|
||||||
|
|||||||
Reference in New Issue
Block a user