|
|
@ -2,12 +2,8 @@
|
|
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
|
|
import 'dart:io' show Platform;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:flutter/foundation.dart' show kIsWeb;
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:url_strategy/url_strategy.dart';
|
|
|
|
import 'package:url_strategy/url_strategy.dart';
|
|
|
|
import 'package:window_size/window_size.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import 'src/app.dart';
|
|
|
|
import 'src/app.dart';
|
|
|
|
|
|
|
|
|
|
|
@ -23,25 +19,8 @@ void main() {
|
|
|
|
setHashUrlStrategy();
|
|
|
|
setHashUrlStrategy();
|
|
|
|
// setPathUrlStrategy();
|
|
|
|
// setPathUrlStrategy();
|
|
|
|
|
|
|
|
|
|
|
|
setupWindow();
|
|
|
|
|
|
|
|
runApp(const Bookstore());
|
|
|
|
runApp(const Bookstore());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const double windowWidth = 480;
|
|
|
|
const double windowWidth = 480;
|
|
|
|
const double windowHeight = 854;
|
|
|
|
const double windowHeight = 854;
|
|
|
|
|
|
|
|
|
|
|
|
void setupWindow() {
|
|
|
|
|
|
|
|
if (!kIsWeb && (Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
|
|
|
|
|
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
|
|
|
|
setWindowTitle('Navigation and routing');
|
|
|
|
|
|
|
|
setWindowMinSize(const Size(windowWidth, windowHeight));
|
|
|
|
|
|
|
|
setWindowMaxSize(const Size(windowWidth, windowHeight));
|
|
|
|
|
|
|
|
getCurrentScreen().then((screen) {
|
|
|
|
|
|
|
|
setWindowFrame(Rect.fromCenter(
|
|
|
|
|
|
|
|
center: screen!.frame.center,
|
|
|
|
|
|
|
|
width: windowWidth,
|
|
|
|
|
|
|
|
height: windowHeight,
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|