Skip to content

Cannot Compile after migration to 11.0.0 #2500

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

Open
1 task done
taylor-hutyra opened this issue Mar 6, 2025 · 3 comments
Open
1 task done

Cannot Compile after migration to 11.0.0 #2500

taylor-hutyra opened this issue Mar 6, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@taylor-hutyra
Copy link

taylor-hutyra commented Mar 6, 2025

Have you checked for an existing issue?

Flutter Quill Version

11.0.0

Steps to Reproduce

Dart SDK version: 3.5.3 (stable)
Flutter 3.24.3 • channel stable

macOS Sonoma 14.5

Compiling for iOS or Android

Upgraded to 11.0.0 and went through the migration guide. Did a flutter clean and flutter pub get.

I change my embed builder, configuration names, and implemented some basic toolbar buttons (manually because I have some custom ones to add but haven't yet).

Nothing in VSCode is showing any issues but when I try run in debug mode, it exits with the following list of errors with no reference to any of my code, so I'm not exactly sure where to begin debugging.

Launching lib/main.dart on SM G998U in debug mode...
../../.pub-cache/hosted/pub.dev/flutter_quill-11.0.0/lib/src/editor/widgets/default_styles.dart:263:44: 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: themeData.colorScheme.primary.withValues(alpha: 0.8),
                                           ^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/flutter_quill-11.0.0/lib/src/editor/widgets/default_styles.dart:427:32: Error: The method 'withValues' isn't defined for the class 'MaterialColor'.
 - 'MaterialColor' is from 'package:flutter/src/material/colors.dart' ('../../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'.
            color: Colors.grey.withValues(alpha: 0.6),
                               ^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/flutter_quill-11.0.0/lib/src/editor/widgets/default_styles.dart:442:43: 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'.
        TextStyle(color: baseStyle.color!.withValues(alpha: 0.6)),
                                          ^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/flutter_quill-11.0.0/lib/src/editor/widgets/default_styles.dart:454:41: 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: Colors.blue.shade900.withValues(alpha: 0.9),
                                        ^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/flutter_quill-11.0.0/lib/src/editor/style_widgets/checkbox_point.dart:38:43: 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'.
            : theme.colorScheme.onSurface.withValues(alpha: 0.5))
                                          ^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/flutter_quill-11.0.0/lib/src/editor/style_widgets/checkbox_point.dart:43:43: 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'.
            : theme.colorScheme.onSurface.withValues(alpha: 0))
                                          ^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/flutter_quill-11.0.0/lib/src/editor/style_widgets/checkbox_point.dart:45:43: 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'.
            ? theme.colorScheme.onSurface.withValues(alpha: 0.5)
                                          ^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/flutter_quill-11.0.0/lib/src/editor/style_widgets/checkbox_point.dart:46:43: 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'.
            : theme.colorScheme.onSurface.withValues(alpha: 0.3));
                                          ^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/flutter_quill-11.0.0/lib/src/editor/widgets/link.dart:212:50: 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: theme.colorScheme.onSurface.withValues(alpha: 0.75),
                                                 ^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/flutter_quill-11.0.0/lib/src/editor/widgets/link.dart:270:44: 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: theme.colorScheme.onSurface.withValues(alpha: 0.75),
                                           ^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/flutter_quill-11.0.0/lib/src/editor/editor.dart:241:39: 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'.
          cupertinoTheme.primaryColor.withValues(alpha: 0.40);
                                      ^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/flutter_quill-11.0.0/lib/src/editor/editor.dart:251:37: 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'.
          theme.colorScheme.primary.withValues(alpha: 0.40);
                                    ^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/flutter_quill-11.0.0/lib/src/editor/widgets/float_cursor.dart:24:45: 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'.
    final floatingCursorColor = style.color.withValues(alpha: 0.75);
                                            ^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/flutter_quill-11.0.0/lib/src/editor/widgets/cursor.dart:235:32: 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.value = _style.color.withValues(alpha: _blinkOpacityController.value);
                               ^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/flutter_quill-11.0.0/lib/src/editor/widgets/text/text_block.dart:296:51: 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: defaultStyles.code!.style.color!.withValues(alpha: 0.4),
                                                  ^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/flutter_quill-11.0.0/lib/src/editor_toolbar_shared/color.dart:24:35: 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'.
  final alpha = floatToInt8(color.a);
                                  ^
../../.pub-cache/hosted/pub.dev/flutter_quill-11.0.0/lib/src/editor_toolbar_shared/color.dart:25:33: 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'.
  final red = floatToInt8(color.r);
                                ^
../../.pub-cache/hosted/pub.dev/flutter_quill-11.0.0/lib/src/editor_toolbar_shared/color.dart:26:35: 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'.
  final green = floatToInt8(color.g);
                                  ^
../../.pub-cache/hosted/pub.dev/flutter_quill-11.0.0/lib/src/editor_toolbar_shared/color.dart:27:34: 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'.
  final blue = floatToInt8(color.b);
                                 ^
Target kernel_snapshot_program failed: Exception


FAILURE: Build failed with an exception.

Expected results

Expected to compile after migration 😄

Actual results

Crash on compile

Additional Context

@taylor-hutyra taylor-hutyra added the bug Something isn't working label Mar 6, 2025
@EchoEllet
Copy link
Collaborator

This is a known issue. Upgrade your Flutter sdk to the 3.27 or newer since those methods aren't available on your sdk. We should bump the minimum sdk version.

Also, we can't use the new methods in a backward compatible way. The old methods are deprecated.

@taylor-hutyra
Copy link
Author

Ok thank you, sorry if I overlooked that requirement somewhere!

@EchoEllet
Copy link
Collaborator

This requirement is not clear, but the issue itself is common.

We should either update the minimum sdk version or instead stick to the old methods and ignore deprecation warnings until they are removed.

@EchoEllet EchoEllet reopened this Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants