Git Product home page Git Product logo

foundation_fluttify's Introduction

Fluttify基础设施

所有基于Fluttify的插件公共的部分, 当然不基于Fluttify的插件理论上也可以使用.

主要实现一些基础设施和系统类的实现.

foundation_fluttify's People

Contributors

hongweichen avatar jakewoki avatar ls-andy avatar snailzzj avatar tshinezheng avatar yohom avatar yshye avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

foundation_fluttify's Issues

PlatformFactoryAndroid.release() need sync exec

releasePool
      ..forEach((it) =>  PlatformFactoryAndroid.release(it))
      ..clear();

需修改成

for(var ref in releasePool){
      await PlatformFactoryAndroid.release(ref);
}
releasePool.clear();

如代码所见,如果不进行同步执行,会导致引用为null

//此写法无效,forEach不会同步执行
releasePool
      ..forEach((it) async => await PlatformFactoryAndroid.release(it))
      ..clear();

ImageProviderX中listener未释放,出错

修改:
extension ImageProviderX on ImageProvider {
Future toImageData(ImageConfiguration config) async {
final completer = Completer();
final key = await this.obtainKey(config);
if (_cache.containsKey(key.toString())) {
debugPrint('命中缓存');
completer.complete(_cache[key.toString()]);
} else {
ImageStreamListener listener;
ImageStream stream = this.resolve(config); //获取图片流
listener = ImageStreamListener((imageInfo, sync) async {
final byteData =
await imageInfo.image.toByteData(format: ImageByteFormat.png);
final result = byteData.buffer.asUint8List();
_cache[key.toString()] = result;
completer.complete(result);
stream.removeListener(listener); //移除监听

  });
      stream.addListener(listener);
}

return completer.future;

}
}

ios didFinishLaunchingWithOptions生命周期问题

插件版本
0.6.1
amap_location_fluttify: ^0.11.0
amap_map_fluttify: ^0.21.0-dev.4
描述bug

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
}

我在另外一个插件关联了生命周期,上面的didFinishLaunchingWithOptions没有调用,如果我去掉amap_location_fluttify: ^0.11.0、amap_map_fluttify: ^0.21.0-dev.4,就可以正常调用,这个是冲突了,还是被覆盖被拦截了?不怎么懂ios
复现步骤

期望行为

截图

flutter doctor

kotlin.KotlinNullPointerException

E/MethodChannel#com.fluttify/foundation_method( 5528): Failed to handle method call
E/MethodChannel#com.fluttify/foundation_method( 5528): kotlin.KotlinNullPointerException
E/MethodChannel#com.fluttify/foundation_method( 5528): at me.yohom.foundation_fluttify.android.app.ApplicationHandlerKt.ApplicationHandler(ApplicationHandler.kt:12)
E/MethodChannel#com.fluttify/foundation_method( 5528): at me.yohom.foundation_fluttify.FoundationFluttifyPlugin.onMethodCall(FoundationFluttifyPlugin.kt:75)
E/MethodChannel#com.fluttify/foundation_method( 5528): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226)
E/MethodChannel#com.fluttify/foundation_method( 5528): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#com.fluttify/foundation_method( 5528): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631)
E/MethodChannel#com.fluttify/foundation_method( 5528): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#com.fluttify/foundation_method( 5528): at android.os.MessageQueue.next(MessageQueue.java:330)
E/MethodChannel#com.fluttify/foundation_method( 5528): at android.os.Looper.loop(Looper.java:169)
E/MethodChannel#com.fluttify/foundation_method( 5528): at android.app.ActivityThread.main(ActivityThread.java:7042)
E/MethodChannel#com.fluttify/foundation_method( 5528): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#com.fluttify/foundation_method( 5528): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:536)
E/MethodChannel#com.fluttify/foundation_method( 5528): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:868)
E/flutter ( 5528): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, null, null)

请问这是什么问题?

iOS 回调问题

插件版本

描述bug
其他插件无法接收回调
`/**

  • Calls all plugins registered for UIApplicationDelegate callbacks in order of registration until
  • some plugin handles the request.
  • @return YES if any plugin handles the request.
    */
  • (BOOL)application:(UIApplication*)application
    openURL:(NSURL*)url
    options:(NSDictionary<UIApplicationOpenURLOptionsKey, id>*)options;
    `
    不应该return YES
    复现步骤

期望行为

截图
WeChat4b8e290d954b9252d0c22af91dfde7b7

flutter doctor

'surfaceCreated' overrides nothing

插件版本
foundation_fluttify-0.11.1

kotlin_version = '1.4.10'

描述bug
.pub-cache/hosted/pub.dartlang.org/foundation_fluttify-0.11.1/android/src/main/kotlin/me/yohom/foundation_fluttify/platform_view/android_view_SurfaceViewFactory.kt: (21, 33): Object is not abstract and does not implement abstract member public abstract fun surfaceCreated(p0: SurfaceHolder): Unit defined in android.view.SurfaceHolder.Callback

.pub-cache/hosted/pub.dartlang.org/foundation_fluttify-0.11.1/android/src/main/kotlin/me/yohom/foundation_fluttify/platform_view/android_view_SurfaceViewFactory.kt: (28, 13): 'surfaceCreated' overrides nothing

截图
image

flutter doctor
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.5.1 20G80 darwin-x64, locale zh-Hans-CN)
• Flutter version 2.2.3 at /Users/tutu/Documents/flutter
• Framework revision f4abaa0735 (8 weeks ago), 2021-07-01 12:46:11 -0700
• Engine revision 241c87ad80
• Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/tutu/Library/Android/sdk
• Platform android-30, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5, Build version 12E262
• CocoaPods version 1.10.1

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] Connected device (2 available)
• Redmi K30 Pro Zoom Edition (mobile) • 37889044 • android-arm64 • Android 11 (API 30)
• Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.159
! Error: iPhone is not connected. Xcode will continue when iPhone is connected. (code -13)

• No issues found!

不兼容安卓sdk30

现在flutter 2.5.0的版本创建时使用的版本是sdk30 编译时就出错了,要考虑解决,那个高德地图用不了

从URL Sheme唤起APP闪退

插件版本
0.7.3
描述bug
从URL Sheme唤起APP闪退(冷启动)
FoundationFluttifyPlugin.m 80行报错
报错方法:
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
launchOptions带有启动参数为:
{ UIApplicationLaunchOptionsURLKey = "flyerapp://flyer?flyerId=3bd1d00d17444731ba903eee18c94376"; }
报错:
Exception: "Unsupported value for standard codec"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.