【发布时间】:2020-02-19 04:15:07
【问题描述】:
大家好,
我对以下代码有疑问:
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
Expanded(
child: PageView(
children: <Widget>[
Container(
color: Colors.red,
),
Container(
color: Colors.yellow,
),
Container(
color: Colors.green,
),
Container(
color: Colors.blue,
),
],
),
),
],
);
}
}
当我使用“flutter run”运行它时,它会准确显示我需要的内容,但是当我使用“--release”参数时,它会完全停止工作并显示灰色屏幕。任何帮助表示赞赏!
【问题讨论】:
标签: flutter