Skip to content

Instantly share code, notes, and snippets.

@red-star25
Created Oct 7, 2021
Embed
What would you like to do?
class TodoItemWidget extends StatefulWidget {
final Todo todo;
final Animation<double> animation; // <-- Here
final Function onClicked;
const TodoItemWidget(
{Key? key,
required this.todo,
required this.animation, // <-- Here
required this.onClicked})
: super(key: key);
@override
State<TodoItemWidget> createState() => _TodoItemWidgetState();
}
class _TodoItemWidgetState extends State<TodoItemWidget> {
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Card(
elevation: 0.0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
child: CheckboxListTile(
onChanged: (value) => widget.onClicked(value),
value: widget.todo.isCompleted,
title: Text(
widget.todo.title,
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment