Flutter 添加Navigator.push颤振时墨水池飞溅颜色效果未显示
我试图实现一个按钮,当它被点击时调用另一个页面 我正在用具有飞溅颜色效果的Flutter 添加Navigator.push颤振时墨水池飞溅颜色效果未显示,flutter,material-design,Flutter,Material Design,我试图实现一个按钮,当它被点击时调用另一个页面 我正在用具有飞溅颜色效果的inkWell小部件和onTap(){}包装一个容器。 该按钮显示飞溅颜色效果,其中onTap(){}为空。但是,当我添加Navigator时。按..调用另一个页面时,飞溅颜色效果消失 你知道怎么解决这个问题吗 这是代码 Padding( padding: const EdgeInsets.only(top: 11), child: Mater
inkWell
小部件和onTap(){}
包装一个容器。
该按钮显示飞溅颜色效果,其中onTap(){}
为空。但是,当我添加Navigator时。按..
调用另一个页面时,飞溅颜色效果消失
你知道怎么解决这个问题吗
这是代码
Padding(
padding: const EdgeInsets.only(top: 11),
child: Material(
color: Colors.white,
child: InkWell(
splashColor: Colors.grey,
onTap: () {
Navigator.push(
context,
PageTransition(
type: PageTransitionType.downToUp,
duration: Duration(milliseconds: 200),
child: ProfileProduct(
imageUrl: widget.reviews.imageUrl,
cost: widget.reviews.cost,
name: widget.reviews.userName,
address: widget.reviews.address,
brand: widget.reviews.brand,
productName: widget.reviews.productName,
userImage: widget.reviews.userImage,
currentUserId: widget.reviews.authorId,
cSrateStars: widget.reviews.cSrateStars,
easyPurchaseRateStars:
widget.reviews.easyPurchaseRateStars,
envioDiasRateStars: widget.reviews.envioDiasRateStars,
totalRate: widget.reviews.totalRate,
recomendation: widget.reviews.recomendation,
businessName: widget.reviews.businessName,
fecha: widget.reviews.timestamp,
videoLink: widget.reviews.videoLink,
),
),
);
},
child: Container(
// margin: EdgeInsets.only(top: 10),
height: 280,
width: 190,
child: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(left: 10, top: 2),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
CircleAvatar(
radius: 12.0,
backgroundColor: Colors.grey,
backgroundImage: widget
.reviews.userImage.isEmpty
? AssetImage(
'assets/images/user_placeholder.jpg')
: CachedNetworkImageProvider(
widget.reviews.userImage),
),
SizedBox(width: 0.0),
Text(
widget.reviews.userName,
style: TextStyle(
fontSize: 15, fontWeight: FontWeight.w700),
),
IconButton(
// alignment: Alignment.topLeft,
icon: _isLiked
? Icon(
Icons.favorite,
color: Colors.red,
)
: Icon(Icons.favorite_border),
iconSize: 15.0,
onPressed: _likePost,
),
],
),
),
AutoSizeText(
widget.reviews.productName,
maxLines: 4,
style: TextStyle(color: Colors.blue, fontSize: 20),
),
SizedBox(height: 3.0),
RatingStars(widget: widget),
SizedBox(height: 8.0),
AutoSizeText(
'$costos',
maxLines: 4,
style: TextStyle(color: Colors.grey),
),
SizedBox(height: 3.0),
Padding(
padding: const EdgeInsets.only(left: 15, right: 15),
child: AutoSizeText(
widget.reviews.comments,
maxLines: 3,
style: TextStyle(color: Colors.grey),
),
),
// SizedBox(height: 3.0),
AutoSizeText(
'See More...',
maxLines: 4,
style: TextStyle(color: Colors.blue),
),
Text(
'${_likeCount.toString()} likes',
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold,
),
),
],
),
),
),
),
),
填充(
填充:仅限常量边集(顶部:11),
儿童:材料(
颜色:颜色,白色,
孩子:InkWell(
颜色:颜色。灰色,
onTap:(){
导航器。推(
上下文
页面转换(
类型:PageTransitionType.downToUp,
持续时间:持续时间(毫秒:200),
儿童:产品简介(
imageUrl:widget.reviews.imageUrl,
成本:widget.reviews.cost,
名称:widget.reviews.userName,
地址:widget.reviews.address,
品牌:widget.reviews.brand,
productName:widget.reviews.productName,
userImage:widget.reviews.userImage,
currentUserId:widget.reviews.authorId,
cSrateStars:widget.reviews.cSrateStars,
EasyPurchasStars:
widget.reviews.EasyPurchasStars,
envioDiasRateStars:widget.reviews.envioDiasRateStars,
totalRate:widget.reviews.totalRate,
建议:widget.reviews.recondation,
businessName:widget.reviews.businessName,
fecha:widget.reviews.timestamp,
videoLink:widget.reviews.videoLink,
),
),
);
},
子:容器(
//页边空白:仅限边集(前10页),
身高:280,
宽度:190,
子:列(
儿童:[
填充物(
填充:仅限常量边集(左:10,顶:2),
孩子:排(
mainAxisAlignment:mainAxisAlignment.spaceBetween,
儿童:[
圆形(
半径:12.0,
背景颜色:颜色。灰色,
背景图片:小部件
.reviews.userImage.isEmpty
?资产评估(
'资产/图像/用户\占位符.jpg')
:CachedNetworkImageProvider(
widget.reviews.userImage),
),
尺寸框(宽度:0.0),
正文(
widget.reviews.userName,
样式:TextStyle(
fontSize:15,fontWeight:fontWeight.w700),
),
图标按钮(
//对齐:alignment.topLeft,
图标:_islike
?图标(
我的最爱,
颜色:颜色,红色,
)
:图标(图标。收藏夹边框),
iconSize:15.0,
按下按钮:_likePost,
),
],
),
),
自动缩放文本(
widget.reviews.productName,
maxLines:4,
样式:TextStyle(颜色:Colors.blue,字体大小:20),
),
尺寸箱(高度:3.0),
RatingStars(小部件:小部件),
尺寸箱(高度:8.0),
自动缩放文本(
“$costos”,
maxLines:4,
样式:TextStyle(颜色:Colors.grey),
),
尺寸箱(高度:3.0),
填充物(
填充:仅限常量边集(左:15,右:15),
子对象:AutoSizeText(
widget.reviews.comments,
maxLines:3,
样式:TextStyle(颜色:Colors.grey),
),
),
//尺寸箱(高度:3.0),
自动缩放文本(
“看更多…”,
maxLines:4,
样式:TextStyle(颜色:Colors.blue),
),
正文(
“${u likeCount.toString()}喜欢”,
样式:TextStyle(
字体大小:16.0,
fontWeight:fontWeight.bold,
),
),
],
),
),
),
),
),
InkWell小部件必须具有Ma
Material(
child: InkWell(
onTap: () {
print("tapped me");
},
splashColor: Colors.grey,....
InkWell(
splashColor: Colors.grey,
onTap: () {
Future.delayed(const Duration(milliseconds: 300), () {
Navigator.push(
context, MaterialPageRoute(builder: (context) => NextPage()));
});
},
child:Somewidget,
)