logo

该视频仅会员有权观看

立即开通课程「Flutter 移动端应用开发实践」权限。

¥
199
/ 年

处理点按内容列表项目图像

  • To interact with an image in a content list to open the corresponding page, first figure out how to tap the image.
  • Overlay the content image widget with a Flutter-provided Ink widget.
  • Place these widgets within a Stack widget.
  • The description covers using a PostMedia widget within the Stack.
  • The PostMedia widget is replaced with a post this item dia.
  • In the annotation method, define the post decide media using a Stack.
  • Add the previously mentioned PostMedia to the children of the stack followed by a PostMiezeMediaMask.
  • Define the mask for the post list immediately above using a Fill constructor to create it.
  • Set the child of the Material widget to be transparent using Colors.transparent.
  • For the InkWell widget, set its splash color to Colors.deepPurpleAccent with an opacity of 0.3, which creates a mustard-like effect on tap.
  • Add an onTap event handler inside the widget to output text "on tap post insides" in the console when the content image is tapped.