This is a Flutter Widget that makes it easy to build a page with a bottom Card that can be expanded on user drag.
Use ExpandableCardPage
for the body of your Scaffold
. This widget will take two attributes:
Widget page
: which is the default page in the backgroundExpandableCard expandableCard
: which is the bottom card itself. You can call theExpandableCard
constructor to build one.
ExpandableCard
constructor has a few attributes:
EdgeInsetsGeometry padding
: padding inside the card. Default value isEdgeInsets.all(15)
double minHeight
: default height of the card when it's not expanded. Default value is200
double maxHeight
: height of the card when it's fully expanded. Default value is500
bool hasShadow
: determines whether the card has box shadow or not. Default istrue
Color backgroundColor
: background color of the card. Default isColors.blueGrey
bool hasRoundedCorners
: determines whether the card has rounded corners or not. Default isfalse
bool hasHandle
: will add a little handle icon. Default istrue
Color handleColor
: changes color of the handle icon. Default isColors.white
Function isExpandedCallback
: optional callback to notify parent of card state. Will call method and pass a boolean. Default isnull
Function closeCardCallback
: optional callback to handle swiping down to close. If null, card cannot be swiped down. Default isnull
List<Widget> Children
: Widgets that make the actual content of the card
AnimatedExpandableCard
: will allow animation between closed state and expanded state.- Add suport for scrolling card when its fully expanded