提问者:小点点

点击功能在对话框中查看图像时出现此错误


onTap: () { showDialog(context: context,builder:(BuildContext context){back ImageNetwork(image:data['image'].toString(),高:400,宽:400,持续时间:1000,曲线:Curves.easeIn,onPointer:true,fit AndroidIos:BoxFit.cover,FitWeb:BoxFitWeb.cover,borderRadius:BorderRadius.循环(50),onLoding:const CircularProgressQueator(颜色:Color.amber, ), ); });


共2个答案

匿名用户

Use Dialog widget over your ImageNetwork widget. This will resolve your issue.


onTap:() {
        showDialog(context: context, builder: (BuildContext context) {
          return Dialog(
           child: ImageNetwork(image: data['image'].toString(),
            height: 400,
            width: 400,
            duration: 1000,
            curve: Curves.easeIn,
            onPointer: true,
            fitAndroidIos: BoxFit.cover,
            fitWeb: BoxFitWeb.cover,
            borderRadius: BorderRadius.circular(50),
            onLoading: const CircularProgressIndicator(color: Colors.amber,),),`enter code here`);
        });
      }

匿名用户

将您的ImageNetwork()小部件包装在材料小部件中

并将类型设置为MaterialType.透明度

showDialog(
  context: context,
  builder: (context) => Material(
  type: MaterialType.transparency,
  child: YourWidget(...)
)