In this recipe, you have used a Container Transform transition. Basically, you have transformed a ListTile in a ListView into a fullscreen, made of a Scaffold, an Icon, and some text.
The transition between the two views (the "containers" of the animation) has been completely managed by the OpenContainer widget.
There are two important properties that we have set to implement this effect: openBuilder and closedBuilder. Both require a function that builds the user interface for the current view.
In particular, you have implemented the starting view (closed), with this code:
closedBuilder: (context, openContainer) {
return Dismissible(
key: Key(sweets[index]),
child: ListTile(
title: Text(sweets[index]),
trailing: Icon(Icons.cake),
onTap: () {
openContainer();
},
),
onDismissed: (direction) {
sweets.removeAt(index);
},
);
The function in the closedBuilder parameter takes the current BuildContext and the method that will...