validate method

Widget validate({
  1. Widget value = const SizedBox(),
})

Returns the widget if it is not null, otherwise returns a default value.

Example:

Widget? myWidget;
myWidget.validate(value: Text('Default'));

Implementation

Widget validate({Widget value = const SizedBox()}) => this ?? value;