Cannot Compile after migration to 11.0.0
Have you checked for an existing issue?
- [x] I have searched the existing issues
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
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.
Ok thank you, sorry if I overlooked that requirement somewhere!
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.