Basic Functions done
This commit is contained in:
@@ -5,27 +5,26 @@ import 'Data.dart';
|
||||
import 'User.dart' as User;
|
||||
import 'package:sn_progress_dialog/sn_progress_dialog.dart';
|
||||
|
||||
|
||||
|
||||
late ProgressDialog progressDialog;
|
||||
class Tasks extends StatefulWidget {
|
||||
const Tasks({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_TasksState createState() => _TasksState();
|
||||
}
|
||||
late ProgressDialog progressDialog;
|
||||
class _TasksState extends State<Tasks> {
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
|
||||
progressDialog = ProgressDialog(context: context);
|
||||
User.progressDialog=progressDialog;
|
||||
UpdateList();
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
progressDialog=ProgressDialog(context: context);
|
||||
return Scaffold(
|
||||
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
@@ -67,10 +66,13 @@ class _TasksState extends State<Tasks> {
|
||||
}
|
||||
|
||||
void UpdateList() async {
|
||||
if(progressDialog != null){progressDialog.show(max:100,msg: 'Loading Task Types');}
|
||||
|
||||
try{progressDialog.show(max:100, msg: 'Loading Task Types...');}catch(e){}
|
||||
await User.updateTasksList();
|
||||
// hideProgressDialog();
|
||||
setState(() {});
|
||||
if(progressDialog != null){progressDialog.update(value: 100);}
|
||||
|
||||
try{progressDialog.update(value: 100);}catch(e){}
|
||||
}
|
||||
|
||||
List<Widget> PrintTasks() {
|
||||
@@ -165,7 +167,7 @@ class _TasksState extends State<Tasks> {
|
||||
}
|
||||
|
||||
void DeleteSelectedTasks() async{
|
||||
progressDialog.show(max: 100, msg: 'Deleteing ${selectedTasks.length} Task Types');
|
||||
progressDialog.show(max: 100, msg: "Deleting ${selectedTasks.length} ");
|
||||
selectedTasks.forEach((element) async {
|
||||
await User.UserOperations.deleteTask(element, bulk:true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user