Prefer const constructors in immutables (#117)

pull/118/head^2
Till Friebe 4 years ago committed by GitHub
parent d6b21586a4
commit dfeae914b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      analysis_options.yaml
  2. 2
      lib/widgets/default_styles.dart
  3. 2
      lib/widgets/editor.dart
  4. 6
      lib/widgets/proxy.dart
  5. 2
      lib/widgets/raw_editor.dart
  6. 2
      lib/widgets/text_block.dart
  7. 2
      lib/widgets/text_line.dart
  8. 15
      lib/widgets/toolbar.dart

@ -11,3 +11,4 @@ linter:
- avoid_print
- avoid_redundant_argument_values
- prefer_const_constructors
- prefer_const_constructors_in_immutables

@ -5,7 +5,7 @@ import 'package:tuple/tuple.dart';
class QuillStyles extends InheritedWidget {
final DefaultStyles data;
QuillStyles({
const QuillStyles({
required this.data,
required Widget child,
Key? key,

@ -169,7 +169,7 @@ class QuillEditor extends StatefulWidget {
final ValueChanged<String>? onLaunchUrl;
final EmbedBuilder embedBuilder;
QuillEditor(
const QuillEditor(
{required this.controller,
required this.focusNode,
required this.scrollController,

@ -7,7 +7,7 @@ class BaselineProxy extends SingleChildRenderObjectWidget {
final TextStyle? textStyle;
final EdgeInsets? padding;
BaselineProxy({Key? key, Widget? child, this.textStyle, this.padding})
const BaselineProxy({Key? key, Widget? child, this.textStyle, this.padding})
: super(key: key, child: child);
@override
@ -73,7 +73,7 @@ class RenderBaselineProxy extends RenderProxyBox {
}
class EmbedProxy extends SingleChildRenderObjectWidget {
EmbedProxy(Widget child) : super(child: child);
const EmbedProxy(Widget child) : super(child: child);
@override
RenderEmbedProxy createRenderObject(BuildContext context) =>
@ -145,7 +145,7 @@ class RichTextProxy extends SingleChildRenderObjectWidget {
textHeightBehavior);
}
RichTextProxy(
const RichTextProxy(
RichText child,
this.textStyle,
this.textAlign,

@ -55,7 +55,7 @@ class RawEditor extends StatefulWidget {
final ScrollPhysics? scrollPhysics;
final EmbedBuilder embedBuilder;
RawEditor(
const RawEditor(
Key key,
this.controller,
this.focusNode,

@ -61,7 +61,7 @@ class EditableTextBlock extends StatelessWidget {
final CursorCont cursorCont;
final Map<int, int> indentLevelCounts;
EditableTextBlock(
const EditableTextBlock(
this.block,
this.textDirection,
this.verticalSpacing,

@ -206,7 +206,7 @@ class EditableTextLine extends RenderObjectWidget {
final double devicePixelRatio;
final CursorCont cursorCont;
EditableTextLine(
const EditableTextLine(
this.line,
this.leading,
this.body,

@ -182,7 +182,7 @@ class ToggleStyleButton extends StatefulWidget {
final ToggleStyleButtonBuilder childBuilder;
ToggleStyleButton({
const ToggleStyleButton({
required this.attribute,
required this.icon,
required this.controller,
@ -266,7 +266,7 @@ class ToggleCheckListButton extends StatefulWidget {
final Attribute attribute;
ToggleCheckListButton({
const ToggleCheckListButton({
required this.icon,
required this.controller,
required this.attribute,
@ -494,7 +494,7 @@ class ImageButton extends StatefulWidget {
final ImageSource imageSource;
ImageButton({
const ImageButton({
required this.icon,
required this.controller,
required this.imageSource,
@ -600,7 +600,7 @@ class ColorButton extends StatefulWidget {
final bool background;
final QuillController controller;
ColorButton({
const ColorButton({
required this.icon,
required this.controller,
required this.background,
@ -738,7 +738,7 @@ class HistoryButton extends StatefulWidget {
final bool undo;
final QuillController controller;
HistoryButton({
const HistoryButton({
required this.icon,
required this.controller,
required this.undo,
@ -810,7 +810,7 @@ class IndentButton extends StatefulWidget {
final QuillController controller;
final bool isIncrease;
IndentButton({
const IndentButton({
required this.icon,
required this.controller,
required this.isIncrease,
@ -865,7 +865,8 @@ class ClearFormatButton extends StatefulWidget {
final QuillController controller;
ClearFormatButton({required this.icon, required this.controller, Key? key})
const ClearFormatButton(
{required this.icon, required this.controller, Key? key,})
: super(key: key);
@override

Loading…
Cancel
Save