From df493afb5213608992cf5077d71c90960a15a444 Mon Sep 17 00:00:00 2001 From: Ellet Date: Wed, 13 Dec 2023 14:32:56 +0300 Subject: [PATCH] Remove unused parameters --- .../config/editor/elements/list/ordered_list.dart | 5 ----- .../editor/elements/list/unordered_list.dart | 5 ----- lib/src/widgets/style_widgets/bullet_point.dart | 10 ++++------ lib/src/widgets/style_widgets/number_point.dart | 15 ++++++--------- 4 files changed, 10 insertions(+), 25 deletions(-) diff --git a/lib/src/models/config/editor/elements/list/ordered_list.dart b/lib/src/models/config/editor/elements/list/ordered_list.dart index 5d7f7aca..62603855 100644 --- a/lib/src/models/config/editor/elements/list/ordered_list.dart +++ b/lib/src/models/config/editor/elements/list/ordered_list.dart @@ -1,17 +1,12 @@ import 'package:equatable/equatable.dart'; import 'package:flutter/foundation.dart' show immutable; -import 'package:flutter/widgets.dart' show Color; @immutable class QuillEditorOrderedListElementOptions extends Equatable { const QuillEditorOrderedListElementOptions({ - this.backgroundColor, - this.fontColor, this.useTextColorForDot = true, }); - final Color? backgroundColor; - final Color? fontColor; final bool useTextColorForDot; @override List get props => []; diff --git a/lib/src/models/config/editor/elements/list/unordered_list.dart b/lib/src/models/config/editor/elements/list/unordered_list.dart index 23333ef3..77a2e7b6 100644 --- a/lib/src/models/config/editor/elements/list/unordered_list.dart +++ b/lib/src/models/config/editor/elements/list/unordered_list.dart @@ -1,17 +1,12 @@ import 'package:equatable/equatable.dart'; import 'package:flutter/foundation.dart' show immutable; -import 'package:flutter/widgets.dart' show Color; @immutable class QuillEditorUnOrderedListElementOptions extends Equatable { const QuillEditorUnOrderedListElementOptions({ - this.backgroundColor, - this.fontColor, this.useTextColorForDot = true, }); - final Color? backgroundColor; - final Color? fontColor; final bool useTextColorForDot; @override List get props => []; diff --git a/lib/src/widgets/style_widgets/bullet_point.dart b/lib/src/widgets/style_widgets/bullet_point.dart index 629c68e6..cde5bda1 100644 --- a/lib/src/widgets/style_widgets/bullet_point.dart +++ b/lib/src/widgets/style_widgets/bullet_point.dart @@ -1,18 +1,18 @@ import 'package:flutter/material.dart'; -import '../../extensions/quill_configurations_ext.dart'; - class QuillEditorBulletPoint extends StatelessWidget { const QuillEditorBulletPoint({ required this.style, required this.width, this.padding = 0, + this.backgroundColor, super.key, }); final TextStyle style; final double width; final double padding; + final Color? backgroundColor; @override Widget build(BuildContext context) { @@ -20,12 +20,10 @@ class QuillEditorBulletPoint extends StatelessWidget { alignment: AlignmentDirectional.topEnd, width: width, padding: EdgeInsetsDirectional.only(end: padding), - color: context.quillEditorElementOptions?.unorderedList.backgroundColor, + color: backgroundColor, child: Text( '•', - style: style.copyWith( - color: context.quillEditorElementOptions?.unorderedList.fontColor, - ), + style: style, ), ); } diff --git a/lib/src/widgets/style_widgets/number_point.dart b/lib/src/widgets/style_widgets/number_point.dart index ed5d96c8..7938a8a4 100644 --- a/lib/src/widgets/style_widgets/number_point.dart +++ b/lib/src/widgets/style_widgets/number_point.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; -import '../../extensions/quill_configurations_ext.dart'; import '../../models/documents/attribute.dart'; import '../quill/text_block.dart'; @@ -15,6 +14,7 @@ class QuillEditorNumberPoint extends StatelessWidget { this.withDot = true, this.padding = 0.0, super.key, + this.backgroundColor, }); final int index; @@ -25,6 +25,7 @@ class QuillEditorNumberPoint extends StatelessWidget { final Map attrs; final bool withDot; final double padding; + final Color? backgroundColor; @override Widget build(BuildContext context) { @@ -37,12 +38,10 @@ class QuillEditorNumberPoint extends StatelessWidget { alignment: AlignmentDirectional.topEnd, width: width, padding: EdgeInsetsDirectional.only(end: padding), - color: context.quillEditorElementOptions?.orderedList.backgroundColor, + color: backgroundColor, child: Text( withDot ? '$s.' : s, - style: style.copyWith( - color: context.quillEditorElementOptions?.orderedList.fontColor, - ), + style: style, ), ); } @@ -74,12 +73,10 @@ class QuillEditorNumberPoint extends StatelessWidget { alignment: AlignmentDirectional.topEnd, width: width, padding: EdgeInsetsDirectional.only(end: padding), - color: context.quillEditorElementOptions?.orderedList.backgroundColor, + color: backgroundColor, child: Text( withDot ? '$s.' : s, - style: style.copyWith( - color: context.quillEditorElementOptions?.orderedList.fontColor, - ), + style: style, ), ); }