From 8c3acfc6dd9a07474b50aedf90106379eae01281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=81=A5=E8=8E=B9?= Date: Sun, 27 Oct 2024 10:34:17 +0800 Subject: [PATCH] wip: --- .github/workflows/build.yml | 2 +- .github/workflows/test.yml | 2 +- packages/window_manager_linux/.metadata | 27 -------- packages/window_manager_linux/CHANGELOG.md | 2 +- .../analysis_options.yaml | 5 +- .../lib/window_manager_linux.dart | 14 ---- .../window_manager_linux_method_channel.dart | 17 ----- ...ndow_manager_linux_platform_interface.dart | 29 --------- packages/window_manager_linux/pubspec.yaml | 64 ++----------------- ...dow_manager_linux_method_channel_test.dart | 27 -------- .../test/window_manager_linux_test.dart | 29 --------- packages/window_manager_macos/.metadata | 30 --------- packages/window_manager_macos/CHANGELOG.md | 2 +- .../analysis_options.yaml | 5 +- .../lib/window_manager_macos.dart | 8 --- .../window_manager_macos_method_channel.dart | 17 ----- ...ndow_manager_macos_platform_interface.dart | 29 --------- .../Classes/WindowManagerMacosPlugin.swift | 19 ------ .../macos/window_manager_macos.podspec | 23 ------- packages/window_manager_macos/pubspec.yaml | 53 ++------------- ...dow_manager_macos_method_channel_test.dart | 27 -------- .../test/window_manager_macos_test.dart | 29 --------- .../CHANGELOG.md | 2 +- .../pubspec.yaml | 2 +- packages/window_manager_windows/.metadata | 27 -------- packages/window_manager_windows/CHANGELOG.md | 2 +- .../analysis_options.yaml | 5 +- .../lib/window_manager_windows.dart | 14 ---- ...window_manager_windows_method_channel.dart | 17 ----- ...ow_manager_windows_platform_interface.dart | 29 --------- packages/window_manager_windows/pubspec.yaml | 63 ++---------------- ...w_manager_windows_method_channel_test.dart | 27 -------- .../test/window_manager_windows_test.dart | 29 --------- 33 files changed, 27 insertions(+), 650 deletions(-) delete mode 100644 packages/window_manager_linux/.metadata delete mode 100644 packages/window_manager_linux/lib/window_manager_linux.dart delete mode 100644 packages/window_manager_linux/lib/window_manager_linux_method_channel.dart delete mode 100644 packages/window_manager_linux/lib/window_manager_linux_platform_interface.dart delete mode 100644 packages/window_manager_linux/test/window_manager_linux_method_channel_test.dart delete mode 100644 packages/window_manager_linux/test/window_manager_linux_test.dart delete mode 100644 packages/window_manager_macos/.metadata delete mode 100644 packages/window_manager_macos/lib/window_manager_macos.dart delete mode 100644 packages/window_manager_macos/lib/window_manager_macos_method_channel.dart delete mode 100644 packages/window_manager_macos/lib/window_manager_macos_platform_interface.dart delete mode 100644 packages/window_manager_macos/macos/Classes/WindowManagerMacosPlugin.swift delete mode 100644 packages/window_manager_macos/macos/window_manager_macos.podspec delete mode 100644 packages/window_manager_macos/test/window_manager_macos_method_channel_test.dart delete mode 100644 packages/window_manager_macos/test/window_manager_macos_test.dart delete mode 100644 packages/window_manager_windows/.metadata delete mode 100644 packages/window_manager_windows/lib/window_manager_windows.dart delete mode 100644 packages/window_manager_windows/lib/window_manager_windows_method_channel.dart delete mode 100644 packages/window_manager_windows/lib/window_manager_windows_platform_interface.dart delete mode 100644 packages/window_manager_windows/test/window_manager_windows_method_channel_test.dart delete mode 100644 packages/window_manager_windows/test/window_manager_windows_test.dart diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4fbfdad7..e41eeb00 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: - run: | sudo apt-get update sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev - sudo apt-get install -y keybinder-3.0 + sudo apt-get install -y ayatana-appindicator3-0.1 - uses: bluefireteam/melos-action@v3 - working-directory: ./packages/window_manager/example run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2c720b77..88fb1685 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: flutter-version: "3.24.3" - run: | sudo apt-get update -y - sudo apt-get install -y ninja-build libgtk-3-dev libappindicator3-dev xvfb + sudo apt-get install -y ninja-build libgtk-3-dev ayatana-appindicator3-0.1 xvfb - uses: bluefireteam/melos-action@v3 - working-directory: ./packages/window_manager/example run: xvfb-run -a flutter test integration_test -v diff --git a/packages/window_manager_linux/.metadata b/packages/window_manager_linux/.metadata deleted file mode 100644 index 17ceedf5..00000000 --- a/packages/window_manager_linux/.metadata +++ /dev/null @@ -1,27 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: "2663184aa79047d0a33a14a3b607954f8fdd8730" - channel: "stable" - -project_type: plugin - -# Tracks metadata for the flutter migrate command -migration: - platforms: - - platform: root - create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 - base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 - - # User provided section - - # List of Local paths (relative to this file) that should be - # ignored by the migrate tool. - # - # Files that are not part of the templates will be ignored by default. - unmanaged_files: - - 'lib/main.dart' - - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/packages/window_manager_linux/CHANGELOG.md b/packages/window_manager_linux/CHANGELOG.md index d0bd041d..7928521c 100644 --- a/packages/window_manager_linux/CHANGELOG.md +++ b/packages/window_manager_linux/CHANGELOG.md @@ -1,3 +1,3 @@ -## 0.0.1 +## 1.0.1 * Initial release. diff --git a/packages/window_manager_linux/analysis_options.yaml b/packages/window_manager_linux/analysis_options.yaml index a5744c1c..9033bb29 100644 --- a/packages/window_manager_linux/analysis_options.yaml +++ b/packages/window_manager_linux/analysis_options.yaml @@ -1,4 +1 @@ -include: package:flutter_lints/flutter.yaml - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options +include: package:mostly_reasonable_lints/analysis_options.yaml diff --git a/packages/window_manager_linux/lib/window_manager_linux.dart b/packages/window_manager_linux/lib/window_manager_linux.dart deleted file mode 100644 index 8efb5817..00000000 --- a/packages/window_manager_linux/lib/window_manager_linux.dart +++ /dev/null @@ -1,14 +0,0 @@ -// You have generated a new plugin project without specifying the `--platforms` -// flag. A plugin project with no platform support was generated. To add a -// platform, run `flutter create -t plugin --platforms .` under the -// same directory. You can also find a detailed instruction on how to add -// platforms in the `pubspec.yaml` at -// https://flutter.dev/to/pubspec-plugin-platforms. - -import 'window_manager_linux_platform_interface.dart'; - -class WindowManagerLinux { - Future getPlatformVersion() { - return WindowManagerLinuxPlatform.instance.getPlatformVersion(); - } -} diff --git a/packages/window_manager_linux/lib/window_manager_linux_method_channel.dart b/packages/window_manager_linux/lib/window_manager_linux_method_channel.dart deleted file mode 100644 index fdc4cbd5..00000000 --- a/packages/window_manager_linux/lib/window_manager_linux_method_channel.dart +++ /dev/null @@ -1,17 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; - -import 'window_manager_linux_platform_interface.dart'; - -/// An implementation of [WindowManagerLinuxPlatform] that uses method channels. -class MethodChannelWindowManagerLinux extends WindowManagerLinuxPlatform { - /// The method channel used to interact with the native platform. - @visibleForTesting - final methodChannel = const MethodChannel('window_manager_linux'); - - @override - Future getPlatformVersion() async { - final version = await methodChannel.invokeMethod('getPlatformVersion'); - return version; - } -} diff --git a/packages/window_manager_linux/lib/window_manager_linux_platform_interface.dart b/packages/window_manager_linux/lib/window_manager_linux_platform_interface.dart deleted file mode 100644 index d2f89a0c..00000000 --- a/packages/window_manager_linux/lib/window_manager_linux_platform_interface.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:plugin_platform_interface/plugin_platform_interface.dart'; - -import 'window_manager_linux_method_channel.dart'; - -abstract class WindowManagerLinuxPlatform extends PlatformInterface { - /// Constructs a WindowManagerLinuxPlatform. - WindowManagerLinuxPlatform() : super(token: _token); - - static final Object _token = Object(); - - static WindowManagerLinuxPlatform _instance = MethodChannelWindowManagerLinux(); - - /// The default instance of [WindowManagerLinuxPlatform] to use. - /// - /// Defaults to [MethodChannelWindowManagerLinux]. - static WindowManagerLinuxPlatform get instance => _instance; - - /// Platform-specific implementations should set this with their own - /// platform-specific class that extends [WindowManagerLinuxPlatform] when - /// they register themselves. - static set instance(WindowManagerLinuxPlatform instance) { - PlatformInterface.verifyToken(instance, _token); - _instance = instance; - } - - Future getPlatformVersion() { - throw UnimplementedError('platformVersion() has not been implemented.'); - } -} diff --git a/packages/window_manager_linux/pubspec.yaml b/packages/window_manager_linux/pubspec.yaml index bc14f77d..a7f39989 100644 --- a/packages/window_manager_linux/pubspec.yaml +++ b/packages/window_manager_linux/pubspec.yaml @@ -1,11 +1,11 @@ name: window_manager_linux description: Linux implementation of the window_manager plugin. -version: 0.0.1 +version: 1.0.1 repository: https://github.com/leanflutter/window_manager/tree/main/packages/window_manager_linux environment: - sdk: ^3.5.3 - flutter: '>=3.3.0' + sdk: ">=3.0.0 <4.0.0" + flutter: ">=3.3.0" dependencies: flutter: @@ -15,61 +15,11 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^4.0.0 + mostly_reasonable_lints: ^0.1.2 -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. flutter: - # This section identifies this Flutter project as a plugin project. - # The 'pluginClass' specifies the class (in Java, Kotlin, Swift, Objective-C, etc.) - # which should be registered in the plugin registry. This is required for - # using method channels. - # The Android 'package' specifies package in which the registered class is. - # This is required for using method channels on Android. - # The 'ffiPlugin' specifies that native code should be built and bundled. - # This is required for using `dart:ffi`. - # All these are used by the tooling to maintain consistency when - # adding or updating assets for this project. plugin: platforms: - # This plugin project was generated without specifying any - # platforms with the `--platform` argument. If you see the `some_platform` map below, remove it and - # then add platforms following the instruction here: - # https://flutter.dev/to/pubspec-plugin-platforms - # ------------------- - some_platform: - pluginClass: somePluginClass - # ------------------- - - # To add assets to your plugin package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # - # For details regarding assets in packages, see - # https://flutter.dev/to/asset-from-package - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/to/resolution-aware-images - - # To add custom fonts to your plugin package, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts in packages, see - # https://flutter.dev/to/font-from-package + linux: + pluginClass: WindowManagerLinuxPlugin + \ No newline at end of file diff --git a/packages/window_manager_linux/test/window_manager_linux_method_channel_test.dart b/packages/window_manager_linux/test/window_manager_linux_method_channel_test.dart deleted file mode 100644 index 8cb565d7..00000000 --- a/packages/window_manager_linux/test/window_manager_linux_method_channel_test.dart +++ /dev/null @@ -1,27 +0,0 @@ -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:window_manager_linux/window_manager_linux_method_channel.dart'; - -void main() { - TestWidgetsFlutterBinding.ensureInitialized(); - - MethodChannelWindowManagerLinux platform = MethodChannelWindowManagerLinux(); - const MethodChannel channel = MethodChannel('window_manager_linux'); - - setUp(() { - TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler( - channel, - (MethodCall methodCall) async { - return '42'; - }, - ); - }); - - tearDown(() { - TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(channel, null); - }); - - test('getPlatformVersion', () async { - expect(await platform.getPlatformVersion(), '42'); - }); -} diff --git a/packages/window_manager_linux/test/window_manager_linux_test.dart b/packages/window_manager_linux/test/window_manager_linux_test.dart deleted file mode 100644 index 3fbc0c58..00000000 --- a/packages/window_manager_linux/test/window_manager_linux_test.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:flutter_test/flutter_test.dart'; -import 'package:window_manager_linux/window_manager_linux.dart'; -import 'package:window_manager_linux/window_manager_linux_platform_interface.dart'; -import 'package:window_manager_linux/window_manager_linux_method_channel.dart'; -import 'package:plugin_platform_interface/plugin_platform_interface.dart'; - -class MockWindowManagerLinuxPlatform - with MockPlatformInterfaceMixin - implements WindowManagerLinuxPlatform { - - @override - Future getPlatformVersion() => Future.value('42'); -} - -void main() { - final WindowManagerLinuxPlatform initialPlatform = WindowManagerLinuxPlatform.instance; - - test('$MethodChannelWindowManagerLinux is the default instance', () { - expect(initialPlatform, isInstanceOf()); - }); - - test('getPlatformVersion', () async { - WindowManagerLinux windowManagerLinuxPlugin = WindowManagerLinux(); - MockWindowManagerLinuxPlatform fakePlatform = MockWindowManagerLinuxPlatform(); - WindowManagerLinuxPlatform.instance = fakePlatform; - - expect(await windowManagerLinuxPlugin.getPlatformVersion(), '42'); - }); -} diff --git a/packages/window_manager_macos/.metadata b/packages/window_manager_macos/.metadata deleted file mode 100644 index b2763f65..00000000 --- a/packages/window_manager_macos/.metadata +++ /dev/null @@ -1,30 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: "2663184aa79047d0a33a14a3b607954f8fdd8730" - channel: "stable" - -project_type: plugin - -# Tracks metadata for the flutter migrate command -migration: - platforms: - - platform: root - create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 - base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 - - platform: macos - create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 - base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 - - # User provided section - - # List of Local paths (relative to this file) that should be - # ignored by the migrate tool. - # - # Files that are not part of the templates will be ignored by default. - unmanaged_files: - - 'lib/main.dart' - - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/packages/window_manager_macos/CHANGELOG.md b/packages/window_manager_macos/CHANGELOG.md index d0bd041d..7928521c 100644 --- a/packages/window_manager_macos/CHANGELOG.md +++ b/packages/window_manager_macos/CHANGELOG.md @@ -1,3 +1,3 @@ -## 0.0.1 +## 1.0.1 * Initial release. diff --git a/packages/window_manager_macos/analysis_options.yaml b/packages/window_manager_macos/analysis_options.yaml index a5744c1c..9033bb29 100644 --- a/packages/window_manager_macos/analysis_options.yaml +++ b/packages/window_manager_macos/analysis_options.yaml @@ -1,4 +1 @@ -include: package:flutter_lints/flutter.yaml - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options +include: package:mostly_reasonable_lints/analysis_options.yaml diff --git a/packages/window_manager_macos/lib/window_manager_macos.dart b/packages/window_manager_macos/lib/window_manager_macos.dart deleted file mode 100644 index 6fb70378..00000000 --- a/packages/window_manager_macos/lib/window_manager_macos.dart +++ /dev/null @@ -1,8 +0,0 @@ - -import 'window_manager_macos_platform_interface.dart'; - -class WindowManagerMacos { - Future getPlatformVersion() { - return WindowManagerMacosPlatform.instance.getPlatformVersion(); - } -} diff --git a/packages/window_manager_macos/lib/window_manager_macos_method_channel.dart b/packages/window_manager_macos/lib/window_manager_macos_method_channel.dart deleted file mode 100644 index 64fc778d..00000000 --- a/packages/window_manager_macos/lib/window_manager_macos_method_channel.dart +++ /dev/null @@ -1,17 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; - -import 'window_manager_macos_platform_interface.dart'; - -/// An implementation of [WindowManagerMacosPlatform] that uses method channels. -class MethodChannelWindowManagerMacos extends WindowManagerMacosPlatform { - /// The method channel used to interact with the native platform. - @visibleForTesting - final methodChannel = const MethodChannel('window_manager_macos'); - - @override - Future getPlatformVersion() async { - final version = await methodChannel.invokeMethod('getPlatformVersion'); - return version; - } -} diff --git a/packages/window_manager_macos/lib/window_manager_macos_platform_interface.dart b/packages/window_manager_macos/lib/window_manager_macos_platform_interface.dart deleted file mode 100644 index 0ed17eda..00000000 --- a/packages/window_manager_macos/lib/window_manager_macos_platform_interface.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:plugin_platform_interface/plugin_platform_interface.dart'; - -import 'window_manager_macos_method_channel.dart'; - -abstract class WindowManagerMacosPlatform extends PlatformInterface { - /// Constructs a WindowManagerMacosPlatform. - WindowManagerMacosPlatform() : super(token: _token); - - static final Object _token = Object(); - - static WindowManagerMacosPlatform _instance = MethodChannelWindowManagerMacos(); - - /// The default instance of [WindowManagerMacosPlatform] to use. - /// - /// Defaults to [MethodChannelWindowManagerMacos]. - static WindowManagerMacosPlatform get instance => _instance; - - /// Platform-specific implementations should set this with their own - /// platform-specific class that extends [WindowManagerMacosPlatform] when - /// they register themselves. - static set instance(WindowManagerMacosPlatform instance) { - PlatformInterface.verifyToken(instance, _token); - _instance = instance; - } - - Future getPlatformVersion() { - throw UnimplementedError('platformVersion() has not been implemented.'); - } -} diff --git a/packages/window_manager_macos/macos/Classes/WindowManagerMacosPlugin.swift b/packages/window_manager_macos/macos/Classes/WindowManagerMacosPlugin.swift deleted file mode 100644 index 1452f679..00000000 --- a/packages/window_manager_macos/macos/Classes/WindowManagerMacosPlugin.swift +++ /dev/null @@ -1,19 +0,0 @@ -import Cocoa -import FlutterMacOS - -public class WindowManagerMacosPlugin: NSObject, FlutterPlugin { - public static func register(with registrar: FlutterPluginRegistrar) { - let channel = FlutterMethodChannel(name: "window_manager_macos", binaryMessenger: registrar.messenger) - let instance = WindowManagerMacosPlugin() - registrar.addMethodCallDelegate(instance, channel: channel) - } - - public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { - switch call.method { - case "getPlatformVersion": - result("macOS " + ProcessInfo.processInfo.operatingSystemVersionString) - default: - result(FlutterMethodNotImplemented) - } - } -} diff --git a/packages/window_manager_macos/macos/window_manager_macos.podspec b/packages/window_manager_macos/macos/window_manager_macos.podspec deleted file mode 100644 index 21585b55..00000000 --- a/packages/window_manager_macos/macos/window_manager_macos.podspec +++ /dev/null @@ -1,23 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. -# Run `pod lib lint window_manager_macos.podspec` to validate before publishing. -# -Pod::Spec.new do |s| - s.name = 'window_manager_macos' - s.version = '0.0.1' - s.summary = 'A new Flutter plugin project.' - s.description = <<-DESC -A new Flutter plugin project. - DESC - s.homepage = 'http://example.com' - s.license = { :file => '../LICENSE' } - s.author = { 'Your Company' => 'email@example.com' } - - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.dependency 'FlutterMacOS' - - s.platform = :osx, '10.11' - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } - s.swift_version = '5.0' -end diff --git a/packages/window_manager_macos/pubspec.yaml b/packages/window_manager_macos/pubspec.yaml index 31fe4c05..a50b723a 100644 --- a/packages/window_manager_macos/pubspec.yaml +++ b/packages/window_manager_macos/pubspec.yaml @@ -1,11 +1,11 @@ name: window_manager_macos description: macOS implementation of the window_manager plugin. -version: 0.0.1 +version: 1.0.1 repository: https://github.com/leanflutter/window_manager/tree/main/packages/window_manager_macos environment: - sdk: ^3.5.3 - flutter: '>=3.3.0' + sdk: ">=3.0.0 <4.0.0" + flutter: ">=3.3.0" dependencies: flutter: @@ -15,55 +15,10 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^4.0.0 + mostly_reasonable_lints: ^0.1.2 -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. flutter: - # This section identifies this Flutter project as a plugin project. - # The 'pluginClass' specifies the class (in Java, Kotlin, Swift, Objective-C, etc.) - # which should be registered in the plugin registry. This is required for - # using method channels. - # The Android 'package' specifies package in which the registered class is. - # This is required for using method channels on Android. - # The 'ffiPlugin' specifies that native code should be built and bundled. - # This is required for using `dart:ffi`. - # All these are used by the tooling to maintain consistency when - # adding or updating assets for this project. plugin: platforms: macos: pluginClass: WindowManagerMacosPlugin - - # To add assets to your plugin package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # - # For details regarding assets in packages, see - # https://flutter.dev/to/asset-from-package - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/to/resolution-aware-images - - # To add custom fonts to your plugin package, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts in packages, see - # https://flutter.dev/to/font-from-package diff --git a/packages/window_manager_macos/test/window_manager_macos_method_channel_test.dart b/packages/window_manager_macos/test/window_manager_macos_method_channel_test.dart deleted file mode 100644 index 35a2bc23..00000000 --- a/packages/window_manager_macos/test/window_manager_macos_method_channel_test.dart +++ /dev/null @@ -1,27 +0,0 @@ -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:window_manager_macos/window_manager_macos_method_channel.dart'; - -void main() { - TestWidgetsFlutterBinding.ensureInitialized(); - - MethodChannelWindowManagerMacos platform = MethodChannelWindowManagerMacos(); - const MethodChannel channel = MethodChannel('window_manager_macos'); - - setUp(() { - TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler( - channel, - (MethodCall methodCall) async { - return '42'; - }, - ); - }); - - tearDown(() { - TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(channel, null); - }); - - test('getPlatformVersion', () async { - expect(await platform.getPlatformVersion(), '42'); - }); -} diff --git a/packages/window_manager_macos/test/window_manager_macos_test.dart b/packages/window_manager_macos/test/window_manager_macos_test.dart deleted file mode 100644 index 1db03bca..00000000 --- a/packages/window_manager_macos/test/window_manager_macos_test.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:flutter_test/flutter_test.dart'; -import 'package:window_manager_macos/window_manager_macos.dart'; -import 'package:window_manager_macos/window_manager_macos_platform_interface.dart'; -import 'package:window_manager_macos/window_manager_macos_method_channel.dart'; -import 'package:plugin_platform_interface/plugin_platform_interface.dart'; - -class MockWindowManagerMacosPlatform - with MockPlatformInterfaceMixin - implements WindowManagerMacosPlatform { - - @override - Future getPlatformVersion() => Future.value('42'); -} - -void main() { - final WindowManagerMacosPlatform initialPlatform = WindowManagerMacosPlatform.instance; - - test('$MethodChannelWindowManagerMacos is the default instance', () { - expect(initialPlatform, isInstanceOf()); - }); - - test('getPlatformVersion', () async { - WindowManagerMacos windowManagerMacosPlugin = WindowManagerMacos(); - MockWindowManagerMacosPlatform fakePlatform = MockWindowManagerMacosPlatform(); - WindowManagerMacosPlatform.instance = fakePlatform; - - expect(await windowManagerMacosPlugin.getPlatformVersion(), '42'); - }); -} diff --git a/packages/window_manager_platform_interface/CHANGELOG.md b/packages/window_manager_platform_interface/CHANGELOG.md index d0bd041d..7928521c 100644 --- a/packages/window_manager_platform_interface/CHANGELOG.md +++ b/packages/window_manager_platform_interface/CHANGELOG.md @@ -1,3 +1,3 @@ -## 0.0.1 +## 1.0.1 * Initial release. diff --git a/packages/window_manager_platform_interface/pubspec.yaml b/packages/window_manager_platform_interface/pubspec.yaml index 92b2e170..17529dd1 100644 --- a/packages/window_manager_platform_interface/pubspec.yaml +++ b/packages/window_manager_platform_interface/pubspec.yaml @@ -1,6 +1,6 @@ name: window_manager_platform_interface description: A common platform interface for the window_manager plugin. -version: 0.0.1 +version: 1.0.1 homepage: https://github.com/leanflutter/window_manager/blob/main/packages/window_manager_platform_interface environment: diff --git a/packages/window_manager_windows/.metadata b/packages/window_manager_windows/.metadata deleted file mode 100644 index 17ceedf5..00000000 --- a/packages/window_manager_windows/.metadata +++ /dev/null @@ -1,27 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: "2663184aa79047d0a33a14a3b607954f8fdd8730" - channel: "stable" - -project_type: plugin - -# Tracks metadata for the flutter migrate command -migration: - platforms: - - platform: root - create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 - base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 - - # User provided section - - # List of Local paths (relative to this file) that should be - # ignored by the migrate tool. - # - # Files that are not part of the templates will be ignored by default. - unmanaged_files: - - 'lib/main.dart' - - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/packages/window_manager_windows/CHANGELOG.md b/packages/window_manager_windows/CHANGELOG.md index d0bd041d..7928521c 100644 --- a/packages/window_manager_windows/CHANGELOG.md +++ b/packages/window_manager_windows/CHANGELOG.md @@ -1,3 +1,3 @@ -## 0.0.1 +## 1.0.1 * Initial release. diff --git a/packages/window_manager_windows/analysis_options.yaml b/packages/window_manager_windows/analysis_options.yaml index a5744c1c..9033bb29 100644 --- a/packages/window_manager_windows/analysis_options.yaml +++ b/packages/window_manager_windows/analysis_options.yaml @@ -1,4 +1 @@ -include: package:flutter_lints/flutter.yaml - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options +include: package:mostly_reasonable_lints/analysis_options.yaml diff --git a/packages/window_manager_windows/lib/window_manager_windows.dart b/packages/window_manager_windows/lib/window_manager_windows.dart deleted file mode 100644 index 6ea6f783..00000000 --- a/packages/window_manager_windows/lib/window_manager_windows.dart +++ /dev/null @@ -1,14 +0,0 @@ -// You have generated a new plugin project without specifying the `--platforms` -// flag. A plugin project with no platform support was generated. To add a -// platform, run `flutter create -t plugin --platforms .` under the -// same directory. You can also find a detailed instruction on how to add -// platforms in the `pubspec.yaml` at -// https://flutter.dev/to/pubspec-plugin-platforms. - -import 'window_manager_windows_platform_interface.dart'; - -class WindowManagerWindows { - Future getPlatformVersion() { - return WindowManagerWindowsPlatform.instance.getPlatformVersion(); - } -} diff --git a/packages/window_manager_windows/lib/window_manager_windows_method_channel.dart b/packages/window_manager_windows/lib/window_manager_windows_method_channel.dart deleted file mode 100644 index 2f8143cf..00000000 --- a/packages/window_manager_windows/lib/window_manager_windows_method_channel.dart +++ /dev/null @@ -1,17 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; - -import 'window_manager_windows_platform_interface.dart'; - -/// An implementation of [WindowManagerWindowsPlatform] that uses method channels. -class MethodChannelWindowManagerWindows extends WindowManagerWindowsPlatform { - /// The method channel used to interact with the native platform. - @visibleForTesting - final methodChannel = const MethodChannel('window_manager_windows'); - - @override - Future getPlatformVersion() async { - final version = await methodChannel.invokeMethod('getPlatformVersion'); - return version; - } -} diff --git a/packages/window_manager_windows/lib/window_manager_windows_platform_interface.dart b/packages/window_manager_windows/lib/window_manager_windows_platform_interface.dart deleted file mode 100644 index 69ab6a31..00000000 --- a/packages/window_manager_windows/lib/window_manager_windows_platform_interface.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:plugin_platform_interface/plugin_platform_interface.dart'; - -import 'window_manager_windows_method_channel.dart'; - -abstract class WindowManagerWindowsPlatform extends PlatformInterface { - /// Constructs a WindowManagerWindowsPlatform. - WindowManagerWindowsPlatform() : super(token: _token); - - static final Object _token = Object(); - - static WindowManagerWindowsPlatform _instance = MethodChannelWindowManagerWindows(); - - /// The default instance of [WindowManagerWindowsPlatform] to use. - /// - /// Defaults to [MethodChannelWindowManagerWindows]. - static WindowManagerWindowsPlatform get instance => _instance; - - /// Platform-specific implementations should set this with their own - /// platform-specific class that extends [WindowManagerWindowsPlatform] when - /// they register themselves. - static set instance(WindowManagerWindowsPlatform instance) { - PlatformInterface.verifyToken(instance, _token); - _instance = instance; - } - - Future getPlatformVersion() { - throw UnimplementedError('platformVersion() has not been implemented.'); - } -} diff --git a/packages/window_manager_windows/pubspec.yaml b/packages/window_manager_windows/pubspec.yaml index 891dc2f8..6278e9f2 100644 --- a/packages/window_manager_windows/pubspec.yaml +++ b/packages/window_manager_windows/pubspec.yaml @@ -1,11 +1,11 @@ name: window_manager_windows description: Windows implementation of the window_manager plugin. -version: 0.0.1 +version: 1.0.1 repository: https://github.com/leanflutter/window_manager/tree/main/packages/window_manager_windows environment: - sdk: ^3.5.3 - flutter: '>=3.3.0' + sdk: ">=3.0.0 <4.0.0" + flutter: ">=3.3.0" dependencies: flutter: @@ -15,61 +15,10 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^4.0.0 + mostly_reasonable_lints: ^0.1.2 -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. flutter: - # This section identifies this Flutter project as a plugin project. - # The 'pluginClass' specifies the class (in Java, Kotlin, Swift, Objective-C, etc.) - # which should be registered in the plugin registry. This is required for - # using method channels. - # The Android 'package' specifies package in which the registered class is. - # This is required for using method channels on Android. - # The 'ffiPlugin' specifies that native code should be built and bundled. - # This is required for using `dart:ffi`. - # All these are used by the tooling to maintain consistency when - # adding or updating assets for this project. plugin: platforms: - # This plugin project was generated without specifying any - # platforms with the `--platform` argument. If you see the `some_platform` map below, remove it and - # then add platforms following the instruction here: - # https://flutter.dev/to/pubspec-plugin-platforms - # ------------------- - some_platform: - pluginClass: somePluginClass - # ------------------- - - # To add assets to your plugin package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # - # For details regarding assets in packages, see - # https://flutter.dev/to/asset-from-package - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/to/resolution-aware-images - - # To add custom fonts to your plugin package, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts in packages, see - # https://flutter.dev/to/font-from-package + windows: + pluginClass: WindowManagerWindowsPlugin diff --git a/packages/window_manager_windows/test/window_manager_windows_method_channel_test.dart b/packages/window_manager_windows/test/window_manager_windows_method_channel_test.dart deleted file mode 100644 index a85b6f1b..00000000 --- a/packages/window_manager_windows/test/window_manager_windows_method_channel_test.dart +++ /dev/null @@ -1,27 +0,0 @@ -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:window_manager_windows/window_manager_windows_method_channel.dart'; - -void main() { - TestWidgetsFlutterBinding.ensureInitialized(); - - MethodChannelWindowManagerWindows platform = MethodChannelWindowManagerWindows(); - const MethodChannel channel = MethodChannel('window_manager_windows'); - - setUp(() { - TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler( - channel, - (MethodCall methodCall) async { - return '42'; - }, - ); - }); - - tearDown(() { - TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(channel, null); - }); - - test('getPlatformVersion', () async { - expect(await platform.getPlatformVersion(), '42'); - }); -} diff --git a/packages/window_manager_windows/test/window_manager_windows_test.dart b/packages/window_manager_windows/test/window_manager_windows_test.dart deleted file mode 100644 index 6b643b0a..00000000 --- a/packages/window_manager_windows/test/window_manager_windows_test.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:flutter_test/flutter_test.dart'; -import 'package:window_manager_windows/window_manager_windows.dart'; -import 'package:window_manager_windows/window_manager_windows_platform_interface.dart'; -import 'package:window_manager_windows/window_manager_windows_method_channel.dart'; -import 'package:plugin_platform_interface/plugin_platform_interface.dart'; - -class MockWindowManagerWindowsPlatform - with MockPlatformInterfaceMixin - implements WindowManagerWindowsPlatform { - - @override - Future getPlatformVersion() => Future.value('42'); -} - -void main() { - final WindowManagerWindowsPlatform initialPlatform = WindowManagerWindowsPlatform.instance; - - test('$MethodChannelWindowManagerWindows is the default instance', () { - expect(initialPlatform, isInstanceOf()); - }); - - test('getPlatformVersion', () async { - WindowManagerWindows windowManagerWindowsPlugin = WindowManagerWindows(); - MockWindowManagerWindowsPlatform fakePlatform = MockWindowManagerWindowsPlatform(); - WindowManagerWindowsPlatform.instance = fakePlatform; - - expect(await windowManagerWindowsPlugin.getPlatformVersion(), '42'); - }); -}