onSourceExit method

  1. @override
Future<void> onSourceExit(
  1. {required AppModel appModel,
  2. required BuildContext context,
  3. required WidgetRef ref}
)
override

Executed when this media source is closed. Perform this step to clean up resources or refresh media history.

Implementation

@override
Future<void> onSourceExit({
  required AppModel appModel,
  required BuildContext context,
  required WidgetRef ref,
}) async {
  await SystemChrome.setPreferredOrientations([
    DeviceOrientation.portraitUp,
    DeviceOrientation.landscapeLeft,
    DeviceOrientation.landscapeRight,
  ]);
}