我在Android Studio上的Flutter中迈出的第一步。我的步骤:
这是演示应用程序:
在此应用程序代码的注释中,我们具有:
Run Code Online (Sandbox Code Playgroud)// This is the theme of your application. // Try running your application with "flutter run". You'll see the // application has a blue toolbar. Then, without quitting the app, try // changing the primarySwatch below to Colors.green and then invoke // "hot reload"
我更改Colors.blue为Colors.green,热重载可以正常运行,应用程序更改为绿色。但是当我尝试更改Colors.black为时出现错误:
“颜色”类型不是“材料颜色”类型的子类型。
演示应用程序的完整代码:
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of …Run Code Online (Sandbox Code Playgroud)