所有基于Fluttify
的插件公共的部分, 当然不基于Fluttify
的插件理论上也可以使用.
主要实现一些基础设施和系统类的实现.
Foundation of Fluttify.
License: Other
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();
修改:
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;
}
}
插件版本
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
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)
请问这是什么问题?
android平台加入对java.lang.String的类型处理,ios平台加入NSString的类型处理。
功能描述
目前需要设备旋转角度的传感器数据
Native端对应字段/方法
参考 https://juejin.im/entry/5a4e2772f265da3e50338cff#%E6%96%B9%E5%90%91%E4%BC%A0%E6%84%9F%E5%99%A8
插件版本
描述bug
其他插件无法接收回调
`/**
UIApplicationDelegate
callbacks in order of registration untilYES
if any plugin handles the request.期望行为
flutter doctor
插件版本
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
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!
使用自增id代替hashcode
减少错误情况,尽量提高成功率
现在flutter 2.5.0的版本创建时使用的版本是sdk30 编译时就出错了,要考虑解决,那个高德地图用不了
发现只有最后一个PlatformView创建了
如果是国外就返回英文消息
功能描述
旋转方法(包括锚点设置)
Native端对应字段/方法
参考 https://my.oschina.net/majiage/blog/226393 , https://www.jianshu.com/p/55f594b29c93
目前发现一些pod的链接是没用的,导致运行失败
插件版本
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"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.