import 'dart:math' as math;

import 'package:flutter/widgets.dart';

EdgeInsets bottomSheetContentPadding(
  BuildContext context, {
  double horizontal = 16,
  double top = 20,
  double bottom = 20,
}) {
  final mediaQuery = MediaQuery.of(context);
  final bottomInset = math.max(
    mediaQuery.viewInsets.bottom,
    mediaQuery.viewPadding.bottom,
  );

  return EdgeInsets.fromLTRB(
    horizontal,
    top,
    horizontal,
    bottom + bottomInset,
  );
}
