From f5bcaa8dc5329fc4e4b057ea8b243f380fec252d Mon Sep 17 00:00:00 2001 From: Ellet Date: Sat, 2 Dec 2023 11:29:53 +0300 Subject: [PATCH] The isToggled property is extracted into a class --- lib/src/models/config/toolbar/buttons/base.dart | 9 +++++++++ lib/src/models/config/toolbar/buttons/toggle_style.dart | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/src/models/config/toolbar/buttons/base.dart b/lib/src/models/config/toolbar/buttons/base.dart index 22ed54b2..4b7b8ab1 100644 --- a/lib/src/models/config/toolbar/buttons/base.dart +++ b/lib/src/models/config/toolbar/buttons/base.dart @@ -8,6 +8,15 @@ import '../../../themes/quill_icon_theme.dart' show QuillIconTheme; import '../../quill_configurations.dart' show kDefaultIconSize, kIconButtonFactor; +class QuillToolbarBaseButtonExtraOptionsIsToggled extends Equatable { + const QuillToolbarBaseButtonExtraOptionsIsToggled(this.isToggled); + + final bool isToggled; + + @override + List get props => [isToggled]; +} + @immutable class QuillToolbarBaseButtonExtraOptions extends Equatable { const QuillToolbarBaseButtonExtraOptions({ diff --git a/lib/src/models/config/toolbar/buttons/toggle_style.dart b/lib/src/models/config/toolbar/buttons/toggle_style.dart index 97af1319..0d58fdca 100644 --- a/lib/src/models/config/toolbar/buttons/toggle_style.dart +++ b/lib/src/models/config/toolbar/buttons/toggle_style.dart @@ -5,7 +5,8 @@ import 'package:flutter/widgets.dart' show Color; import 'base.dart'; class QuillToolbarToggleStyleButtonExtraOptions - extends QuillToolbarBaseButtonExtraOptions { + extends QuillToolbarBaseButtonExtraOptions + implements QuillToolbarBaseButtonExtraOptionsIsToggled { const QuillToolbarToggleStyleButtonExtraOptions({ required super.controller, required super.context, @@ -13,6 +14,7 @@ class QuillToolbarToggleStyleButtonExtraOptions required this.isToggled, }); + @override final bool isToggled; }