大佬教程收集整理的这篇文章主要介绍了在元素之间发送图像,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
通过此按钮在我的 PhotoprevIEwScreen
页面上拍摄照片后,我将向我的 camera
发送图像:
onpressed: () async {
var result = await controller.takePicture();
Navigator.push(
context,MaterialPageRoute(
builder: (context) => PhotoprevIEwScreen(
imagePath: result.path,
但是,我希望能够在点击此按钮后从我的 PhotoprevIEw Screen
的网格视图中将其发送到我的主页:
Outlinebutton(
onpressed: () async {
var result = Widget.imagePath;
Navigator.push(
context,MaterialPageRoute(
builder: (context) => PhotoprevIEwScreen(
imagePath: result.path,
然而,这并不成功。我试图通过这些项目在 PhotoprevIEw Screen
上定义这些元素
class _PhotoprevIEwScreenState extends State<PhotoprevIEwScreen> {
var image;
String imgPath;
Future _opengallery() async {
if (Widget.setData != null) {
Widget.setData(file(image.path));
}
}
我哪里出错了,我该如何重构这段代码? 总结一下,流程是:
PhotoprevIEwScreen
(完整)PhotoprevIEwScreen
上拍照(完成)GrIDVIEw
上的 Homepage
(需要指导)这是我需要在点击按钮时将图像发送到的 GrIDVIEw
: GrIDVIEw.count(
shrinkWrap: true,crossAxisCount: 2,crossAxisspacing: 25,mainAxisspacing: 25,childAspectRatio: (80 / 150),padding: const EdgeInsets.all(2.0),children:
List.generate(Widget.imageArray.length,(indeX) {
return Container(
decoration: new Boxdecoration(
color: const color(0xff000000),borderRadius: borderRadius.circular(10),image: new decorationImage(
image: fileImage(Widget.imageArraY[index]),fit: BoxFit.fill,colorFilter: new colorFilter.mode(
colors.black.withOpacity(0.4),BlendMode.dstAtop)
除上述内容外,这里还有相关的主页:
class Homepage extends StatefulWidget {
final List<file> imageArray;
Homepage({Key key,this.imageArray}) : super(key: key);
@overrIDe
_HomepageState createState() => _HomepageState();
}
class _HomepageState extends State<Homepage> {
var image;
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
以上是大佬教程为你收集整理的在元素之间发送图像全部内容,希望文章能够帮你解决在元素之间发送图像所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。