CustomOrientationBuilder.landscape constructor
CustomOrientationBuilder.landscape({
- Key? key,
- required WidgetBuilder builder,
- ValueChanged<
Orientation> ? onChanged,
Wraps an OrientationBuilder that automatically determines the orientation and calls the appropriate builder.
Forces Orientation.landscape.
Implementation
CustomOrientationBuilder.landscape({
super.key,
required WidgetBuilder builder,
this.onChanged,
}) : landscapeBuilder = builder,
portraitBuilder = builder,
onDispose = _defaultOnDispose {
SystemChrome.setPreferredOrientations(<DeviceOrientation>[
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);
}