CupertinoBottomSheetAppBar.withCloseButton constructor

CupertinoBottomSheetAppBar.withCloseButton({
  1. required String title,
  2. required String buttonText,
  3. VoidCallback? onClosePressed,
  4. TextStyle? headerStyle,
  5. TextStyle? buttonTextStyle,
  6. int maxLines = 1,
})

Implementation

factory CupertinoBottomSheetAppBar.withCloseButton({
  required String title,
  required String buttonText,
  VoidCallback? onClosePressed,
  TextStyle? headerStyle,
  TextStyle? buttonTextStyle,
  int maxLines = 1,
}) {
  return CupertinoBottomSheetAppBar(
    title: title,
    headerStyle: headerStyle,
    maxLines: maxLines,
    trailing: CupertinoButton(
      padding: EdgeInsets.zero,
      onPressed: onClosePressed ?? closeCupertinoBottomSheet,
      child: Text(
        buttonText,
        style: buttonTextStyle,
      ),
    ),
  );
}