Deprecate and

pull/1657/head
Ellet 1 year ago
parent 858a0ce6db
commit c3d6cead75
  1. 3
      CHANGELOG.md
  2. 2
      example/lib/screens/quill/my_quill_toolbar.dart
  3. 5
      flutter_quill_extensions/lib/embeds/formula/toolbar/formula_button.dart
  4. 5
      flutter_quill_extensions/lib/embeds/image/toolbar/image_button.dart
  5. 5
      flutter_quill_extensions/lib/embeds/others/camera_button/camera_button.dart
  6. 5
      flutter_quill_extensions/lib/embeds/video/toolbar/video_button.dart
  7. 12
      lib/src/models/config/toolbar/base_button_configurations.dart
  8. 2
      lib/src/models/config/toolbar/simple_toolbar_configurations.dart
  9. 5
      lib/src/widgets/toolbar/base_button/stateless_base_button.dart
  10. 4
      lib/src/widgets/toolbar/buttons/color/color_button.dart
  11. 2
      lib/src/widgets/toolbar/buttons/font_family_button.dart
  12. 4
      lib/src/widgets/toolbar/buttons/font_size_button.dart
  13. 4
      lib/src/widgets/toolbar/buttons/hearder_style/select_header_style_buttons.dart
  14. 4
      lib/src/widgets/toolbar/buttons/hearder_style/select_header_style_dropdown_button.dart
  15. 4
      lib/src/widgets/toolbar/buttons/history_button.dart
  16. 4
      lib/src/widgets/toolbar/buttons/indent_button.dart
  17. 4
      lib/src/widgets/toolbar/buttons/link_style2_button.dart
  18. 4
      lib/src/widgets/toolbar/buttons/link_style_button.dart
  19. 5
      lib/src/widgets/toolbar/buttons/search/search_button.dart
  20. 4
      lib/src/widgets/toolbar/buttons/toggle_check_list_button.dart
  21. 4
      lib/src/widgets/toolbar/buttons/toggle_style_button.dart
  22. 5
      lib/src/widgets/toolbar/simple_toolbar.dart

@ -2,9 +2,10 @@
All notable changes to this project will be documented in this file.
## 9.1.2
## 9.2.0
* Require minimum version `6.0.0` of `flutter_keyboard_visibility` to fix some build issues with Android Gradle Plugin 8.2.0
* Add on image clicked in `flutter_quill_extensions` callback
* Deprecate `globalIconSize` and `globalIconButtonFactor`, use `iconSize` and `iconButtonFactor` instead
## 9.1.1
* Require `super_clipboard` minimum version `0.8.1` to fix some bug with Linux build failure

@ -205,7 +205,7 @@ class MyQuillToolbar extends StatelessWidget {
buttonOptions: QuillSimpleToolbarButtonOptions(
base: QuillToolbarBaseButtonOptions(
afterButtonPressed: focusNode.requestFocus,
// globalIconSize: 20,
// iconSize: 20,
// iconTheme: QuillIconTheme(
// iconButtonSelectedData: IconButtonData(
// style: IconButton.styleFrom(

@ -14,14 +14,13 @@ class QuillToolbarFormulaButton extends StatelessWidget {
final QuillToolbarFormulaButtonOptions options;
double _iconSize(BuildContext context) {
final baseFontSize = baseButtonExtraOptions(context)?.globalIconSize;
final baseFontSize = baseButtonExtraOptions(context)?.iconSize;
final iconSize = options.iconSize;
return iconSize ?? baseFontSize ?? kDefaultIconSize;
}
double _iconButtonFactor(BuildContext context) {
final baseIconFactor =
baseButtonExtraOptions(context)?.globalIconButtonFactor;
final baseIconFactor = baseButtonExtraOptions(context)?.iconButtonFactor;
final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor;
}

@ -23,14 +23,13 @@ class QuillToolbarImageButton extends StatelessWidget {
final QuillToolbarImageButtonOptions options;
double _iconSize(BuildContext context) {
final baseFontSize = baseButtonExtraOptions(context)?.globalIconSize;
final baseFontSize = baseButtonExtraOptions(context)?.iconSize;
final iconSize = options.iconSize;
return iconSize ?? baseFontSize ?? kDefaultIconSize;
}
double _iconButtonFactor(BuildContext context) {
final baseIconFactor =
baseButtonExtraOptions(context)?.globalIconButtonFactor;
final baseIconFactor = baseButtonExtraOptions(context)?.iconButtonFactor;
final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor;
}

@ -27,14 +27,13 @@ class QuillToolbarCameraButton extends StatelessWidget {
final QuillToolbarCameraButtonOptions options;
double _iconSize(BuildContext context) {
final baseFontSize = baseButtonExtraOptions(context)?.globalIconSize;
final baseFontSize = baseButtonExtraOptions(context)?.iconSize;
final iconSize = options.iconSize;
return iconSize ?? baseFontSize ?? kDefaultIconSize;
}
double _iconButtonFactor(BuildContext context) {
final baseIconFactor =
baseButtonExtraOptions(context)?.globalIconButtonFactor;
final baseIconFactor = baseButtonExtraOptions(context)?.iconButtonFactor;
final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor;
}

@ -21,14 +21,13 @@ class QuillToolbarVideoButton extends StatelessWidget {
final QuillToolbarVideoButtonOptions options;
double _iconSize(BuildContext context) {
final baseFontSize = baseButtonExtraOptions(context)?.globalIconSize;
final baseFontSize = baseButtonExtraOptions(context)?.iconSize;
final iconSize = options.iconSize;
return iconSize ?? baseFontSize ?? kDefaultIconSize;
}
double _iconButtonFactor(BuildContext context) {
final baseIconFactor =
baseButtonExtraOptions(context)?.globalIconButtonFactor;
final baseIconFactor = baseButtonExtraOptions(context)?.iconButtonFactor;
final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor;
}

@ -44,9 +44,12 @@ class QuillToolbarBaseButtonExtraOptions extends Equatable {
class QuillToolbarBaseButtonOptions<T, I> extends Equatable {
const QuillToolbarBaseButtonOptions({
this.iconData,
@Deprecated('This will be removed in future releases, use iconSize instead')
this.globalIconSize = kDefaultIconSize,
this.iconSize,
this.iconButtonFactor,
@Deprecated(
'This will be removed in future releases, use iconButtonFactor instead')
this.globalIconButtonFactor = kDefaultIconButtonFactor,
this.afterButtonPressed,
this.tooltip,
@ -62,12 +65,18 @@ class QuillToolbarBaseButtonOptions<T, I> extends Equatable {
/// To change the the icon size pass a different value, by default will be
/// [kDefaultIconSize].
/// this will be used for all the buttons but you can override this
@Deprecated('This will be removed in future releases, use iconSize instead')
final double globalIconSize;
/// To change the the icon size pass a different value, by default will be
/// [kDefaultIconSize].
/// this will be used for all the buttons but you can override this
final double? iconSize;
/// The factor of how much larger the button is in relation to the icon,
/// by default it will be [kDefaultIconButtonFactor].
@Deprecated(
'This will be removed in future releases, use iconButtonFactor instead')
final double globalIconButtonFactor;
final double? iconButtonFactor;
@ -87,7 +96,8 @@ class QuillToolbarBaseButtonOptions<T, I> extends Equatable {
@override
List<Object?> get props => [
iconData,
globalIconSize,
iconSize,
iconButtonFactor,
afterButtonPressed,
tooltip,
iconTheme,

@ -142,7 +142,7 @@ class QuillSimpleToolbarConfigurations extends QuillSharedToolbarProperties {
if (alternativeToolbarSize != null) {
return alternativeToolbarSize;
}
return buttonOptions.base.globalIconSize * 2;
return (buttonOptions.base.iconSize ?? kDefaultIconSize) * 2;
}
final Map<String, String>? fontFamilyValues;

@ -20,14 +20,13 @@ abstract class QuillToolbarBaseButton<T, I> extends StatelessWidget {
final QuillController controller;
double iconSize(BuildContext context) {
final baseFontSize = baseButtonExtraOptions(context)?.globalIconSize;
final baseFontSize = baseButtonExtraOptions(context)?.iconSize;
final iconSize = options?.iconSize;
return iconSize ?? baseFontSize ?? kDefaultIconSize;
}
double iconButtonFactor(BuildContext context) {
final baseIconFactor =
baseButtonExtraOptions(context)?.globalIconButtonFactor;
final baseIconFactor = baseButtonExtraOptions(context)?.iconButtonFactor;
final iconButtonFactor = options?.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor;
}

@ -104,13 +104,13 @@ class QuillToolbarColorButtonState extends State<QuillToolbarColorButton> {
}
double get iconSize {
final baseFontSize = baseButtonExtraOptions?.globalIconSize;
final baseFontSize = baseButtonExtraOptions?.iconSize;
final iconSize = options.iconSize;
return iconSize ?? baseFontSize ?? kDefaultIconSize;
}
double get iconButtonFactor {
final baseIconFactor = baseButtonExtraOptions?.globalIconButtonFactor;
final baseIconFactor = baseButtonExtraOptions?.iconButtonFactor;
final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor;
}

@ -125,7 +125,7 @@ class QuillToolbarFontFamilyButtonState
}
double get iconSize {
final baseFontSize = context.quillToolbarBaseButtonOptions?.globalIconSize;
final baseFontSize = context.quillToolbarBaseButtonOptions?.iconSize;
final iconSize = options.iconSize;
return iconSize ?? baseFontSize ?? kDefaultIconSize;
}

@ -97,14 +97,14 @@ class QuillToolbarFontSizeButtonState
}
double get iconSize {
final baseFontSize = context.quillToolbarBaseButtonOptions?.globalIconSize;
final baseFontSize = context.quillToolbarBaseButtonOptions?.iconSize;
final iconSize = options.iconSize;
return iconSize ?? baseFontSize ?? kDefaultIconSize;
}
double get iconButtonFactor {
final baseIconFactor =
context.quillToolbarBaseButtonOptions?.globalIconButtonFactor;
context.quillToolbarBaseButtonOptions?.iconButtonFactor;
final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor;
}

@ -55,13 +55,13 @@ class QuillToolbarSelectHeaderStyleButtonsState
}
double get iconSize {
final baseFontSize = baseButtonExtraOptions?.globalIconSize;
final baseFontSize = baseButtonExtraOptions?.iconSize;
final iconSize = options.iconSize;
return iconSize ?? baseFontSize ?? kDefaultIconSize;
}
double get iconButtonFactor {
final baseIconFactor = baseButtonExtraOptions?.globalIconButtonFactor;
final baseIconFactor = baseButtonExtraOptions?.iconButtonFactor;
final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor;
}

@ -90,14 +90,14 @@ class _QuillToolbarSelectHeaderStyleDropdownButtonState
}
double get iconSize {
final baseFontSize = context.quillToolbarBaseButtonOptions?.globalIconSize;
final baseFontSize = context.quillToolbarBaseButtonOptions?.iconSize;
final iconSize = widget.options.iconSize;
return iconSize ?? baseFontSize ?? kDefaultIconSize;
}
double get iconButtonFactor {
final baseIconFactor =
context.quillToolbarBaseButtonOptions?.globalIconButtonFactor;
context.quillToolbarBaseButtonOptions?.iconButtonFactor;
final iconButtonFactor = widget.options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor;
}

@ -64,10 +64,10 @@ class QuillToolbarHistoryButtonState extends State<QuillToolbarHistoryButton> {
final childBuilder =
options.childBuilder ?? baseButtonConfigurations?.childBuilder;
final iconSize = options.iconSize ??
baseButtonConfigurations?.globalIconSize ??
baseButtonConfigurations?.iconSize ??
kDefaultIconSize;
final iconButtonFactor = options.iconButtonFactor ??
baseButtonConfigurations?.globalIconButtonFactor ??
baseButtonConfigurations?.iconButtonFactor ??
kDefaultIconButtonFactor;
final iconTheme = options.iconTheme ?? baseButtonConfigurations?.iconTheme;

@ -35,13 +35,13 @@ class QuillToolbarIndentButtonState extends State<QuillToolbarIndentButton> {
}
double get iconSize {
final baseFontSize = baseButtonExtraOptions?.globalIconSize;
final baseFontSize = baseButtonExtraOptions?.iconSize;
final iconSize = options.iconSize;
return iconSize ?? baseFontSize ?? kDefaultIconSize;
}
double get iconButtonFactor {
final baseIconFactor = baseButtonExtraOptions?.globalIconButtonFactor;
final baseIconFactor = baseButtonExtraOptions?.iconButtonFactor;
final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor;
}

@ -70,13 +70,13 @@ class _QuillToolbarLinkStyleButton2State
}
double get iconSize {
final baseFontSize = baseButtonExtraOptions?.globalIconSize;
final baseFontSize = baseButtonExtraOptions?.iconSize;
final iconSize = options.iconSize;
return iconSize ?? baseFontSize ?? kDefaultIconSize;
}
double get iconButtonFactor {
final baseIconFactor = baseButtonExtraOptions?.globalIconButtonFactor;
final baseIconFactor = baseButtonExtraOptions?.iconButtonFactor;
final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor;
}

@ -63,13 +63,13 @@ class QuillToolbarLinkStyleButtonState
}
double get iconSize {
final baseFontSize = baseButtonExtraOptions?.globalIconSize;
final baseFontSize = baseButtonExtraOptions?.iconSize;
final iconSize = options.iconSize;
return iconSize ?? baseFontSize ?? kDefaultIconSize;
}
double get iconButtonFactor {
final baseIconFactor = baseButtonExtraOptions?.globalIconButtonFactor;
final baseIconFactor = baseButtonExtraOptions?.iconButtonFactor;
final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor;
}

@ -23,14 +23,13 @@ class QuillToolbarSearchButton extends StatelessWidget {
}
double _iconSize(BuildContext context) {
final baseFontSize = baseButtonExtraOptions(context)?.globalIconSize;
final baseFontSize = baseButtonExtraOptions(context)?.iconSize;
final iconSize = options.iconSize;
return iconSize ?? baseFontSize ?? kDefaultIconSize;
}
double _iconButtonFactor(BuildContext context) {
final baseIconFactor =
baseButtonExtraOptions(context)?.globalIconButtonFactor;
final baseIconFactor = baseButtonExtraOptions(context)?.iconButtonFactor;
final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor;
}

@ -86,13 +86,13 @@ class QuillToolbarToggleCheckListButtonState
}
double get iconSize {
final baseFontSize = baseButtonExtraOptions?.globalIconSize;
final baseFontSize = baseButtonExtraOptions?.iconSize;
final iconSize = options.iconSize;
return iconSize ?? baseFontSize ?? kDefaultIconSize;
}
double get iconButtonFactor {
final baseIconFactor = baseButtonExtraOptions?.globalIconButtonFactor;
final baseIconFactor = baseButtonExtraOptions?.iconButtonFactor;
final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor;
}

@ -62,14 +62,14 @@ class QuillToolbarToggleStyleButtonState
}
double get iconSize {
final baseFontSize = context.quillToolbarBaseButtonOptions?.globalIconSize;
final baseFontSize = context.quillToolbarBaseButtonOptions?.iconSize;
final iconSize = options.iconSize;
return iconSize ?? baseFontSize ?? kDefaultIconSize;
}
double get iconButtonFactor {
final baseIconFactor =
context.quillToolbarBaseButtonOptions?.globalIconButtonFactor;
context.quillToolbarBaseButtonOptions?.iconButtonFactor;
final iconButtonFactor = options.iconButtonFactor;
return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor;
}

@ -53,8 +53,7 @@ class QuillSimpleToolbar extends StatelessWidget
final toolbarConfigurations =
context.requireQuillSimpleToolbarConfigurations;
final globalIconSize =
toolbarConfigurations.buttonOptions.base.globalIconSize;
final globalIconSize = toolbarConfigurations.buttonOptions.base.iconSize;
final axis = toolbarConfigurations.axis;
final globalController = configurations.controller;
@ -151,7 +150,7 @@ class QuillSimpleToolbar extends StatelessWidget
for (final builder in theEmbedButtons)
builder(
globalController,
globalIconSize,
globalIconSize ?? kDefaultIconSize,
context.quillToolbarBaseButtonOptions?.iconTheme,
configurations.dialogTheme),
if (configurations.showDividers &&

Loading…
Cancel
Save