大佬教程收集整理的这篇文章主要介绍了Flutter - CheckBoxListTile 在 Dissmissible 中包裹时没有动画,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
import 'package:bee_diary/utils/database.dart';
import 'package:Flutter/material.dart';
class Task extends StatefulWidget {
@overrIDe
_TaskState createState() => _TaskState();
Task({
@required this.task,@required this.APIaryIndex,@required this.taskIndex,});
final Map<String,dynamic> task;
final int aPIaryIndex,taskIndex;
}
class _TaskState extends State<Task> {
final Database db = Database.instance;
bool isDone = false;
voID setIsDone(bool value) => setState(() => isDone = value);
@overrIDe
voID initState() {
super.initState();
isDone = Widget.task['isDone'] == null ? false : Widget.task['isDone'];
}
@overrIDe
Widget build(BuildContext context) {
return dismissible(
key: UniqueKey(),/// setState isn't called in this function
ondismissed: (dismissDirection _) => db.removeTaskFromAPIary(
Widget.APIaryIndex,Widget.taskIndex,),child: Card(
clipBehavior: Clip.hardEdge,child: checkBoxListTile(
key: Key(
Widget.task['task'],activecolor: theme.of(context).accentcolor,checkcolor: theme.of(context).priMarycolor,title: Text(
Widget.task['text'],value: isDone,onChanged: (bool value) => db.toggleTaskIsDone(
Widget.APIaryIndex,onComplete: () => setIsDone(value),BACkground: const card(
color: colors.red,);
}
}
@H_674_0@解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
以上是大佬教程为你收集整理的Flutter - CheckBoxListTile 在 Dissmissible 中包裹时没有动画全部内容,希望文章能够帮你解决Flutter - CheckBoxListTile 在 Dissmissible 中包裹时没有动画所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。