我是 Flutter+Dart 的新手,并试图增加字体大小,但很难理解文档 + 实现我的工作。这是文件。我该如何解决我的问题?
import 'package:flutter/material.dart';
void main() => runApp(NewApp());
class NewApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
home: new Scaffold(
appBar: new AppBar(
title: new Text('App Header'),
),
body: new Column(
children: [
new Container(
margin: new EdgeInsets.all(10.0),
child: new Card(
child: new Column(
children: <Widget>[
new Container(
padding: new EdgeInsets.all(10.0),
child: new Text('Hello Macaw'),
),
],
),
),
)
],
),
),
);
}
}
Run Code Online (Sandbox Code Playgroud) 我是颤振的新手,正在练习简单的应用程序。但是现在,我可以插入一行条件语句,但我想添加 If 语句。所以我可以添加更多的声明。我怎么做?这是我的代码。请看一看。当我达到目标数量颜色时,我想添加更多颜色: _moneyCounter > 1000 ?Colors.green : Colors.red,
Expanded(
child: Center(
child: Text(
'\USD $_moneyCounter',
style: TextStyle(
color: _moneyCounter > 1000 ? Colors.green : Colors.red,
fontSize: 40.0,
),
),
),
),
Run Code Online (Sandbox Code Playgroud)