我对 Flutter 开发相对较新,在学习时我遇到了 Ink Widgets,它可以响应触摸,同时还显示一些动画飞溅效果。
但是,有两种几乎相似类型的小部件:InkWell 和 InkResponse。
我无法从其类属性中找到这两者之间的适当区别。
那么,有人可以解释一下这两者之间的主要区别是什么,以及在什么情况下我可以使用它们。
谢谢。
我在我的项目中使用SliverAppBar
和SliverListView
。
我需要BorderRadius
我的SliverList
那是我的SliverAppBar
.
这是我需要的屏幕截图:
这是我的代码:
Scaffold(
body: CustomScrollView(
slivers: <Widget>[
SliverAppBar(
backgroundColor: Colors.transparent,
brightness: Brightness.dark,
actions: <Widget>[
IconButton(icon: Icon(Icons.favorite), onPressed: () {}),
IconButton(icon: Icon(Icons.share), onPressed: () {})
],
floating: false,
pinned: false,
//title: Text("Flexible space title"),
expandedHeight: getHeight(context) - MediaQuery.of(context).padding.top,
flexibleSpace: Container(
height: double.infinity,
width: double.infinity,
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.cover,
image: AssetImage("assets/images/Rectangle-image.png")
)
),
),
bottom: _bottomWidget(context),
),
SliverList(
delegate: SliverChildListDelegate(listview),
),
],
),
)
Run Code Online (Sandbox Code Playgroud)
所以,有了这段代码,用户界面就像这样......
可以建议我可以采取的任何其他方法来实现这种设计......