Skip to content

Instantly share code, notes, and snippets.

@red-star25
Created October 7, 2021 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save red-star25/56ea45fc9bd4d388b476a7d667696bd8 to your computer and use it in GitHub Desktop.
Save red-star25/56ea45fc9bd4d388b476a7d667696bd8 to your computer and use it in GitHub Desktop.
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