diff --git a/lib/src/editor/editor.dart b/lib/src/editor/editor.dart index f1b23db34..3ed0a62f0 100644 --- a/lib/src/editor/editor.dart +++ b/lib/src/editor/editor.dart @@ -244,7 +244,7 @@ class QuillEditorState extends State cursorOpacityAnimates = true; cursorColor ??= selectionTheme.cursorColor ?? cupertinoTheme.primaryColor; selectionColor = selectionTheme.selectionColor ?? - cupertinoTheme.primaryColor.withValues(alpha: 0.40); + cupertinoTheme.primaryColor.withValues(0.4); cursorRadius ??= const Radius.circular(2); cursorOffset = Offset( iOSHorizontalOffset / MediaQuery.devicePixelRatioOf(context), 0); @@ -254,7 +254,7 @@ class QuillEditorState extends State cursorOpacityAnimates = false; cursorColor ??= selectionTheme.cursorColor ?? theme.colorScheme.primary; selectionColor = selectionTheme.selectionColor ?? - theme.colorScheme.primary.withValues(alpha: 0.40); + theme.colorScheme.primary.withValues(0.4); } final showSelectionToolbar = diff --git a/lib/src/editor/style_widgets/checkbox_point.dart b/lib/src/editor/style_widgets/checkbox_point.dart index 1c98549cc..27810a145 100644 --- a/lib/src/editor/style_widgets/checkbox_point.dart +++ b/lib/src/editor/style_widgets/checkbox_point.dart @@ -35,15 +35,15 @@ class QuillCheckboxPointState extends State { final fillColor = widget.value ? (widget.enabled ? theme.colorScheme.primary - : theme.colorScheme.onSurface.withValues(alpha: 0.5)) + : theme.colorScheme.onSurface.withValues(0.5)) : theme.colorScheme.surface; final borderColor = widget.value ? (widget.enabled ? theme.colorScheme.primary - : theme.colorScheme.onSurface.withValues(alpha: 0)) + : theme.colorScheme.onSurface.withValues(0)) : (widget.enabled - ? theme.colorScheme.onSurface.withValues(alpha: 0.5) - : theme.colorScheme.onSurface.withValues(alpha: 0.3)); + ? theme.colorScheme.onSurface.withValues(0.5) + : theme.colorScheme.onSurface.withValues(0.3)); final child = Container( alignment: AlignmentDirectional.centerEnd, padding: EdgeInsetsDirectional.only(end: widget.size / 2), diff --git a/lib/src/editor/widgets/cursor.dart b/lib/src/editor/widgets/cursor.dart index de126e909..432c512b6 100644 --- a/lib/src/editor/widgets/cursor.dart +++ b/lib/src/editor/widgets/cursor.dart @@ -232,7 +232,7 @@ class CursorCont extends ChangeNotifier { } void _onColorTick() { - color.value = _style.color.withValues(alpha: _blinkOpacityController.value); + color.value = _style.color.withValues(_blinkOpacityController.value); blink.value = show.value && _blinkOpacityController.value > 0; } } diff --git a/lib/src/editor/widgets/default_styles.dart b/lib/src/editor/widgets/default_styles.dart index 87636f63c..24c921f47 100644 --- a/lib/src/editor/widgets/default_styles.dart +++ b/lib/src/editor/widgets/default_styles.dart @@ -300,7 +300,7 @@ class DefaultStyles { final inlineCodeStyle = TextStyle( fontSize: 14, - color: themeData.colorScheme.primary.withValues(alpha: 0.8), + color: themeData.colorScheme.primary.withValues(0.8), fontFamily: fontFamily, ); @@ -464,7 +464,7 @@ class DefaultStyles { defaultTextStyle.style.copyWith( fontSize: 20, height: 1.5, - color: Colors.grey.withValues(alpha: 0.6), + color: Colors.grey.withValues(0.6), ), baseHorizontalSpacing, VerticalSpacing.zero, @@ -479,7 +479,7 @@ class DefaultStyles { null, ), quote: DefaultTextBlockStyle( - TextStyle(color: baseStyle.color!.withValues(alpha: 0.6)), + TextStyle(color: baseStyle.color!.withValues(0.6)), baseHorizontalSpacing, baseVerticalSpacing, const VerticalSpacing(6, 2), @@ -491,7 +491,7 @@ class DefaultStyles { ), code: DefaultTextBlockStyle( TextStyle( - color: Colors.blue.shade900.withValues(alpha: 0.9), + color: Colors.blue.shade900.withValues(0.9), fontFamily: fontFamily, fontSize: 13, height: 1.15, diff --git a/lib/src/editor/widgets/float_cursor.dart b/lib/src/editor/widgets/float_cursor.dart index f5849ae01..fc0971244 100644 --- a/lib/src/editor/widgets/float_cursor.dart +++ b/lib/src/editor/widgets/float_cursor.dart @@ -21,7 +21,7 @@ class FloatingCursorPainter { void paint(Canvas canvas) { final floatingCursorRect = this.floatingCursorRect; - final floatingCursorColor = style.color.withValues(alpha: 0.75); + final floatingCursorColor = style.color.withValues(0.75); if (floatingCursorRect == null) return; canvas.drawRRect( RRect.fromRectAndRadius(floatingCursorRect, _kFloatingCaretRadius), diff --git a/lib/src/editor/widgets/link.dart b/lib/src/editor/widgets/link.dart index 6338f4a8d..43cba4dba 100644 --- a/lib/src/editor/widgets/link.dart +++ b/lib/src/editor/widgets/link.dart @@ -215,7 +215,7 @@ class _CupertinoAction extends StatelessWidget { Icon( icon, size: theme.iconTheme.size, - color: theme.colorScheme.onSurface.withValues(alpha: 0.75), + color: theme.colorScheme.onSurface.withValues(0.75), ) ], ), @@ -273,7 +273,7 @@ class _MaterialAction extends StatelessWidget { leading: Icon( icon, size: theme.iconTheme.size, - color: theme.colorScheme.onSurface.withValues(alpha: 0.75), + color: theme.colorScheme.onSurface.withValues(0.75), ), title: Text(title), onTap: onPressed, diff --git a/lib/src/editor/widgets/text/text_block.dart b/lib/src/editor/widgets/text/text_block.dart index 01a4208e4..b4b9c3282 100644 --- a/lib/src/editor/widgets/text/text_block.dart +++ b/lib/src/editor/widgets/text/text_block.dart @@ -293,7 +293,7 @@ class EditableTextBlock extends StatelessWidget { return null; } return defaultStyles.code!.style.copyWith( - color: defaultStyles.code!.style.color!.withValues(alpha: 0.4), + color: defaultStyles.code!.style.color!.withValues(0.4), ); }(), width: () { diff --git a/lib/src/editor_toolbar_shared/color.dart b/lib/src/editor_toolbar_shared/color.dart index 14e2c31be..f4c43768b 100644 --- a/lib/src/editor_toolbar_shared/color.dart +++ b/lib/src/editor_toolbar_shared/color.dart @@ -21,10 +21,10 @@ Color hexToColor(String? hexString) { String colorToHex(Color color) { int floatToInt8(double x) => (x * 255.0).round() & 0xff; - final alpha = floatToInt8(color.a); - final red = floatToInt8(color.r); - final green = floatToInt8(color.g); - final blue = floatToInt8(color.b); + final alpha = floatToInt8(color.alpha); + final red = floatToInt8(color.red); + final green = floatToInt8(color.green); + final blue = floatToInt8(color.blue); return '${alpha.toRadixString(16).padLeft(2, '0')}' '${red.toRadixString(16).padLeft(2, '0')}'