hideToolbar static method

void hideToolbar(
  1. BuildContext context, {
  2. bool disablePreview = true,
})

Hide the toolbar.

If disablePreview is set to false, then the device preview stays active even if the toolbar is not visible anymore.

Implementation

static void hideToolbar(
  BuildContext context, {
  bool disablePreview = true,
}) {
  final store = Provider.of<DevicePreviewStore>(context);
  store.data = store.data.copyWith(
    isToolbarVisible: false,
    isEnabled: !disablePreview,
  );
}