Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/src/editor/editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class QuillEditorState extends State<QuillEditor>
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);
Expand All @@ -254,7 +254,7 @@ class QuillEditorState extends State<QuillEditor>
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 =
Expand Down
8 changes: 4 additions & 4 deletions lib/src/editor/style_widgets/checkbox_point.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ class QuillCheckboxPointState extends State<QuillCheckboxPoint> {
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),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/editor/widgets/cursor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
8 changes: 4 additions & 4 deletions lib/src/editor/widgets/default_styles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);

Expand Down Expand Up @@ -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,
Expand All @@ -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),
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/editor/widgets/float_cursor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions lib/src/editor/widgets/link.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
],
),
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/editor/widgets/text/text_block.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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: () {
Expand Down
8 changes: 4 additions & 4 deletions lib/src/editor_toolbar_shared/color.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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')}'
Expand Down
Loading