You're using Expanded
inside a Widget (Stack) who has its own fit. In order to fix it, remove Expanded
and apply the fit parameter to your Stack
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<ThisApp> {
@override
Widget build(BuildContext context) {
return Stack(
fit: StackFit.expand, // StackFit.expand fixes the issue
children: <Widget>[
PageView(
children: <Widget>[
Container(
color: Colors.red,
),
Container(
color: Colors.yellow,
),
Container(
color: Colors.green,
),
Container(
color: Colors.blue,
),
],
)
],
);
}
}
Using debug mode, you'd notice the stack trace telling your about that error. Because --release
always try to avoid issues/crashes, will disable that part of the UI, aka = grey screen.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…