rotasi hilang

This commit is contained in:
='fauz 2025-04-22 15:17:57 +07:00
parent 1a2cf014b6
commit 56d4697981
7 changed files with 27 additions and 8 deletions

View File

@ -11,7 +11,8 @@
android:theme="@style/LaunchTheme" android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"> android:windowSoftInputMode="adjustResize"
android:screenOrientation="portrait">
<!-- Specifies an Android theme to apply to this Activity as soon as <!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues while the Flutter UI initializes. After that, this theme continues

View File

@ -17,7 +17,7 @@ class BNBCustomPainter3 extends CustomPainter {
path.quadraticBezierTo(size.width * 0.40, 0, size.width * 0.40, 20); path.quadraticBezierTo(size.width * 0.40, 0, size.width * 0.40, 20);
path.arcToPoint( path.arcToPoint(
Offset(size.width * 0.60, 20), Offset(size.width * 0.60, 20),
radius: Radius.circular(20.0), radius: Radius.circular(size.height * 0.5),
clockwise: false, clockwise: false,
); );
path.quadraticBezierTo(size.width * 0.60, 0, size.width * 0.63, 0); path.quadraticBezierTo(size.width * 0.60, 0, size.width * 0.63, 0);

View File

@ -5,10 +5,14 @@ import 'package:furibase/providers/menu_selection_provider.dart';
import 'package:furibase/screen/Home_screen.dart'; import 'package:furibase/screen/Home_screen.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
void main() { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky); SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
await SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown, // bisa dihapus jika hanya ingin satu arah
]);
runApp(const MyApp()); runApp(const MyApp());
} }

View File

@ -21,9 +21,16 @@ class _HomeScreenState extends State<HomeScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size; final Size size = MediaQuery.of(context).size;
final isLandscape = size.width > size.height;
final screenWidth = MediaQuery.of(context).size.width; final screenWidth = MediaQuery.of(context).size.width;
final buttonScanSize = screenWidth * 0.20; final buttonScanSize = screenWidth * 0.20;
final double bottomPadding = (9000 / screenWidth).clamp(0, 0.2); final double bottomPadding = (9000 / screenWidth).clamp(0, 0.2);
double bottomOffset = -(screenWidth * 0.25) + 180;
double sunRiseCurve(double width) {
// kamu bisa mainin fungsi ini sesuka hati
return -((400 / width) * 100); // semakin kecil width, hasil makin negatif
}
return Scaffold( return Scaffold(
// appBar: AppBar( // appBar: AppBar(
// elevation: 0, // elevation: 0,
@ -242,10 +249,17 @@ class _HomeScreenState extends State<HomeScreen> {
Positioned(bottom: 0, left: 0, right: 0, child: MainMenu()), Positioned(bottom: 0, left: 0, right: 0, child: MainMenu()),
Positioned( Positioned(
bottom: bottomPadding * 32, // bottom: -150, //bottomPadding * 32,
// bottom: sunRiseCurve(
// screenWidth,
// ),
bottom:
isLandscape
? bottomOffset.clamp(-200.0, -50.0)
: bottomPadding * 55,
left: (screenWidth - buttonScanSize) / 2, left: (screenWidth - buttonScanSize) / 2,
child: Transform.translate( child: Transform.translate(
offset: Offset(0, -20), offset: Offset(0, -30),
child: ScanButton(), child: ScanButton(),
), ),
), ),

View File

@ -153,7 +153,7 @@ class _KoleksiScreenState extends State<KoleksiScreen> {
), ),
Positioned(bottom: 0, left: 0, right: 0, child: MainMenu()), Positioned(bottom: 0, left: 0, right: 0, child: MainMenu()),
Positioned( Positioned(
bottom: bottomPadding * 32, bottom: bottomPadding * 98,
left: (screenWidth - buttonScanSize) / 2, left: (screenWidth - buttonScanSize) / 2,
child: Transform.translate( child: Transform.translate(
offset: Offset(0, -20), offset: Offset(0, -20),

View File

@ -293,7 +293,7 @@ class _PustakaScreenState extends State<PustakaScreen> {
], ],
), ),
Positioned( Positioned(
bottom: bottomPadding * 32, bottom: bottomPadding * 98,
left: (screenWidth - buttonScanSize) / 2, left: (screenWidth - buttonScanSize) / 2,
child: Transform.translate( child: Transform.translate(
offset: Offset(0, -20), offset: Offset(0, -20),

View File

@ -344,7 +344,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
), ),
Positioned(bottom: 0, left: 0, right: 0, child: MainMenu()), Positioned(bottom: 0, left: 0, right: 0, child: MainMenu()),
Positioned( Positioned(
bottom: bottomPadding * 32, bottom: bottomPadding * 98,
left: (screenWidth - buttonScanSize) / 2, left: (screenWidth - buttonScanSize) / 2,
child: Transform.translate( child: Transform.translate(
offset: Offset(0, -20), offset: Offset(0, -20),