Skip to content

Commit daf39ce

Browse files
committed
refactor: remove window_size plugin and manual window configuration from samples
1 parent 6e9d36a commit daf39ce

16 files changed

Lines changed: 5 additions & 128 deletions

File tree

animations/lib/main.dart

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,16 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
import 'dart:io' show Platform;
6-
7-
import 'package:flutter/foundation.dart' show kIsWeb;
85
import 'package:flutter/material.dart';
96
import 'package:go_router/go_router.dart';
10-
import 'package:window_size/window_size.dart';
117

128
import 'src/basics/basics.dart';
139
import 'src/misc/misc.dart';
1410

1511
void main() {
16-
setupWindow();
1712
runApp(const AnimationSamples());
1813
}
1914

20-
const double windowWidth = 480;
21-
const double windowHeight = 854;
22-
23-
void setupWindow() {
24-
if (!kIsWeb &&
25-
(Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
26-
WidgetsFlutterBinding.ensureInitialized();
27-
setWindowTitle('Animation Samples');
28-
setWindowMinSize(const Size(windowWidth, windowHeight));
29-
setWindowMaxSize(const Size(windowWidth, windowHeight));
30-
getCurrentScreen().then((screen) {
31-
setWindowFrame(
32-
Rect.fromCenter(
33-
center: screen!.frame.center,
34-
width: windowWidth,
35-
height: windowHeight,
36-
),
37-
);
38-
});
39-
}
40-
}
41-
4215
class Demo {
4316
final String name;
4417
final String route;

animations/linux/flutter/generated_plugin_registrant.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66

77
#include "generated_plugin_registrant.h"
88

9-
#include <window_size/window_size_plugin.h>
109

1110
void fl_register_plugins(FlPluginRegistry* registry) {
12-
g_autoptr(FlPluginRegistrar) window_size_registrar =
13-
fl_plugin_registry_get_registrar_for_plugin(registry, "WindowSizePlugin");
14-
window_size_plugin_register_with_registrar(window_size_registrar);
1511
}

animations/linux/flutter/generated_plugins.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#
44

55
list(APPEND FLUTTER_PLUGIN_LIST
6-
window_size
76
)
87

98
list(APPEND FLUTTER_FFI_PLUGIN_LIST

animations/macos/Flutter/GeneratedPluginRegistrant.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import FlutterMacOS
66
import Foundation
77

8-
import window_size
98

109
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
11-
WindowSizePlugin.register(with: registry.registrar(forPlugin: "WindowSizePlugin"))
1210
}

animations/pubspec.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ dependencies:
1212
sdk: flutter
1313
flutter_animate: ^4.1.0
1414
go_router: ^16.0.0
15-
window_size: # plugin is not yet part of the flutter framework
16-
git:
17-
url: https://github.com/google/flutter-desktop-embedding.git
18-
path: plugins/window_size
1915

2016
dev_dependencies:
2117
analysis_defaults:

animations/windows/flutter/generated_plugin_registrant.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
#include "generated_plugin_registrant.h"
88

9-
#include <window_size/window_size_plugin.h>
109

1110
void RegisterPlugins(flutter::PluginRegistry* registry) {
12-
WindowSizePluginRegisterWithRegistrar(
13-
registry->GetRegistrarForPlugin("WindowSizePlugin"));
1411
}

animations/windows/flutter/generated_plugins.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#
44

55
list(APPEND FLUTTER_PLUGIN_LIST
6-
window_size
76
)
87

98
list(APPEND FLUTTER_FFI_PLUGIN_LIST

cupertino_gallery/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: cupertino_gallery
22
description: A Flutter project showcasing supported Cupertino components.
33
publish_to: "none"
44
version: 1.0.0+1
5+
resolution: workspace
56

67
environment:
78
sdk: ^3.9.0-0

desktop_photo_search/fluent_ui/lib/main.dart

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import 'package:flutter/services.dart';
1010
import 'package:logging/logging.dart';
1111
import 'package:menubar/menubar.dart' as menubar;
1212
import 'package:provider/provider.dart';
13-
import 'package:window_size/window_size.dart';
1413

1514
import 'src/model/photo_search_model.dart';
1615
import 'src/unsplash/unsplash.dart';
@@ -37,7 +36,7 @@ void main() {
3736
exit(1);
3837
}
3938

40-
setupWindow();
39+
// Removed setupWindow() call
4140

4241
runApp(
4342
ChangeNotifierProvider<PhotoSearchModel>(
@@ -48,16 +47,6 @@ void main() {
4847
);
4948
}
5049

51-
const double windowWidth = 1024;
52-
const double windowHeight = 800;
53-
54-
void setupWindow() {
55-
if (!kIsWeb &&
56-
(Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
57-
WidgetsFlutterBinding.ensureInitialized();
58-
setWindowMinSize(const Size(windowWidth, windowHeight));
59-
}
60-
}
6150

6251
class UnsplashSearchApp extends StatelessWidget {
6352
const UnsplashSearchApp({super.key});

desktop_photo_search/fluent_ui/pubspec.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ dependencies:
2626
transparent_image: ^2.0.1
2727
url_launcher: ^6.1.12
2828
uuid: ^4.0.0
29-
window_size:
30-
git:
31-
url: https://github.com/google/flutter-desktop-embedding.git
32-
path: plugins/window_size
3329

3430
dev_dependencies:
3531
analysis_defaults:

0 commit comments

Comments
 (0)