initialize method

void initialize({
  1. required Widget maxChild,
  2. required Widget minChild,
  3. required VoidCallback onDispose,
})

Initializes the floating widget with the given children and dispose callback.

The maxChild is the widget to display when the floating widget is maximized. The minChild is the widget to display when the floating widget is minimized. The onDispose callback is called when the floating widget is disposed.

Implementation

void initialize({
  required Widget maxChild,
  required Widget minChild,
  required VoidCallback onDispose,
}) {
  close(); // Ensure previous state is cleaned up
  _maximizedChild = maxChild;
  _minimizedChild = minChild;
  _onDispose = onDispose;
  notifyListeners();
}