首页 > 解决方案 > 在 PWA 颤振中创建自定义颜色

问题描述

嗨,我正在尝试从我现有的颤振应用程序项目构建 PWA ......在我的颤振应用程序中,我正在使用我在文件中定义的自定义颜色.. 就是这样

import 'package:flutter/material.dart';

const first= Color(0xxxxxxxxxxxx);
const second= Color(0xxxxxxxxx);
const third= Color(0xxxxxxxx);
const vio= LinearGradient( // I get red line here
  colors: <Color>[first, second, third], // from this line I get red line with note: The named parameter 'colors' isn't defined.
  stops: [0.2, 0.5, 1.3],// same goes for this line
  begin: Alignment.centerLeft,
  end: Alignment.centerRight,
);

我正在通过将该文件添加到我的 PWA 项目中进行试验,但是始终无法定义colorsand ......从这种情况下,我应该在我的 PWA 项目的文件夹中添加一些东西吗?stopsweb

标签: flutterdartcolorsprogressive-web-apps

解决方案


推荐阅读