showBodyScrim method Null safety

void showBodyScrim(
  1. bool value,
  2. double opacity
)

Whether to show a ModalBarrier over the body of the scaffold.

The value parameter must not be null.

Implementation

void showBodyScrim(bool value, double opacity) {
  assert(value != null);
  if (_showBodyScrim == value && _bodyScrimColor.opacity == opacity) {
    return;
  }
  setState(() {
    _showBodyScrim = value;
    _bodyScrimColor = Colors.black.withOpacity(opacity);
  });
}