Skip to content

Commit

Permalink
chore: merge origin/master and fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
EchoEllet committed Dec 13, 2024
2 parents 34e8586 + 1e54c94 commit 7aa2f23
Show file tree
Hide file tree
Showing 15 changed files with 107 additions and 45 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Rewrite the image save functionality for [`flutter_quill_extensions`](https://pub.dev/packages/flutter_quill_extensions) [#2403](https://github.com/singerdmx/flutter-quill/pull/2403).
- Migrate [quill_native_bridge](https://pub.dev/packages/quill_native_bridge) to `11.0.0` [#2403](https://github.com/singerdmx/flutter-quill/pull/2403).
- Avoid using deprecated APIs in Flutter 3.27.0:
- Migrate from `withOpacity` to `withValues` according to [Color wide gamut - Opacity migration](https://docs.flutter.dev/release/breaking-changes/wide-gamut-framework#opacity).
- Avoid using the deprecated `Color.value` getter.
- Ignore `unreachable_switch_default` warning (introduced in Dart 3.6).
- Update `intl` dependency to support versions `0.19.0` and `0.20.0`.

### Fixed

Expand Down
4 changes: 4 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
include: package:flutter_lints/flutter.yaml

analyzer:
# TODO: Included for backward compatibility, remove when the minimum Dart SDK is 3.6.0
errors:
unreachable_switch_default: ignore
linter:
rules:
always_declare_return_types: true
Expand Down
56 changes: 28 additions & 28 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ packages:
dependency: transitive
description:
name: async
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.dev"
source: hosted
version: "2.12.0"
version: "2.11.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
version: "2.1.1"
characters:
dependency: transitive
description:
Expand All @@ -45,10 +45,10 @@ packages:
dependency: transitive
description:
name: clock
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.dev"
source: hosted
version: "1.1.2"
version: "1.1.1"
collection:
dependency: transitive
description:
Expand Down Expand Up @@ -93,10 +93,10 @@ packages:
dependency: transitive
description:
name: fake_async
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.dev"
source: hosted
version: "1.3.2"
version: "1.3.1"
ffi:
dependency: transitive
description:
Expand Down Expand Up @@ -222,10 +222,10 @@ packages:
dependency: transitive
description:
name: flutter_quill_delta_from_html
sha256: "288f879bd11f9b6857868e7b198e69918530bd63d196ead6d8a9ee780b4b44d2"
sha256: "63873b5391b56daa999ce8fa7dd23dfd7d0417a70e00a647ba450f4a8988afd0"
url: "https://pub.dev"
source: hosted
version: "1.4.2"
version: "1.4.3"
flutter_quill_extensions:
dependency: "direct main"
description:
Expand Down Expand Up @@ -350,18 +350,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
url: "https://pub.dev"
source: hosted
version: "10.0.8"
version: "10.0.7"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
url: "https://pub.dev"
source: hosted
version: "3.0.9"
version: "3.0.8"
leak_tracker_testing:
dependency: transitive
description:
Expand Down Expand Up @@ -422,10 +422,10 @@ packages:
dependency: "direct main"
description:
name: path
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.9.0"
photo_view:
dependency: transitive
description:
Expand Down Expand Up @@ -454,10 +454,10 @@ packages:
dependency: transitive
description:
name: quill_native_bridge_android
sha256: b87f7baf2daa8255d7814b350c1add626bb799962d71f1be09f8002d8879b21e
sha256: b75c7e6ede362a7007f545118e756b1f19053994144ec9eda932ce5e54a57569
url: "https://pub.dev"
source: hosted
version: "0.0.1+1"
version: "0.0.1+2"
quill_native_bridge_ios:
dependency: transitive
description:
Expand Down Expand Up @@ -547,10 +547,10 @@ packages:
dependency: transitive
description:
name: string_scanner
sha256: "0bd04f5bb74fcd6ff0606a888a30e917af9bd52820b178eaa464beb11dca84b6"
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.3.0"
term_glyph:
dependency: transitive
description:
Expand Down Expand Up @@ -611,10 +611,10 @@ packages:
dependency: transitive
description:
name: url_launcher_ios
sha256: e43b677296fadce447e987a2f519dcf5f6d1e527dc35d01ffab4fff5b8a7063e
sha256: "16a513b6c12bb419304e72ea0ae2ab4fed569920d1c7cb850263fe3acc824626"
url: "https://pub.dev"
source: hosted
version: "6.3.1"
version: "6.3.2"
url_launcher_linux:
dependency: transitive
description:
Expand All @@ -627,10 +627,10 @@ packages:
dependency: transitive
description:
name: url_launcher_macos
sha256: "769549c999acdb42b8bcfa7c43d72bf79a382ca7441ab18a808e101149daf672"
sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2"
url: "https://pub.dev"
source: hosted
version: "3.2.1"
version: "3.2.2"
url_launcher_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -683,10 +683,10 @@ packages:
dependency: transitive
description:
name: video_player_avfoundation
sha256: "0b146e5d82e886ff43e5a46c6bcbe390761b802864a6e2503eb612d69a405dfa"
sha256: "33224c19775fd244be2d6e3dbd8e1826ab162877bd61123bf71890772119a2b7"
url: "https://pub.dev"
source: hosted
version: "2.6.3"
version: "2.6.5"
video_player_platform_interface:
dependency: transitive
description:
Expand All @@ -707,10 +707,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b
url: "https://pub.dev"
source: hosted
version: "14.3.1"
version: "14.3.0"
web:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions flutter_quill_extensions/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Rewrite the image save functionality with support for all platforms [#2403](https://github.com/singerdmx/flutter-quill/pull/2403).
- Ignore `unreachable_switch_default` warning (introduced in Dart 3.6).

### Removed

Expand Down
4 changes: 4 additions & 0 deletions flutter_quill_extensions/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
include: package:flutter_lints/flutter.yaml

analyzer:
# TODO: Included for backward compatibility, remove when the minimum Dart SDK is 3.6.0
errors:
unreachable_switch_default: ignore
linter:
rules:
always_declare_return_types: true
Expand Down
4 changes: 2 additions & 2 deletions lib/src/editor/editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class QuillEditorState extends State<QuillEditor>
cursorOpacityAnimates = true;
cursorColor ??= selectionTheme.cursorColor ?? cupertinoTheme.primaryColor;
selectionColor = selectionTheme.selectionColor ??
cupertinoTheme.primaryColor.withOpacity(0.40);
cupertinoTheme.primaryColor.withValues(alpha: 0.40);
cursorRadius ??= const Radius.circular(2);
cursorOffset = Offset(
iOSHorizontalOffset / MediaQuery.devicePixelRatioOf(context), 0);
Expand All @@ -249,7 +249,7 @@ class QuillEditorState extends State<QuillEditor>
cursorOpacityAnimates = false;
cursorColor ??= selectionTheme.cursorColor ?? theme.colorScheme.primary;
selectionColor = selectionTheme.selectionColor ??
theme.colorScheme.primary.withOpacity(0.40);
theme.colorScheme.primary.withValues(alpha: 0.40);
}

final showSelectionToolbar = configurations.enableInteractiveSelection &&
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.withOpacity(0.5))
: theme.colorScheme.onSurface.withValues(alpha: 0.5))
: theme.colorScheme.surface;
final borderColor = widget.value
? (widget.enabled
? theme.colorScheme.primary
: theme.colorScheme.onSurface.withOpacity(0))
: theme.colorScheme.onSurface.withValues(alpha: 0))
: (widget.enabled
? theme.colorScheme.onSurface.withOpacity(0.5)
: theme.colorScheme.onSurface.withOpacity(0.3));
? theme.colorScheme.onSurface.withValues(alpha: 0.5)
: theme.colorScheme.onSurface.withValues(alpha: 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.withOpacity(_blinkOpacityController.value);
color.value = _style.color.withValues(alpha: _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 @@ -260,7 +260,7 @@ class DefaultStyles {

final inlineCodeStyle = TextStyle(
fontSize: 14,
color: themeData.colorScheme.primary.withOpacity(0.8),
color: themeData.colorScheme.primary.withValues(alpha: 0.8),
fontFamily: fontFamily,
);

Expand Down Expand Up @@ -424,7 +424,7 @@ class DefaultStyles {
defaultTextStyle.style.copyWith(
fontSize: 20,
height: 1.5,
color: Colors.grey.withOpacity(0.6),
color: Colors.grey.withValues(alpha: 0.6),
),
baseHorizontalSpacing,
VerticalSpacing.zero,
Expand All @@ -439,7 +439,7 @@ class DefaultStyles {
null,
),
quote: DefaultTextBlockStyle(
TextStyle(color: baseStyle.color!.withOpacity(0.6)),
TextStyle(color: baseStyle.color!.withValues(alpha: 0.6)),
baseHorizontalSpacing,
baseVerticalSpacing,
const VerticalSpacing(6, 2),
Expand All @@ -451,7 +451,7 @@ class DefaultStyles {
),
code: DefaultTextBlockStyle(
TextStyle(
color: Colors.blue.shade900.withOpacity(0.9),
color: Colors.blue.shade900.withValues(alpha: 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.withOpacity(0.75);
final floatingCursorColor = style.color.withValues(alpha: 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 @@ -209,7 +209,7 @@ class _CupertinoAction extends StatelessWidget {
Icon(
icon,
size: theme.iconTheme.size,
color: theme.colorScheme.onSurface.withOpacity(0.75),
color: theme.colorScheme.onSurface.withValues(alpha: 0.75),
)
],
),
Expand Down Expand Up @@ -267,7 +267,7 @@ class _MaterialAction extends StatelessWidget {
leading: Icon(
icon,
size: theme.iconTheme.size,
color: theme.colorScheme.onSurface.withOpacity(0.75),
color: theme.colorScheme.onSurface.withValues(alpha: 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 @@ -290,7 +290,7 @@ class EditableTextBlock extends StatelessWidget {
return null;
}
return defaultStyles.code!.style.copyWith(
color: defaultStyles.code!.style.color!.withOpacity(0.4),
color: defaultStyles.code!.style.color!.withValues(alpha: 0.4),
);
}(),
width: () {
Expand Down
14 changes: 13 additions & 1 deletion lib/src/editor_toolbar_shared/color.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ Color hexToColor(String? hexString) {
return Color(int.tryParse(buffer.toString(), radix: 16) ?? 0xFF000000);
}

// Without the hash sign (`#`).
String colorToHex(Color color) {
return color.value.toRadixString(16).padLeft(8, '0').toUpperCase();
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);

return '${alpha.toRadixString(16).padLeft(2, '0')}'
'${red.toRadixString(16).padLeft(2, '0')}'
'${green.toRadixString(16).padLeft(2, '0')}'
'${blue.toRadixString(16).padLeft(2, '0')}'
.toUpperCase();
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies:
quiver: ^3.2.0
meta: ^1.7.0
html: ^0.15.0
intl: ^0.19.0
intl: '>=0.19.0 <0.21.0'

flutter_colorpicker: ^1.1.0

Expand Down
Loading

0 comments on commit 7aa2f23

Please sign in to comment.