Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The getter 'a' isn't defined for the class 'Color' #1843

Open
raviatri opened this issue Jan 9, 2025 · 5 comments
Open

The getter 'a' isn't defined for the class 'Color' #1843

raviatri opened this issue Jan 9, 2025 · 5 comments

Comments

@raviatri
Copy link

raviatri commented Jan 9, 2025

I am getting multiple errors:
./../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/extensions/color_extension.dart:9:20: Error: The getter 'a' isn't defined for the class 'Color'.

  • 'Color' is from 'dart:ui'.
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'a'.
    _floatToInt8(a),
    ^
    ../../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/extensions/color_extension.dart:10:21: Error: The getter 'r' isn't defined for the class 'Color'.
  • 'Color' is from 'dart:ui'.
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'r'.
    (_floatToInt8(r) * value).round(),
    ^
    ../../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/extensions/color_extension.dart:11:21: Error: The getter 'g' isn't defined for the class 'Color'.
  • 'Color' is from 'dart:ui'.
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'g'.
    (_floatToInt8(g) * value).round(),
    ^
    ../../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/extensions/color_extension.dart:12:21: Error: The getter 'b' isn't defined for the class 'Color'.
  • 'Color' is from 'dart:ui'.
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'b'.
    (_floatToInt8(b) * value).round(),
    ^
    ../../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/extensions/border_extension.dart:12:20: Error: The getter 'a' isn't defined for the class 'Color'.
  • 'Color' is from 'dart:ui'.
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'a'.
    if (left.color.a == 0.0 &&
    ^
    ../../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/extensions/border_extension.dart:13:19: Error: The getter 'a' isn't defined for the class 'Color'.
  • 'Color' is from 'dart:ui'.
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'a'.
    top.color.a == 0.0 &&
    ^
    ../../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/extensions/border_extension.dart:14:21: Error: The getter 'a' isn't defined for the class 'Color'.
  • 'Color' is from 'dart:ui'.
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'a'.
    right.color.a == 0.0 &&
    ^
    ../../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/extensions/border_extension.dart:15:22: Error: The getter 'a' isn't defined for the class 'Color'.
  • 'Color' is from 'dart:ui'.
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'a'.
    bottom.color.a == 0.0) {
    ^
    ../../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/chart/base/axis_chart/axis_chart_painter.dart:159:30: Error: The getter 'a' isn't defined for the class 'Color'.
  • 'Color' is from 'dart:ui'.
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'a'.
    if (data.backgroundColor.a == 0.0) {
    ^
    ../../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/extensions/paint_extension.dart:8:21: Error: The method 'withValues' isn't defined for the class 'Color'.
  • 'Color' is from 'dart:ui'.
    Try correcting the name to the name of an existing method, or defining a method named 'withValues'.
    color = color.withValues(alpha: 0);
    ^^^^^^^^^^
    ../../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/chart/line_chart/line_chart_painter.dart:923:47: Error: The getter 'a' isn't defined for the class 'Color'.
  • 'Color' is from 'dart:ui'.
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'a'.
    if (!barData.show || barData.shadow.color.a == 0.0) {
    ^
    ../../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/chart/bar_chart/bar_chart_painter.dart:336:56: Error: The getter 'a' isn't defined for the class 'Color'.
  • 'Color' is from 'dart:ui'.
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'a'.
    if (borderSide.width > 0 && borderSide.color.a > 0) {
    ^
    ../../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/chart/bar_chart/bar_chart_painter.dart:565:71: Error: The getter 'a' isn't defined for the class 'Color'.
  • 'Color' is from 'dart:ui'.
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'a'.
    if (stackItem.borderSide.width == 0 || stackItem.borderSide.color.a == 0) {
    ^
    ../../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/chart/base/axis_chart/axis_chart_data.dart:1409:43: Error: The getter 'a' isn't defined for the class 'Color'.
  • 'Color' is from 'dart:ui'.
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'a'.
    if (strokeWidth != 0.0 && strokeColor.a != 0.0) {
    ^
    ../../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/chart/base/axis_chart/axis_chart_data.dart:1506:43: Error: The getter 'a' isn't defined for the class 'Color'.
  • 'Color' is from 'dart:ui'.
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'a'.
    if (strokeWidth != 0.0 && strokeColor.a != 0.0) {
    ^
    ../../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/chart/radar_chart/radar_chart_data.dart:300:46: Error: The method 'withValues' isn't defined for the class 'MaterialColor'.
  • 'MaterialColor' is from 'package:flutter/src/material/colors.dart' ('../../../../../development/flutter/packages/flutter/lib/src/material/colors.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'withValues'.
    fillColor = fillColor ?? Colors.cyan.withValues(alpha: 0.2),
    ^^^^^^^^^^
    ../../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/chart/pie_chart/pie_chart_painter.dart:146:38: Error: The getter 'a' isn't defined for the class 'Color'.
  • 'Color' is from 'dart:ui'.
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'a'.
    section.borderSide.color.a != 0.0) {
    ^
    ../../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/chart/pie_chart/pie_chart_painter.dart:332:69: Error: The getter 'a' isn't defined for the class 'Color'.
  • 'Color' is from 'dart:ui'.
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'a'.
    if (section.borderSide.width != 0.0 && section.borderSide.color.a != 0.0) {
    ^
    ../../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/chart/line_chart/line_chart_data.dart:535:35: Error: The method 'withValues' isn't defined for the class 'MaterialColor'.
  • 'MaterialColor' is from 'package:flutter/src/material/colors.dart' ('../../../../../development/flutter/packages/flutter/lib/src/material/colors.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'withValues'.
    ? Colors.blueGrey.withValues(alpha: 0.5)
    ^^^^^^^^^^
    ../../../../../.pub-cache/hosted/pub.dev/fl_chart-0.70.1/lib/src/chart/line_chart/line_chart_data.dart:591:35: Error: The method 'withValues' isn't defined for the class 'MaterialColor'.
  • 'MaterialColor' is from 'package:flutter/src/material/colors.dart' ('../../../../../development/flutter/packages/flutter/lib/src/material/colors.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'withValues'.
    ? Colors.blueGrey.withValues(alpha: 0.5)

I am stuck here can any one tell me how I can resolve these error? Flutter version 3.24 (stable)

@Wizely99
Copy link

Wizely99 commented Jan 9, 2025

Same here gettting the same issue

@ImadMAKS
Copy link

ImadMAKS commented Jan 9, 2025

Same here, I do not understand, I couldn't find any extension in the project called "withValues" that gets applied on Colors. I can't even run an example of my machine to test it.
Am I missing something in the docs?

@hjtomi
Copy link

hjtomi commented Jan 10, 2025

I am developing for android and my phone is broken currently and I dont have an emulator set up but maybe you can try
"flutter upgrade"

@Wizely99
Copy link

running flutter upgrade worked for me thanks @hjtomi

@ImadMAKS
Copy link

I confirm, this actually fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants