Add desktop window setup to isolate_example (#1041)

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

@ -12,13 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:window_size/window_size.dart';
import 'data_transfer_page.dart';
import 'infinite_process_page.dart';
import 'performance_page.dart';
void main() {
setupWindow();
runApp(
const MaterialApp(
home: HomePage(),
@ -26,6 +31,17 @@ void main() {
);
}
const double kWindowWidth = 1024;
const double kWindowHeight = 800;
void setupWindow() {
if (!kIsWeb && (Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
WidgetsFlutterBinding.ensureInitialized();
setWindowTitle('Isolate Example');
setWindowMinSize(const Size(kWindowWidth, kWindowHeight));
}
}
class HomePage extends StatelessWidget {
const HomePage({Key? key}) : super(key: key);

@ -81,6 +81,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:
@ -155,7 +162,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.3"
version: "0.4.8"
typed_data:
dependency: transitive
description:
@ -170,6 +177,15 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
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"
sdks:
dart: ">=2.14.0 <3.0.0"
flutter: ">=1.16.0"

@ -1,6 +1,7 @@
name: isolate_example
description: A Flutter sample to demonstrate isolates
version: 1.0.0+1
publish_to: none
environment:
sdk: ">=2.12.0 <3.0.0"
@ -9,6 +10,11 @@ dependencies:
flutter:
sdk: flutter
provider: ^5.0.0
window_size:
git:
url: https://github.com/google/flutter-desktop-embedding.git
path: plugins/window_size
ref: 03d957e8b5c99fc83cd4a781031b154ab3de8753
dev_dependencies:
flutter_test:

Loading…
Cancel
Save