desktop push
This commit is contained in:
@@ -9,8 +9,10 @@ import 'package:bus_infotainment/remaster/dashboard.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:shelf/shelf.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
import 'package:bus_infotainment/remaster/InitialStartup.dart' as remaster;
|
||||
import 'package:shelf/shelf_io.dart' as shelf_io;
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
@@ -19,10 +21,11 @@ void main() async {
|
||||
await windowManager.ensureInitialized();
|
||||
|
||||
WindowOptions options = WindowOptions(
|
||||
size: Size(411.4, 850.3),
|
||||
title: 'Bus Infotainment',
|
||||
|
||||
);
|
||||
|
||||
windowManager.setAspectRatio(411.4 / 850.3);
|
||||
// windowManager.setAspectRatio(411.4 / 850.3);
|
||||
|
||||
await windowManager.waitUntilReadyToShow(options, () async {
|
||||
await windowManager.show();
|
||||
@@ -30,22 +33,31 @@ void main() async {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// {
|
||||
// // Web server test
|
||||
//
|
||||
// var handler = const Pipeline().addMiddleware(logRequests()).addHandler((Request request) {
|
||||
// return Response.ok('Hello, world!');
|
||||
// });
|
||||
// var server = await shelf_io.serve(handler, '0.0.0.0', 8080);
|
||||
// server.autoCompress = true;
|
||||
//
|
||||
// print('Serving at http://${server.address.host}:${server.port}');
|
||||
//
|
||||
// // get the IP address
|
||||
// for (var interface in await NetworkInterface.list()) {
|
||||
// for (var addr in interface.addresses) {
|
||||
// print('Interface ${interface.name} has address ${addr.address}');
|
||||
// print('Try http://${addr.address}:${server.port}');
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
LiveInformation liveInformation = LiveInformation();
|
||||
await liveInformation.initialize();
|
||||
|
||||
runApp(const MyApp());
|
||||
|
||||
// Disalow screen to turn off on android
|
||||
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
|
||||
// Disalow landscape mode
|
||||
await SystemChrome.setPreferredOrientations([
|
||||
DeviceOrientation.portraitUp,
|
||||
DeviceOrientation.portraitDown,
|
||||
]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
|
||||
Reference in New Issue
Block a user