mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 22:09:06 +00:00
Add window desktop setup to jsonexample (#1042)
This commit is contained in:
@@ -2,10 +2,28 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:jsonexample/tab_pages.dart';
|
import 'package:jsonexample/tab_pages.dart';
|
||||||
|
import 'package:window_size/window_size.dart';
|
||||||
|
|
||||||
void main() => runApp(const MyApp());
|
void main() {
|
||||||
|
setupWindow();
|
||||||
|
runApp(const MyApp());
|
||||||
|
}
|
||||||
|
|
||||||
|
const double kWindowWidth = 1200;
|
||||||
|
const double kWindowHeight = 800;
|
||||||
|
|
||||||
|
void setupWindow() {
|
||||||
|
if (!kIsWeb && (Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
|
||||||
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
setWindowTitle('JSON Sample');
|
||||||
|
setWindowMinSize(const Size(kWindowWidth, kWindowHeight));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class MyApp extends StatelessWidget {
|
class MyApp extends StatelessWidget {
|
||||||
const MyApp({Key? key}) : super(key: key);
|
const MyApp({Key? key}) : super(key: key);
|
||||||
|
|||||||
@@ -291,6 +291,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.11"
|
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:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -428,7 +435,7 @@ packages:
|
|||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.3"
|
version: "0.4.8"
|
||||||
timing:
|
timing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -464,6 +471,15 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.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:
|
yaml:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
name: jsonexample
|
name: jsonexample
|
||||||
description: A demonstration of JSON parsing
|
description: A demonstration of JSON parsing
|
||||||
|
publish_to: none
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.12.0 <3.0.0"
|
sdk: ">=2.12.0 <3.0.0"
|
||||||
@@ -12,6 +13,12 @@ dependencies:
|
|||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
|
window_size:
|
||||||
|
git:
|
||||||
|
url: https://github.com/google/flutter-desktop-embedding.git
|
||||||
|
path: plugins/window_size
|
||||||
|
ref: 03d957e8b5c99fc83cd4a781031b154ab3de8753
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|||||||
Reference in New Issue
Block a user