【问题标题】:Trying to add a link to an image尝试添加图片链接
【发布时间】:2021-12-29 21:21:50
【问题描述】:

我需要一些帮助。这是我到目前为止所做的。我想要一个 gridview 布局并向它们添加链接到不同 url 的图像

body: Center(
      child: Material(
        elevation: 10,
        borderRadius: BorderRadius.circular(30),
        clipBehavior: Clip.antiAliasWithSaveLayer,
        child: InkWell(
          splashColor: Colors.grey,
          onTap: () {},
          child: Container(
            decoration: BoxDecoration(
              color: Colors.transparent,
              border: Border.all(color: Colors.grey, width: 3),
              borderRadius: BorderRadius.circular(30),
            ),
            child: Ink.image(
              image: const AssetImage('images/APPvideogames2.jpg'),
              height: 200,
              width: 200,
              fit: BoxFit.cover,
            ),
          ),
        ),
      ),
    ));

【问题讨论】:

    标签: image gridview hyperlink


    【解决方案1】:

    我认为你可以用GestureDetector 包装它,然后你可以将它重定向到你提供的链接

    【讨论】:

    • 正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-07-20
    • 2014-11-07
    • 1970-01-01
    • 2011-01-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多