Я пытаюсь использовать пользовательскую цветовую тему для приложения.
Вот файл main.dart
import 'package:flutter/material.dart';
import 'pages/HomePage.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: new ThemeData(
// 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" (press "r" in the console where you ran "flutter run",
// or press Run > Flutter Hot Reload in IntelliJ). Notice that the
// counter didn't reset back to zero; the application is not restarted.
primarySwatch: MaterialColor(0xFF990000, {
50: Color(0xFF990001),
300: Color(0xFF990002),
900: Color(0xFF990003)
}),
),
home: new HomePage(),
);
}
}
Я получаю следующую ошибку:
трепетание: ══╡ ИСКЛЮЧЕНИЕ ПРОВЕДЕНО БИБЛИОТЕКОЙ ВИДЖЕТОВ ╞══════════════════════════════════════════════════════════ flutter: следующее MySuchMethodError было сгенерировано при создании MyApp (dirty): flutter: метод 'computeLuminance' был вызван для null.флаттер: приемник: ноль флаттер: пробный вызов: computeLuminance ()
Что я не так делаю?