Add window desktop setup to jsonexample (#1042)

pull/1044/head
Miguel Beltran 3 years ago committed by GitHub
parent 83539ccdc8
commit aa6aef0ef6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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() {
setupWindow();
runApp(const MyApp());
}
void main() => 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

Loading…
Cancel
Save