63 lines
1.7 KiB
Dart
63 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart'; // Import for SystemChrome
|
|
import 'screens/home_screen.dart';
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
// Lock orientation to portrait only
|
|
await SystemChrome.setPreferredOrientations([
|
|
DeviceOrientation.portraitUp,
|
|
DeviceOrientation.portraitDown,
|
|
]);
|
|
|
|
// Set system UI overlay style globally for the app
|
|
SystemChrome.setSystemUIOverlayStyle(
|
|
SystemUiOverlayStyle(
|
|
statusBarColor: Colors.grey[900],
|
|
systemNavigationBarColor: Colors.grey[900],
|
|
systemNavigationBarIconBrightness: Brightness.light,
|
|
),
|
|
);
|
|
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'SDK Muta',
|
|
debugShowCheckedModeBanner: false,
|
|
theme: ThemeData(
|
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.white),
|
|
useMaterial3: true,
|
|
),
|
|
darkTheme: ThemeData(
|
|
colorScheme: ColorScheme.fromSeed(
|
|
seedColor: Colors.blue,
|
|
brightness: Brightness.dark,
|
|
),
|
|
useMaterial3: true,
|
|
dialogTheme: DialogThemeData(
|
|
backgroundColor: Colors.grey[900],
|
|
),
|
|
),
|
|
builder: (context, child) {
|
|
final originalTextScaler = MediaQuery.of(context).textScaler;
|
|
final clampedScale = originalTextScaler.clamp(minScaleFactor: 0.8, maxScaleFactor: 1.2);
|
|
return MediaQuery(
|
|
data: MediaQuery.of(context).copyWith(
|
|
textScaler: clampedScale,
|
|
),
|
|
child: child!,
|
|
);
|
|
},
|
|
home: const HomeScreen(),
|
|
);
|
|
}
|
|
}
|