From fe39df706a6636a304279d70dcf4a10fddae6f30 Mon Sep 17 00:00:00 2001 From: Rishabh Sethia <32691717+EmperorAkashi20@users.noreply.github.com> Date: Fri, 10 Mar 2023 13:09:40 +0530 Subject: [PATCH] Fixed the issue which was throwing the error Error: Type 'VoidCallback' not found. final VoidCallback onDone. imported dart:ui which was the fix --- advanced_example/.flutter-plugins | 20 ++++----- .../.flutter-plugins-dependencies | 2 +- advanced_example/ios/Flutter/Debug.xcconfig | 1 + advanced_example/ios/Flutter/Release.xcconfig | 1 + advanced_example/ios/Podfile | 41 +++++++++++++++++++ .../flutter/generated_plugin_registrant.cc | 2 + .../flutter/generated_plugin_registrant.h | 2 + .../linux/flutter/generated_plugins.cmake | 8 ++++ .../macos/Flutter/Flutter-Debug.xcconfig | 1 + .../macos/Flutter/Flutter-Release.xcconfig | 1 + advanced_example/macos/Podfile | 40 ++++++++++++++++++ advanced_example/pubspec.lock | 37 ++++++++++------- .../flutter/generated_plugin_registrant.cc | 2 + .../flutter/generated_plugin_registrant.h | 2 + .../windows/flutter/generated_plugins.cmake | 8 ++++ example/ios/Flutter/Debug.xcconfig | 1 + example/ios/Flutter/Release.xcconfig | 1 + example/ios/Podfile | 41 +++++++++++++++++++ .../flutter/generated_plugin_registrant.cc | 2 + .../flutter/generated_plugin_registrant.h | 2 + example/linux/flutter/generated_plugins.cmake | 8 ++++ example/macos/Flutter/Flutter-Debug.xcconfig | 1 + .../macos/Flutter/Flutter-Release.xcconfig | 1 + example/macos/Podfile | 40 ++++++++++++++++++ example/pubspec.lock | 37 ++++++++++------- .../flutter/generated_plugin_registrant.cc | 2 + .../flutter/generated_plugin_registrant.h | 2 + .../windows/flutter/generated_plugins.cmake | 8 ++++ lib/src/utils/downloader_utils.dart | 1 + pubspec.lock | 37 ++++++++++------- 30 files changed, 296 insertions(+), 56 deletions(-) create mode 100644 advanced_example/ios/Podfile create mode 100644 advanced_example/macos/Podfile create mode 100644 example/ios/Podfile create mode 100644 example/macos/Podfile diff --git a/advanced_example/.flutter-plugins b/advanced_example/.flutter-plugins index 04b04cf..152b270 100644 --- a/advanced_example/.flutter-plugins +++ b/advanced_example/.flutter-plugins @@ -1,11 +1,11 @@ # This is a generated file; do not edit or check into version control. -connectivity_plus=/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-1.0.1/ -connectivity_plus_linux=/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_linux-1.0.1/ -connectivity_plus_macos=/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_macos-1.0.1/ -connectivity_plus_web=/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_web-1.0.1/ -connectivity_plus_windows=/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_windows-1.0.1/ -path_provider=/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.1/ -path_provider_linux=/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.0.0/ -path_provider_macos=/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.0/ -path_provider_windows=/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.1/ -permission_handler=/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-7.1.0/ +connectivity_plus=/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-1.0.1/ +connectivity_plus_linux=/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_linux-1.0.1/ +connectivity_plus_macos=/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_macos-1.0.1/ +connectivity_plus_web=/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_web-1.0.1/ +connectivity_plus_windows=/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_windows-1.0.1/ +path_provider=/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.1/ +path_provider_linux=/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.0.0/ +path_provider_macos=/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.0/ +path_provider_windows=/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.1/ +permission_handler=/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/permission_handler-7.1.0/ diff --git a/advanced_example/.flutter-plugins-dependencies b/advanced_example/.flutter-plugins-dependencies index de3a81e..215bbcd 100644 --- a/advanced_example/.flutter-plugins-dependencies +++ b/advanced_example/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-1.0.1/","dependencies":[]},{"name":"path_provider","path":"/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.1/","dependencies":[]},{"name":"permission_handler","path":"/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-7.1.0/","dependencies":[]}],"android":[{"name":"connectivity_plus","path":"/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-1.0.1/","dependencies":[]},{"name":"path_provider","path":"/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.1/","dependencies":[]},{"name":"permission_handler","path":"/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-7.1.0/","dependencies":[]}],"macos":[{"name":"connectivity_plus_macos","path":"/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_macos-1.0.1/","dependencies":[]},{"name":"path_provider_macos","path":"/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.0/","dependencies":[]}],"linux":[{"name":"connectivity_plus_linux","path":"/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_linux-1.0.1/","dependencies":[]},{"name":"path_provider_linux","path":"/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.0.0/","dependencies":[]}],"windows":[{"name":"connectivity_plus_windows","path":"/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_windows-1.0.1/","dependencies":[]},{"name":"path_provider_windows","path":"/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.1/","dependencies":[]}],"web":[{"name":"connectivity_plus_web","path":"/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_web-1.0.1/","dependencies":[]}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":["connectivity_plus_linux","connectivity_plus_macos","connectivity_plus_web","connectivity_plus_windows"]},{"name":"connectivity_plus_linux","dependencies":[]},{"name":"connectivity_plus_macos","dependencies":[]},{"name":"connectivity_plus_web","dependencies":[]},{"name":"connectivity_plus_windows","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":[]}],"date_created":"2021-05-25 15:02:06.668265","version":"2.2.0"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-1.0.1/","native_build":true,"dependencies":[]},{"name":"path_provider","path":"/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.1/","native_build":true,"dependencies":[]},{"name":"permission_handler","path":"/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/permission_handler-7.1.0/","native_build":true,"dependencies":[]}],"android":[{"name":"connectivity_plus","path":"/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-1.0.1/","native_build":true,"dependencies":[]},{"name":"path_provider","path":"/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.1/","native_build":true,"dependencies":[]},{"name":"permission_handler","path":"/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/permission_handler-7.1.0/","native_build":true,"dependencies":[]}],"macos":[{"name":"connectivity_plus_macos","path":"/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_macos-1.0.1/","native_build":true,"dependencies":[]},{"name":"path_provider_macos","path":"/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.0/","native_build":true,"dependencies":[]}],"linux":[{"name":"connectivity_plus_linux","path":"/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_linux-1.0.1/","native_build":false,"dependencies":[]},{"name":"path_provider_linux","path":"/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.0.0/","native_build":false,"dependencies":[]}],"windows":[{"name":"connectivity_plus_windows","path":"/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_windows-1.0.1/","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.1/","native_build":false,"dependencies":[]}],"web":[{"name":"connectivity_plus_web","path":"/Users/rishabh/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_web-1.0.1/","dependencies":[]}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":["connectivity_plus_linux","connectivity_plus_macos","connectivity_plus_web","connectivity_plus_windows"]},{"name":"connectivity_plus_linux","dependencies":[]},{"name":"connectivity_plus_macos","dependencies":[]},{"name":"connectivity_plus_web","dependencies":[]},{"name":"connectivity_plus_windows","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":[]}],"date_created":"2023-03-10 13:01:57.950430","version":"3.3.9"} \ No newline at end of file diff --git a/advanced_example/ios/Flutter/Debug.xcconfig b/advanced_example/ios/Flutter/Debug.xcconfig index 592ceee..ec97fc6 100644 --- a/advanced_example/ios/Flutter/Debug.xcconfig +++ b/advanced_example/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/advanced_example/ios/Flutter/Release.xcconfig b/advanced_example/ios/Flutter/Release.xcconfig index 592ceee..c4855bf 100644 --- a/advanced_example/ios/Flutter/Release.xcconfig +++ b/advanced_example/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/advanced_example/ios/Podfile b/advanced_example/ios/Podfile new file mode 100644 index 0000000..88359b2 --- /dev/null +++ b/advanced_example/ios/Podfile @@ -0,0 +1,41 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '11.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/advanced_example/linux/flutter/generated_plugin_registrant.cc b/advanced_example/linux/flutter/generated_plugin_registrant.cc index d38195a..e71a16d 100644 --- a/advanced_example/linux/flutter/generated_plugin_registrant.cc +++ b/advanced_example/linux/flutter/generated_plugin_registrant.cc @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + #include "generated_plugin_registrant.h" diff --git a/advanced_example/linux/flutter/generated_plugin_registrant.h b/advanced_example/linux/flutter/generated_plugin_registrant.h index 9bf7478..e0f0a47 100644 --- a/advanced_example/linux/flutter/generated_plugin_registrant.h +++ b/advanced_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/advanced_example/linux/flutter/generated_plugins.cmake b/advanced_example/linux/flutter/generated_plugins.cmake index 51436ae..2e1de87 100644 --- a/advanced_example/linux/flutter/generated_plugins.cmake +++ b/advanced_example/linux/flutter/generated_plugins.cmake @@ -5,6 +5,9 @@ list(APPEND FLUTTER_PLUGIN_LIST ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -13,3 +16,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/advanced_example/macos/Flutter/Flutter-Debug.xcconfig b/advanced_example/macos/Flutter/Flutter-Debug.xcconfig index c2efd0b..4b81f9b 100644 --- a/advanced_example/macos/Flutter/Flutter-Debug.xcconfig +++ b/advanced_example/macos/Flutter/Flutter-Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/advanced_example/macos/Flutter/Flutter-Release.xcconfig b/advanced_example/macos/Flutter/Flutter-Release.xcconfig index c2efd0b..5caa9d1 100644 --- a/advanced_example/macos/Flutter/Flutter-Release.xcconfig +++ b/advanced_example/macos/Flutter/Flutter-Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/advanced_example/macos/Podfile b/advanced_example/macos/Podfile new file mode 100644 index 0000000..dade8df --- /dev/null +++ b/advanced_example/macos/Podfile @@ -0,0 +1,40 @@ +platform :osx, '10.11' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/advanced_example/pubspec.lock b/advanced_example/pubspec.lock index 73a3718..6edc229 100644 --- a/advanced_example/pubspec.lock +++ b/advanced_example/pubspec.lock @@ -35,7 +35,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.6.1" + version: "2.9.0" auto_route: dependency: "direct main" description: @@ -133,7 +133,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.1" charcode: dependency: transitive description: @@ -161,7 +161,7 @@ packages: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" code_builder: dependency: transitive description: @@ -175,7 +175,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" connectivity_plus: dependency: "direct main" description: @@ -273,7 +273,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" ffi: dependency: transitive description: @@ -454,7 +454,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" json_annotation: dependency: transitive description: @@ -482,14 +482,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.12" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.5" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.8.0" mime: dependency: transitive description: @@ -510,7 +517,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.2" path_drawing: dependency: transitive description: @@ -676,7 +683,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.9.0" stack_trace: dependency: transitive description: @@ -711,21 +718,21 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.4.12" timing: dependency: transitive description: @@ -746,7 +753,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.2" watcher: dependency: transitive description: @@ -790,5 +797,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.17.0-0 <3.0.0" flutter: ">=1.24.0-7.0" diff --git a/advanced_example/windows/flutter/generated_plugin_registrant.cc b/advanced_example/windows/flutter/generated_plugin_registrant.cc index 47ea0d6..8083d74 100644 --- a/advanced_example/windows/flutter/generated_plugin_registrant.cc +++ b/advanced_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/advanced_example/windows/flutter/generated_plugin_registrant.h b/advanced_example/windows/flutter/generated_plugin_registrant.h index 9846246..dc139d8 100644 --- a/advanced_example/windows/flutter/generated_plugin_registrant.h +++ b/advanced_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/advanced_example/windows/flutter/generated_plugins.cmake b/advanced_example/windows/flutter/generated_plugins.cmake index ba4a217..8cf5d42 100644 --- a/advanced_example/windows/flutter/generated_plugins.cmake +++ b/advanced_example/windows/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST connectivity_plus_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/example/ios/Flutter/Debug.xcconfig b/example/ios/Flutter/Debug.xcconfig index 592ceee..ec97fc6 100644 --- a/example/ios/Flutter/Debug.xcconfig +++ b/example/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/example/ios/Flutter/Release.xcconfig b/example/ios/Flutter/Release.xcconfig index 592ceee..c4855bf 100644 --- a/example/ios/Flutter/Release.xcconfig +++ b/example/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/example/ios/Podfile b/example/ios/Podfile new file mode 100644 index 0000000..88359b2 --- /dev/null +++ b/example/ios/Podfile @@ -0,0 +1,41 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '11.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/example/linux/flutter/generated_plugin_registrant.cc b/example/linux/flutter/generated_plugin_registrant.cc index d38195a..e71a16d 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" 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 51436ae..2e1de87 100644 --- a/example/linux/flutter/generated_plugins.cmake +++ b/example/linux/flutter/generated_plugins.cmake @@ -5,6 +5,9 @@ list(APPEND FLUTTER_PLUGIN_LIST ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -13,3 +16,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/macos/Flutter/Flutter-Debug.xcconfig b/example/macos/Flutter/Flutter-Debug.xcconfig index c2efd0b..4b81f9b 100644 --- a/example/macos/Flutter/Flutter-Debug.xcconfig +++ b/example/macos/Flutter/Flutter-Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/example/macos/Flutter/Flutter-Release.xcconfig b/example/macos/Flutter/Flutter-Release.xcconfig index c2efd0b..5caa9d1 100644 --- a/example/macos/Flutter/Flutter-Release.xcconfig +++ b/example/macos/Flutter/Flutter-Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/example/macos/Podfile b/example/macos/Podfile new file mode 100644 index 0000000..dade8df --- /dev/null +++ b/example/macos/Podfile @@ -0,0 +1,40 @@ +platform :osx, '10.11' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/example/pubspec.lock b/example/pubspec.lock index 76d3b4e..5041e3f 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.6.1" + version: "2.9.0" boolean_selector: dependency: transitive description: @@ -21,7 +21,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.1" charcode: dependency: transitive description: @@ -35,14 +35,14 @@ packages: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" cupertino_icons: dependency: "direct main" description: @@ -63,7 +63,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" ffi: dependency: transitive description: @@ -113,28 +113,35 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.12" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.5" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.8.0" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.2" path_provider: dependency: "direct main" description: @@ -202,7 +209,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.9.0" stack_trace: dependency: transitive description: @@ -223,21 +230,21 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.4.12" typed_data: dependency: transitive description: @@ -251,7 +258,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.2" win32: dependency: transitive description: @@ -267,5 +274,5 @@ packages: source: hosted version: "0.2.0" sdks: - dart: ">=2.13.0 <3.0.0" + dart: ">=2.17.0-0 <3.0.0" flutter: ">=1.20.0" diff --git a/example/windows/flutter/generated_plugin_registrant.cc b/example/windows/flutter/generated_plugin_registrant.cc index 4bfa0f3..8b6d468 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" 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 4d10c25..b93c4c3 100644 --- a/example/windows/flutter/generated_plugins.cmake +++ b/example/windows/flutter/generated_plugins.cmake @@ -5,6 +5,9 @@ list(APPEND FLUTTER_PLUGIN_LIST ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -13,3 +16,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/src/utils/downloader_utils.dart b/lib/src/utils/downloader_utils.dart index ab57dd9..382bd76 100644 --- a/lib/src/utils/downloader_utils.dart +++ b/lib/src/utils/downloader_utils.dart @@ -1,4 +1,5 @@ import 'dart:io'; +import 'dart:ui'; import 'package:dio/dio.dart' hide ProgressCallback; import 'package:flowder/src/flowder.dart'; diff --git a/pubspec.lock b/pubspec.lock index 685e267..d10e17d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.6.1" + version: "2.9.0" boolean_selector: dependency: transitive description: @@ -21,7 +21,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.1" charcode: dependency: transitive description: @@ -35,14 +35,14 @@ packages: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" dio: 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.1" flutter: dependency: "direct main" description: flutter @@ -85,28 +85,35 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.12" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.5" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.8.0" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.2" sky_engine: dependency: transitive description: flutter @@ -118,7 +125,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.9.0" stack_trace: dependency: transitive description: @@ -139,21 +146,21 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.4.12" typed_data: dependency: transitive description: @@ -167,7 +174,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.2" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.17.0-0 <3.0.0" flutter: ">=1.20.0"