drager / faker

A library for Dart that generates fake data.
MIT License
231 stars 54 forks source link

[Dart Analyze Error] A value of type 'Color (where Color is defined in *sky_engine/lib/ui/painting.dart)' can't be assigned to a variable of type 'Color (where Color is defined in */faker-2.2.0/lib/src/colors.dart)'. #76

Open XiFengLang opened 2 months ago

XiFengLang commented 2 months ago

dart analyze failed when use Color class in test。

version: 2.2.0

A value of type 'Color (where Color is defined in *sky_engine/lib/ui/painting.dart)' can't be assigned to a variable of type 'Color (where Color is defined in */faker-2.2.0/lib/src/colors.dart)'.
r-durao-pvotal commented 2 months ago

We ran into this issue as well.

A temporary workaround is to hide Color from this lib.

import 'package:faker/faker.dart' hide Color;
r-durao-pvotal commented 2 months ago

It also happens with Image

drager commented 2 months ago

Where would this problem be in faker's code? I see nothing from the pub analysis: https://pub.dev/packages/faker/score/log.txt

r-durao-pvotal commented 2 months ago

Where would this problem be in faker's code? I see nothing from the pub analysis: https://pub.dev/packages/faker/score/log.txt

Our test code hade some like this:

import 'flutter/material.dart';
import 'package:faker/faker.dart';

final color = Colors.light_green;