diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b4e458f..3f868cb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## [8.5.2] - Update `README.md` - Feature: Allow you to add custom callback when the `QuillToolbarColorButton` pressed +- The `QuillToolbar` is no implements `PreferredSizeWidget` so you can use it in the AppBar just like `QuillBaseToolbar` ## [8.5.1] - Update `README.md` diff --git a/README.md b/README.md index 35f47b91..b6068995 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ Compatible versions: | flutter_quill | flutter_quill_extensions | flutter_quill_test | |-------------------------|--------------------------|-------------------------| +| 8.5.2 | 0.6.9 | 0.0.5 | | 8.5.1 | 0.6.7 | 0.0.5 | | 8.5.0 | 0.6.7 | 0.0.5 | diff --git a/example/lib/pages/testing_home_page.dart b/example/lib/pages/testing_home_page.dart index 9e9f20e4..03dc4bba 100644 --- a/example/lib/pages/testing_home_page.dart +++ b/example/lib/pages/testing_home_page.dart @@ -6,6 +6,8 @@ class TestingHomePage extends StatelessWidget { @override Widget build(BuildContext context) { - return const Scaffold(); + return const Scaffold( + appBar: QuillToolbar(), + ); } } diff --git a/lib/src/widgets/toolbar/toolbar.dart b/lib/src/widgets/toolbar/toolbar.dart index cf787ac0..d729b032 100644 --- a/lib/src/widgets/toolbar/toolbar.dart +++ b/lib/src/widgets/toolbar/toolbar.dart @@ -7,7 +7,7 @@ import '../../models/documents/attribute.dart'; import '../utils/provider.dart'; import 'base_toolbar.dart'; -class QuillToolbar extends StatelessWidget { +class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { const QuillToolbar({ super.key, this.configurations = const QuillToolbarConfigurations(), @@ -444,4 +444,9 @@ class QuillToolbar extends StatelessWidget { ), ); } + + @override + Size get preferredSize => configurations.axis == Axis.horizontal + ? const Size.fromHeight(defaultToolbarSize) + : const Size.fromWidth(defaultToolbarSize); } diff --git a/pubspec.yaml b/pubspec.yaml index 9d48e5a7..81cea8e5 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.5.1 +version: 8.5.2 homepage: https://1o24bbs.com/c/bulletjournal/108 repository: https://github.com/singerdmx/flutter-quill