emptyCallback top-level property Null safety

VoidCallback emptyCallback

An empty function that can be used in assigning default values for Callback.

class MyClass {
  final Callback initialize;
  MyClass([Callback? initialize])
      : initialize = initialize ?? emptyCallback;
}

Implementation

///   MyClass([Callback? initialize])
///       : initialize = initialize ?? emptyCallback;
/// }
/// ```
///
VoidCallback get emptyCallback => () {};