mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
feature: Added settings to force the player into certain orientations (#108)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
691293648b
commit
c32f71b368
11 changed files with 170 additions and 5 deletions
13
lib/util/device_orientation_extension.dart
Normal file
13
lib/util/device_orientation_extension.dart
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import 'package:fladder/util/localization_helper.dart';
|
||||
|
||||
extension DeviceOrientationExtension on DeviceOrientation {
|
||||
String label(BuildContext context) => switch (this) {
|
||||
DeviceOrientation.portraitUp => context.localized.deviceOrientationPortraitUp,
|
||||
DeviceOrientation.landscapeLeft => context.localized.deviceOrientationLandscapeLeft,
|
||||
DeviceOrientation.portraitDown => context.localized.deviceOrientationPortraitDown,
|
||||
DeviceOrientation.landscapeRight => context.localized.deviceOrientationLandscapeRight,
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue