mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 22:09:06 +00:00
Add window desktop setup to navigation_and_routing (#1043)
This commit is contained in:
@@ -2,8 +2,12 @@
|
||||
// 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.
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:url_strategy/url_strategy.dart';
|
||||
import 'package:window_size/window_size.dart';
|
||||
|
||||
import 'src/app.dart';
|
||||
|
||||
@@ -19,5 +23,25 @@ void main() {
|
||||
setHashUrlStrategy();
|
||||
// setPathUrlStrategy();
|
||||
|
||||
setupWindow();
|
||||
runApp(const Bookstore());
|
||||
}
|
||||
|
||||
const double windowWidth = 480;
|
||||
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,
|
||||
));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,6 +212,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.11"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.3"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -254,13 +261,6 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.0"
|
||||
pedantic:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.11.1"
|
||||
plugin_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -377,21 +377,21 @@ packages:
|
||||
name: test
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.17.12"
|
||||
version: "1.19.5"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.3"
|
||||
version: "0.4.8"
|
||||
test_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_core
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.2"
|
||||
version: "0.4.9"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -497,6 +497,15 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
window_size:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "plugins/window_size"
|
||||
ref: "03d957e8b5c99fc83cd4a781031b154ab3de8753"
|
||||
resolved-ref: "03d957e8b5c99fc83cd4a781031b154ab3de8753"
|
||||
url: "https://github.com/google/flutter-desktop-embedding.git"
|
||||
source: git
|
||||
version: "0.1.0"
|
||||
yaml:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -14,6 +14,11 @@ dependencies:
|
||||
quiver: ^3.0.0
|
||||
url_launcher: ^6.0.0
|
||||
url_strategy: ^0.2.0
|
||||
window_size:
|
||||
git:
|
||||
url: https://github.com/google/flutter-desktop-embedding.git
|
||||
path: plugins/window_size
|
||||
ref: 03d957e8b5c99fc83cd4a781031b154ab3de8753
|
||||
dev_dependencies:
|
||||
flutter_lints: ^1.0.0
|
||||
flutter_test:
|
||||
|
||||
Reference in New Issue
Block a user