Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FlatButton(
- materialTapTargetSize:
- MaterialTapTargetSize.shrinkWrap,
- splashColor: Colors.transparent,
- onPressed: () {
- controllerName.text = '';
- controllerDescription.text = '';
- controllerName.text = task.name;
- controllerDescription.text = task.title;
- setState(() {
- data = data;
- showEditForm = !showEditForm;
- });
- },
- padding: EdgeInsets.all(0.0),
- child: BuildSvg('assets/svg/dots.svg'),
- ),
- FutureBuilder<List<Task>>(
- future: DBHelper().getTasks(),
- builder: (BuildContext context, AsyncSnapshot<List<Task>> snapshot) {
- if (snapshot.hasData) {
- var data = snapshot.data;
- ...
- child: Dismissible(
- key: UniqueKey(),
- crossAxisEndOffset: -0.1,
- onDismissed: (direction) {
- like this setState(() {data = data })
- if (direction == DismissDirection.endToStart) {
- DBHelper().delete(task.id);
- } else {
- DBHelper().delete(task.id);
- }
- },
- child: Container(
- height: device.height * 585 / 812,
- child: buildTask(device, task, data),
- ),
- ),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement