|
|
|
@ -2,13 +2,17 @@
|
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
|
import 'package:flutter/services.dart' show DeviceOrientation, SystemChrome;
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:veggieseasons/data/app_state.dart';
|
|
|
|
|
import 'package:veggieseasons/data/preferences.dart';
|
|
|
|
|
import 'package:veggieseasons/screens/home.dart';
|
|
|
|
|
import 'package:veggieseasons/styles.dart';
|
|
|
|
|
import 'package:window_size/window_size.dart';
|
|
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
@ -16,6 +20,7 @@ void main() {
|
|
|
|
|
DeviceOrientation.portraitUp,
|
|
|
|
|
DeviceOrientation.portraitDown,
|
|
|
|
|
]);
|
|
|
|
|
setupWindow();
|
|
|
|
|
|
|
|
|
|
runApp(
|
|
|
|
|
const RootRestorationScope(
|
|
|
|
@ -25,6 +30,24 @@ void main() {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const double windowWidth = 480;
|
|
|
|
|
const double windowHeight = 854;
|
|
|
|
|
|
|
|
|
|
void setupWindow() {
|
|
|
|
|
if (!kIsWeb && (Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
|
|
|
|
|
setWindowTitle('Veggie Seasons');
|
|
|
|
|
setWindowMinSize(const Size(windowWidth, windowHeight));
|
|
|
|
|
setWindowMaxSize(const Size(windowWidth, windowHeight));
|
|
|
|
|
getCurrentScreen().then((screen) {
|
|
|
|
|
setWindowFrame(Rect.fromCenter(
|
|
|
|
|
center: screen!.frame.center,
|
|
|
|
|
width: windowWidth,
|
|
|
|
|
height: windowHeight,
|
|
|
|
|
));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class VeggieApp extends StatefulWidget {
|
|
|
|
|
const VeggieApp({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
|
|