我想在颤动中将 Stack 放在 Stack 里面,如果我改变内部 Stack 的定位小部件的位置,它就不起作用。
作品:
Stack(
children: [
Positioned(
top: 150.0,
child: Text("Text#1"),
),
Positioned(
top: 100.0,
child: Stack(
children: [
Positioned(
child: Text("Text#2"),
)
],
),
)
],
)
Run Code Online (Sandbox Code Playgroud)
如果我在内部堆栈的定位内添加“top:200.0”,内部堆栈消失并且颤动抛出错误
Stack(
children: [
Positioned(
top: 150.0,
child: Text("Text#1"),
),
Positioned(
top: 100.0,
child: Stack(
children: [
Positioned(
top:200.0,
child: Text("Text#2"),
)
],
),
)
],
Run Code Online (Sandbox Code Playgroud)