getDialogContentMaxWidth function

double getDialogContentMaxWidth(
  1. BuildContext context
)

Calculates a content width that can fill AlertDialog with the screen width.

Implementation

double getDialogContentMaxWidth(BuildContext context) {
  var horizontalPadding = MediaQuery.of(context).padding + kDialogDefaultInsetPadding + kAlertDialogDefaultContentPadding;
  return MediaQuery.of(context).size.width - horizontalPadding.horizontal;
}