1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-13 00:08:24 +00:00

Add window setup to null_safe_app (#1044)

This commit is contained in:
Miguel Beltran
2022-03-04 13:01:19 +01:00
committed by GitHub
parent 3cfdc5927e
commit 9ed8a73e2d
50 changed files with 2383 additions and 1 deletions

View File

@@ -2,10 +2,26 @@
// 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:window_size/window_size.dart';
import 'goodapp.dart';
void main() {
setupWindow();
runApp(const GoodMyApp());
}
const double kWindowWidth = 400;
const double kWindowHeight = 400;
void setupWindow() {
if (!kIsWeb && (Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
WidgetsFlutterBinding.ensureInitialized();
setWindowTitle('Weather');
setWindowMinSize(const Size(kWindowWidth, kWindowHeight));
}
}