有人知道这个错误是什么吗?我认为某些子节点无法放置在某些东西里面?
接收不兼容父级数据的RenderObject的所有权链为: _GestureSemantics ← RawGestureDetector ← GestureDetector ← Expanded ← ColoredBox ← Container ← Padding ← ColoredBox ← ConstrainedBox ← Container ← ⋯
Container(
height: 35,
width: 150,
color: Colors.blueGrey,
child: Row(
children: [
Container(
width: 35,
height: double.infinity,
color: Colors.blue,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
color: Colors.black,
child: Expanded(
child: GestureDetector(
onTap: () {
setState(() {
intAmount = int.parse(amount);
intAmount--;
amount = intAmount.toString();
print(intAmount);
});
},
child: SizedBox(
child: Image(
image:
AssetImage('images/plus.png'),
),
),
),
),
),
),
),
Expanded(
child: Container(
height: double.infinity,
color: Colors.black,
child: Center(
child: GestureDetector(
onTap: () {},
child: Text(
'$intAmount',
style: TextStyle(
color: Colors.amber,
),
),
),
),
),
),
Container(
width: 35,
height: double.infinity,
color: Colors.orange,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
color: Colors.black,
child: GestureDetector(
onTap: () {
setState(() {
intAmount = int.parse(amount);
intAmount++;
amount = intAmount.toString();
print(intAmount);
});
//*********************************** */
},
child: Expanded(
child: SizedBox(
child: Image(
image: AssetImage(
'images/minus.png'),
),
),
),
),
),
),
)
],
),
)