Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. FlatButton(
  2. materialTapTargetSize:
  3. MaterialTapTargetSize.shrinkWrap,
  4. splashColor: Colors.transparent,
  5. onPressed: () {
  6. controllerName.text = '';
  7. controllerDescription.text = '';
  8. controllerName.text = task.name;
  9. controllerDescription.text = task.title;
  10. setState(() {
  11. data = data;
  12. showEditForm = !showEditForm;
  13. });
  14. },
  15. padding: EdgeInsets.all(0.0),
  16. child: BuildSvg('assets/svg/dots.svg'),
  17. ),
  18.  
  19. FutureBuilder<List<Task>>(
  20. future: DBHelper().getTasks(),
  21. builder: (BuildContext context, AsyncSnapshot<List<Task>> snapshot) {
  22. if (snapshot.hasData) {
  23. var data = snapshot.data;
  24. ...
  25.  
  26. child: Dismissible(
  27. key: UniqueKey(),
  28. crossAxisEndOffset: -0.1,
  29. onDismissed: (direction) {
  30. like this setState(() {data = data })
  31. if (direction == DismissDirection.endToStart) {
  32. DBHelper().delete(task.id);
  33. } else {
  34. DBHelper().delete(task.id);
  35. }
  36. },
  37. child: Container(
  38. height: device.height * 585 / 812,
  39. child: buildTask(device, task, data),
  40. ),
  41. ),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement