second commit
This commit is contained in:
37
lib/main.dart
Normal file
37
lib/main.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import 'app/app.dart';
|
||||
import 'core/services/sound_service.dart';
|
||||
import 'data/datasources/local_store.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
await _configureChrome();
|
||||
|
||||
await LocalStore.instance.init();
|
||||
await SoundService.instance.preload();
|
||||
|
||||
runApp(const ProviderScope(child: NearlePosApp()));
|
||||
}
|
||||
|
||||
/// Locks the terminal into landscape and hides the system bars.
|
||||
///
|
||||
/// Both calls are Android/iOS only. On desktop the window manager owns sizing
|
||||
/// and chrome, so we skip them — invoking them there is at best a no-op and can
|
||||
/// raise a MissingPluginException on some engine builds.
|
||||
Future<void> _configureChrome() async {
|
||||
final isMobile = defaultTargetPlatform == TargetPlatform.android ||
|
||||
defaultTargetPlatform == TargetPlatform.iOS;
|
||||
if (kIsWeb || !isMobile) return;
|
||||
|
||||
await SystemChrome.setPreferredOrientations([
|
||||
DeviceOrientation.landscapeLeft,
|
||||
DeviceOrientation.landscapeRight,
|
||||
]);
|
||||
|
||||
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
|
||||
}
|
||||
Reference in New Issue
Block a user