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:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user