show method

dynamic show({
  1. required BuildContext context,
  2. Text? title,
  3. required Text description,
  4. required CustomSheetColor color,
  5. required SweetSheetAction positive,
  6. SweetSheetAction? negative,
  7. IconData? icon,
  8. bool useRootNavigator = false,
  9. bool isDismissible = true,
})

Implementation

show({
  required BuildContext context,
  Text? title,
  required Text description,
  required CustomSheetColor color,
  required SweetSheetAction positive,
  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:
                const EdgeInsets.symmetric(horizontal: 24.0, vertical: 24.0),
            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: const EdgeInsets.all(8.0),
            color: color.accent,
            child: Row(
              mainAxisAlignment: MainAxisAlignment.end,
              children: _buildActions(positive, negative),
            ),
          )
        ],
      );
    },
  );
}