show method

dynamic show({
  1. required BuildContext context,
  2. Text? title,
  3. required Text description,
  4. required CustomSheetColor color,
  5. required SweetSheetAction positive,
  6. EdgeInsets? contentPadding = const EdgeInsets.symmetric(horizontal: 24.0, vertical: 24.0),
  7. EdgeInsets? actionPadding = const EdgeInsets.all(8.0),
  8. SweetSheetAction? negative,
  9. IconData? icon,
  10. bool useRootNavigator = false,
  11. bool isDismissible = true,
})

Implementation

show({
  required BuildContext context,
  Text? title,
  required Text description,
  required CustomSheetColor color,
  required SweetSheetAction positive,
  EdgeInsets? contentPadding = const EdgeInsets.symmetric(horizontal: 24.0, vertical: 24.0),
  EdgeInsets? actionPadding = const EdgeInsets.all(8.0),
  SweetSheetAction? negative,
  IconData? icon,
  bool useRootNavigator = false,
  bool isDismissible = true,
}) {
  showModalBottomSheet(
    isDismissible: isDismissible,
    enableDrag: isDismissible,
    context: context,
    isScrollControlled: true,
    useRootNavigator: useRootNavigator,
    builder: (BuildContext context) {
      return Column(
        mainAxisSize: MainAxisSize.min,
        children: <Widget>[
          Container(
            width: double.infinity,
            color: color.main,
            padding: contentPadding,
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                title == null
                    ? Container()
                    : DefaultTextStyle(
                        style: TextStyle(
                          fontSize: 24,
                          color: Colors.white,
                          fontWeight: FontWeight.bold,
                        ),
                        textAlign: TextAlign.start,
                        child: title),
                _buildContent(color, description, icon)
              ],
            ),
          ),
          Container(
            padding: actionPadding,
            color: color.accent,
            child: Row(
              mainAxisAlignment: MainAxisAlignment.end,
              children: _buildActions(positive, negative),
            ),
          )
        ],
      );
    },
  );
}