You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.
I/flutter (30355): ========== _onItemClick 开始执行============
I/flutter (30355): null
I/flutter (30355): ══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
I/flutter (30355): The following NoSuchMethodError was thrown while handling a gesture:
I/flutter (30355): The getter 'options' was called on null.
I/flutter (30355): Receiver: null
I/flutter (30355): Tried calling: options
I/flutter (30355): When the exception was thrown, this was the stack:
I/flutter (30355): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
I have newly developed a library photo_widget, which can be combined with any control to help you quickly develop this kind of scene. But that library is still in the early development version, there is no documentation, you may need to check the example / library source code to familiarize yourself with the use of APIs.
我现在遇到一个很难解决的问题
问题是这样:
我有一个 页面A,页面A 里面有个 子组件B 页面A 里面还有个 按钮C
点击 按钮C 打开相册选择图片,选择完以后,在 子组件B 里面展示图片,然后在 点击子组件B 里面点击一个图片的时候,希望可以进入 flutter_photo 的预览页面 可以继续进行选择图片,或者取消该图片的选择(就是编辑的意思)
页面A: 是StatefulWidget
子组件B: 是封装后的一个GridView
按钮C: 是一个封装后的Button
我翻了一下flutter_photo项目里面的代码,发现有下面这个方法,可以实现我的想法:
`
///点击发布动态页内图片回调
///点击已选择图片中的任意一张图
///参考文档:https://github.com/CaiJingLong/flutter_photo/blob/1455ea92fd56e89a2c6f27490b97eab84636c303/lib/src/ui/page/photo_main_page.dart
///
void _onItemClick(BuildContext context, AssetEntity data, int index) {
}
`
上面的代码我做了一些修改,问题是这个方法执行的时候,PhotoPickerProvider.of(context) 一直是null
打印的日志信息是:
I/flutter (30355): ========== _onItemClick 开始执行============
I/flutter (30355): null
I/flutter (30355): ══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
I/flutter (30355): The following NoSuchMethodError was thrown while handling a gesture:
I/flutter (30355): The getter 'options' was called on null.
I/flutter (30355): Receiver: null
I/flutter (30355): Tried calling: options
I/flutter (30355): When the exception was thrown, this was the stack:
I/flutter (30355): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
我看在项目里面 有使用PhotoPickerProvider 会把子组件包一下,但是这个包的时候,需要提供 options等参数,这个参数 我在页面A也拿不到?
请问一下,PhotoPickerProvider.of(context).options 我在页面A,或者组件B 里面应该如何处理?
The text was updated successfully, but these errors were encountered: