This commit is contained in:
warlock
2022-03-05 18:48:18 +05:30
parent 7f50983e11
commit 0272b2d1fd
53 changed files with 2233 additions and 440 deletions

View File

@@ -4,7 +4,6 @@ import 'main.dart';
import 'NewTask.dart';
import 'User.dart' as User;
import 'Data.dart';
import 'package:sn_progress_dialog/sn_progress_dialog.dart';
class Categories extends StatefulWidget {
const Categories({Key? key}) : super(key: key);
@@ -12,20 +11,25 @@ class Categories extends StatefulWidget {
_CategoriesState createState() => _CategoriesState();
}
late ProgressDialog progressDialog;
bool selecting=false;
class _CategoriesState extends State<Categories> {
@override
void initState() {
// TODO: implement initState
super.initState();
//init(context);
UpdateList();
}
@override void dispose() {
// TODO: implement dispose
super.dispose();
}
@override
Widget build(BuildContext context) {
progressDialog=ProgressDialog(context: context);
return Scaffold(
floatingActionButton: FloatingActionButton.extended(
onPressed: () {
@@ -66,7 +70,7 @@ class _CategoriesState extends State<Categories> {
}
void UpdateList() async {
await User.updateCatsList();
await User.refreshUserData();
setState(() {});
}
@@ -92,7 +96,6 @@ class _CategoriesState extends State<Categories> {
}
void DeleteSelectedCats() async{
progressDialog.show(max: 100, msg: 'Deleteing ${selectedTasks.length} Categories');
selectedTasks.forEach((element) async {
await User.UserOperations.deleteCategory(element, bulk:true);
});
@@ -102,7 +105,6 @@ class _CategoriesState extends State<Categories> {
selectedTasks=[];
selecting=false;
setState(() {
progressDialog.update(value: 100);
});
}