Skip to content

Commit

Permalink
The isToggled property is extracted into a class
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellet committed Dec 2, 2023
1 parent 07dbef8 commit f5bcaa8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions lib/src/models/config/toolbar/buttons/base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<Object?> get props => [isToggled];
}

@immutable
class QuillToolbarBaseButtonExtraOptions extends Equatable {
const QuillToolbarBaseButtonExtraOptions({
Expand Down
4 changes: 3 additions & 1 deletion lib/src/models/config/toolbar/buttons/toggle_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ 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,
required super.onPressed,
required this.isToggled,
});

@override
final bool isToggled;
}

Expand Down

0 comments on commit f5bcaa8

Please sign in to comment.