From ccfe151ba4fd425d921e604e9d009f50dab0ae0e Mon Sep 17 00:00:00 2001 From: Ellet Date: Sat, 2 Dec 2023 10:51:02 +0300 Subject: [PATCH] Prepare to release 8.6.4 --- CHANGELOG.md | 4 ++++ .../config/raw_editor/configurations.dart | 19 ++++++++++++++++--- ..._editor_state_text_input_client_mixin.dart | 10 ++++++++-- pubspec.yaml | 2 +- 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f969c0e..0a6cd7db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## 8.6.4 +* The default value of `keyboardAppearance` for the iOS will be the one from the App/System theme mode instead of always using the `Brightness.light` +* Fix typos in `README.md` + ## 8.6.3 * Update the minimum flutter version to `3.16.0` diff --git a/lib/src/models/config/raw_editor/configurations.dart b/lib/src/models/config/raw_editor/configurations.dart index b7bdebe3..8be19fb6 100644 --- a/lib/src/models/config/raw_editor/configurations.dart +++ b/lib/src/models/config/raw_editor/configurations.dart @@ -64,7 +64,7 @@ class QuillRawEditorConfigurations extends Equatable { this.expands = false, this.isOnTapOutsideEnabled = true, this.onTapOutside, - this.keyboardAppearance = Brightness.light, + this.keyboardAppearance, this.enableInteractiveSelection = true, this.scrollPhysics, this.linkActionPickerDelegate = defaultLinkActionPickerDelegate, @@ -214,8 +214,21 @@ class QuillRawEditorConfigurations extends Equatable { /// /// This setting is only honored on iOS devices. /// - /// Defaults to [Brightness.light]. - final Brightness keyboardAppearance; + /// Defaults to Material/Cupertino App Brightness. + /// If you are using Custom widget app then we will use the system + /// theme mode as a default. + /// + /// It will run using the following logic: + /// + /// ```dart + /// + /// widget.configurations.keyboardAppearance ?? + /// CupertinoTheme.maybeBrightnessOf(context) ?? + /// MediaQuery.maybePlatformBrightnessOf(context) ?? + /// Theme.of(context).brightness + /// + /// ``` + final Brightness? keyboardAppearance; /// If true, then long-pressing this TextField will select text and show the /// cut/copy/paste menu, and tapping will move the text caret. diff --git a/lib/src/widgets/raw_editor/raw_editor_state_text_input_client_mixin.dart b/lib/src/widgets/raw_editor/raw_editor_state_text_input_client_mixin.dart index cc0ac14c..45f05b19 100644 --- a/lib/src/widgets/raw_editor/raw_editor_state_text_input_client_mixin.dart +++ b/lib/src/widgets/raw_editor/raw_editor_state_text_input_client_mixin.dart @@ -1,9 +1,12 @@ -import 'dart:ui'; +import 'dart:ui' show lerpDouble; import 'package:flutter/animation.dart' show Curves; +import 'package:flutter/cupertino.dart' show CupertinoTheme; import 'package:flutter/foundation.dart' show kIsWeb; +import 'package:flutter/material.dart' show Theme; import 'package:flutter/scheduler.dart' show SchedulerBinding; import 'package:flutter/services.dart'; +import 'package:flutter/widgets.dart' show MediaQuery; import '../../models/documents/document.dart'; import '../../utils/delta.dart'; @@ -59,7 +62,10 @@ mixin RawEditorStateTextInputClientMixin on EditorState readOnly: widget.configurations.isReadOnly, inputAction: widget.configurations.textInputAction, enableSuggestions: !widget.configurations.isReadOnly, - keyboardAppearance: widget.configurations.keyboardAppearance, + keyboardAppearance: widget.configurations.keyboardAppearance ?? + CupertinoTheme.maybeBrightnessOf(context) ?? + MediaQuery.maybePlatformBrightnessOf(context) ?? + Theme.of(context).brightness, textCapitalization: widget.configurations.textCapitalization, allowedMimeTypes: widget.configurations.contentInsertionConfiguration == null diff --git a/pubspec.yaml b/pubspec.yaml index aff6910b..184b1bb8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_quill description: A rich text editor built for the modern Android, iOS, web and desktop platforms. It is the WYSIWYG editor and a Quill component for Flutter. -version: 8.6.3 +version: 8.6.4 homepage: https://1o24bbs.com/c/bulletjournal/108 repository: https://github.com/singerdmx/flutter-quill