小编Mar*_*ski的帖子

将颤动主题颜色更改为黑色时出错

我在Android Studio上的Flutter中迈出的第一步。我的步骤:

  1. 下载并安装Android Studio
  2. 下载并安装Flutter和Dart
  3. 在Flutter中创建第一个默认应用

这是演示应用程序:

在此处输入图片说明

在此应用程序代码的注释中,我们具有:

    // 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"
Run Code Online (Sandbox Code Playgroud)

我更改Colors.blueColors.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)

material-design flutter

12
推荐指数
4
解决办法
3248
查看次数

标签 统计

flutter ×1

material-design ×1