From 5011959fa6b37ee74ec076200364f61653e40aaf Mon Sep 17 00:00:00 2001 From: Yusuke Abe Date: Tue, 21 Jun 2022 18:51:27 +0900 Subject: [PATCH 1/2] migrate flutter version to 3.0.2 * update pubs * remove null check operator from SchedulerBinding * add lint directive --- .../flutter/generated_plugin_registrant.cc | 2 ++ .../flutter/generated_plugin_registrant.h | 2 ++ example/linux/flutter/generated_plugins.cmake | 8 ++++++ example/pubspec.lock | 27 +++++++------------ .../flutter/generated_plugin_registrant.cc | 2 ++ .../flutter/generated_plugin_registrant.h | 2 ++ .../windows/flutter/generated_plugins.cmake | 8 ++++++ lib/helpers/size_widget.dart | 4 +-- .../image_renderer/image_renderer_web.dart | 1 + pubspec.lock | 23 ++++++---------- 10 files changed, 45 insertions(+), 34 deletions(-) diff --git a/example/linux/flutter/generated_plugin_registrant.cc b/example/linux/flutter/generated_plugin_registrant.cc index 026851f..f6f23bf 100644 --- a/example/linux/flutter/generated_plugin_registrant.cc +++ b/example/linux/flutter/generated_plugin_registrant.cc @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + #include "generated_plugin_registrant.h" #include diff --git a/example/linux/flutter/generated_plugin_registrant.h b/example/linux/flutter/generated_plugin_registrant.h index 9bf7478..e0f0a47 100644 --- a/example/linux/flutter/generated_plugin_registrant.h +++ b/example/linux/flutter/generated_plugin_registrant.h @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + #ifndef GENERATED_PLUGIN_REGISTRANT_ #define GENERATED_PLUGIN_REGISTRANT_ diff --git a/example/linux/flutter/generated_plugins.cmake b/example/linux/flutter/generated_plugins.cmake index 1fc8ed3..f16b4c3 100644 --- a/example/linux/flutter/generated_plugins.cmake +++ b/example/linux/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST url_launcher_linux ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/example/pubspec.lock b/example/pubspec.lock index 7eb7464..28b2948 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -42,7 +42,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" cupertino_icons: dependency: "direct main" description: @@ -56,7 +56,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -78,7 +78,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" matcher: dependency: transitive description: @@ -92,7 +92,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -106,7 +106,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" plugin_platform_interface: dependency: transitive description: @@ -120,7 +120,7 @@ packages: path: ".." relative: true source: path - version: "0.4.0" + version: "0.6.0" sky_engine: dependency: transitive description: flutter @@ -132,7 +132,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -167,14 +167,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" url_launcher: dependency: "direct main" description: @@ -223,7 +216,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-0 <3.0.0" flutter: ">=2.0.0" diff --git a/example/windows/flutter/generated_plugin_registrant.cc b/example/windows/flutter/generated_plugin_registrant.cc index ddfcf7c..d9fdd53 100644 --- a/example/windows/flutter/generated_plugin_registrant.cc +++ b/example/windows/flutter/generated_plugin_registrant.cc @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + #include "generated_plugin_registrant.h" #include diff --git a/example/windows/flutter/generated_plugin_registrant.h b/example/windows/flutter/generated_plugin_registrant.h index 9846246..dc139d8 100644 --- a/example/windows/flutter/generated_plugin_registrant.h +++ b/example/windows/flutter/generated_plugin_registrant.h @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + #ifndef GENERATED_PLUGIN_REGISTRANT_ #define GENERATED_PLUGIN_REGISTRANT_ diff --git a/example/windows/flutter/generated_plugins.cmake b/example/windows/flutter/generated_plugins.cmake index 411af46..88b22e5 100644 --- a/example/windows/flutter/generated_plugins.cmake +++ b/example/windows/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST url_launcher_windows ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/lib/helpers/size_widget.dart b/lib/helpers/size_widget.dart index e056d4f..6ea7a22 100644 --- a/lib/helpers/size_widget.dart +++ b/lib/helpers/size_widget.dart @@ -29,11 +29,11 @@ class _SizeWidgetRenderObject extends RenderProxyBox { final size = child?.size; if (size == null) return; - if (SchedulerBinding.instance?.schedulerPhase != + if (SchedulerBinding.instance.schedulerPhase != SchedulerPhase.persistentCallbacks) { onSize(size); } else { - SchedulerBinding.instance?.addPostFrameCallback((_) => onSize(size)); + SchedulerBinding.instance.addPostFrameCallback((_) => onSize(size)); } } } diff --git a/lib/renderers/image_renderer/image_renderer_web.dart b/lib/renderers/image_renderer/image_renderer_web.dart index 9acb60d..c3f9005 100644 --- a/lib/renderers/image_renderer/image_renderer_web.dart +++ b/lib/renderers/image_renderer/image_renderer_web.dart @@ -1,5 +1,6 @@ // ignore: avoid_web_libraries_in_flutter import 'dart:convert'; +// ignore: avoid_web_libraries_in_flutter import 'dart:html'; import 'dart:ui' as ui; diff --git a/pubspec.lock b/pubspec.lock index b482404..30ae488 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -42,14 +42,14 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -73,7 +73,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -87,7 +87,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" sky_engine: dependency: transitive description: flutter @@ -99,7 +99,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -134,21 +134,14 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-0 <3.0.0" flutter: ">=1.20.0" From 2ee905c0806eeaf4b1822c4007c7466af0057fbd Mon Sep 17 00:00:00 2001 From: Yusuke Abe Date: Tue, 21 Jun 2022 19:13:29 +0900 Subject: [PATCH 2/2] set minimum flutter version to 3.0.0 --- example/pubspec.lock | 2 +- pubspec.lock | 2 +- pubspec.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 28b2948..bbd0063 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -219,4 +219,4 @@ packages: version: "2.1.2" sdks: dart: ">=2.17.0-0 <3.0.0" - flutter: ">=2.0.0" + flutter: ">=3.0.0" diff --git a/pubspec.lock b/pubspec.lock index 30ae488..50a1f04 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -144,4 +144,4 @@ packages: version: "2.1.2" sdks: dart: ">=2.17.0-0 <3.0.0" - flutter: ">=1.20.0" + flutter: ">=3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 99b2b8d..4ac0e42 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/iamSahdeep/seo_renderer environment: sdk: ">=2.12.0 <3.0.0" - flutter: ">=1.20.0" + flutter: ">=3.0.0" dependencies: flutter: