-
Notifications
You must be signed in to change notification settings - Fork 845
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
947 additions
and
371 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import 'package:equatable/equatable.dart'; | ||
import 'package:flutter/foundation.dart' show immutable; | ||
|
||
import '../../../utils/experimental.dart'; | ||
|
||
@immutable | ||
@Experimental('This class might removed') | ||
class QuillAnimationConfigurations extends Equatable { | ||
const QuillAnimationConfigurations({ | ||
required this.checkBoxPointItem, | ||
}); | ||
|
||
factory QuillAnimationConfigurations.disableAll() => | ||
const QuillAnimationConfigurations( | ||
checkBoxPointItem: false, | ||
); | ||
|
||
factory QuillAnimationConfigurations.enableAll() => | ||
const QuillAnimationConfigurations( | ||
checkBoxPointItem: true, | ||
); | ||
|
||
/// This currently has issue which the whole checkbox list will rebuilt | ||
/// and the animation will replay when some value changes | ||
/// which is why disabled by default | ||
final bool checkBoxPointItem; | ||
|
||
@override | ||
List<Object?> get props => []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import '../../quill_configurations.dart'; | ||
|
||
class QuillToolbarClearFormatButtonExtraOptions | ||
extends QuillToolbarBaseButtonExtraOptions { | ||
const QuillToolbarClearFormatButtonExtraOptions({ | ||
required super.controller, | ||
required super.context, | ||
required super.onPressed, | ||
}); | ||
} | ||
|
||
class QuillToolbarClearFormatButtonOptions | ||
extends QuillToolbarBaseButtonOptions<QuillToolbarClearFormatButtonOptions, | ||
QuillToolbarClearFormatButtonExtraOptions> { | ||
const QuillToolbarClearFormatButtonOptions({ | ||
super.iconData, | ||
super.afterButtonPressed, | ||
super.childBuilder, | ||
super.controller, | ||
super.iconTheme, | ||
super.tooltip, | ||
this.iconSize, | ||
}); | ||
|
||
final double? iconSize; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import 'package:flutter/widgets.dart' show Color; | ||
import './../../shared_configurations.dart' show QuillSharedConfigurations; | ||
|
||
import 'base.dart'; | ||
|
||
class QuillToolbarColorButtonExtraOptions | ||
extends QuillToolbarBaseButtonExtraOptions { | ||
const QuillToolbarColorButtonExtraOptions({ | ||
required super.controller, | ||
required super.context, | ||
required super.onPressed, | ||
required this.iconColor, | ||
required this.iconColorBackground, | ||
required this.fillColor, | ||
required this.fillColorBackground, | ||
}); | ||
|
||
final Color? iconColor; | ||
final Color? iconColorBackground; | ||
final Color fillColor; | ||
final Color fillColorBackground; | ||
} | ||
|
||
class QuillToolbarColorButtonOptions extends QuillToolbarBaseButtonOptions< | ||
QuillToolbarColorButtonOptions, QuillToolbarColorButtonExtraOptions> { | ||
const QuillToolbarColorButtonOptions({ | ||
this.dialogBarrierColor, | ||
this.iconSize, | ||
super.iconData, | ||
super.afterButtonPressed, | ||
super.childBuilder, | ||
super.controller, | ||
super.globalIconSize, | ||
super.iconTheme, | ||
super.tooltip, | ||
}); | ||
|
||
final double? iconSize; | ||
|
||
/// By default will use the default `dialogBarrierColor` from | ||
/// [QuillSharedConfigurations] | ||
final Color? dialogBarrierColor; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import 'package:flutter/foundation.dart'; | ||
|
||
import 'base.dart'; | ||
|
||
class QuillToolbarIndentButtonExtraOptions | ||
extends QuillToolbarBaseButtonExtraOptions { | ||
const QuillToolbarIndentButtonExtraOptions({ | ||
required super.controller, | ||
required super.context, | ||
required super.onPressed, | ||
}); | ||
} | ||
|
||
@immutable | ||
class QuillToolbarIndentButtonOptions extends QuillToolbarBaseButtonOptions { | ||
const QuillToolbarIndentButtonOptions({ | ||
super.iconData, | ||
super.afterButtonPressed, | ||
super.childBuilder, | ||
super.controller, | ||
super.iconTheme, | ||
super.tooltip, | ||
this.iconSize, | ||
}); | ||
|
||
final double? iconSize; | ||
} |
58 changes: 58 additions & 0 deletions
58
lib/src/models/config/toolbar/buttons/select_alignment.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import 'package:flutter/widgets.dart' show IconData, immutable; | ||
import 'base.dart'; | ||
|
||
class QuillToolbarSelectAlignmentButtonExtraOptions | ||
extends QuillToolbarBaseButtonExtraOptions { | ||
const QuillToolbarSelectAlignmentButtonExtraOptions({ | ||
required super.controller, | ||
required super.context, | ||
required super.onPressed, | ||
}); | ||
} | ||
|
||
class QuillToolbarSelectAlignmentButtonOptions | ||
extends QuillToolbarBaseButtonOptions< | ||
QuillToolbarSelectAlignmentButtonOptions, | ||
QuillToolbarBaseButtonExtraOptions> { | ||
const QuillToolbarSelectAlignmentButtonOptions({ | ||
this.iconsData, | ||
this.tooltips, | ||
this.iconSize, | ||
super.afterButtonPressed, | ||
super.childBuilder, | ||
super.controller, | ||
super.iconTheme, | ||
}); | ||
final double? iconSize; | ||
|
||
/// Default to | ||
/// const QuillToolbarSelectAlignmentValues( | ||
/// leftAlignment: Icons.format_align_left, | ||
/// centerAlignment: Icons.format_align_center, | ||
/// rightAlignment: Icons.format_align_right, | ||
/// justifyAlignment: Icons.format_align_justify, | ||
/// ) | ||
final QuillSelectAlignmentValues<IconData>? iconsData; | ||
|
||
/// By default will use the localized tooltips | ||
final QuillSelectAlignmentValues<String>? tooltips; | ||
} | ||
|
||
/// A helper class which hold all the values for the alignments of the | ||
/// [QuillToolbarSelectAlignmentButtonOptions] | ||
/// it's not really related to the toolbar so we called it just Quill without | ||
/// toolbar but the name might change in the future | ||
@immutable | ||
class QuillSelectAlignmentValues<T> { | ||
const QuillSelectAlignmentValues({ | ||
required this.leftAlignment, | ||
required this.centerAlignment, | ||
required this.rightAlignment, | ||
required this.justifyAlignment, | ||
}); | ||
|
||
final T leftAlignment; | ||
final T centerAlignment; | ||
final T rightAlignment; | ||
final T justifyAlignment; | ||
} |
46 changes: 46 additions & 0 deletions
46
lib/src/models/config/toolbar/buttons/toggle_check_list.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import 'package:flutter/foundation.dart' show immutable; | ||
import 'package:flutter/widgets.dart' show Color; | ||
|
||
import '../../../documents/attribute.dart'; | ||
import '../../quill_configurations.dart'; | ||
|
||
class QuillToolbarToggleCheckListButtonExtraOptions | ||
extends QuillToolbarBaseButtonExtraOptions { | ||
const QuillToolbarToggleCheckListButtonExtraOptions({ | ||
required super.controller, | ||
required super.context, | ||
required super.onPressed, | ||
this.isToggled = false, | ||
}); | ||
final bool isToggled; | ||
} | ||
|
||
@immutable | ||
class QuillToolbarToggleCheckListButtonOptions | ||
extends QuillToolbarBaseButtonOptions< | ||
QuillToolbarToggleCheckListButtonOptions, | ||
QuillToolbarToggleCheckListButtonExtraOptions> { | ||
const QuillToolbarToggleCheckListButtonOptions({ | ||
this.iconSize, | ||
this.fillColor, | ||
this.attribute = Attribute.unchecked, | ||
this.isShouldRequestKeyboard = false, | ||
super.controller, | ||
super.iconTheme, | ||
super.tooltip, | ||
super.iconData, | ||
super.afterButtonPressed, | ||
super.childBuilder, | ||
}); | ||
|
||
final double? iconSize; | ||
|
||
final Color? fillColor; | ||
|
||
final Attribute attribute; | ||
|
||
/// Should we request the keyboard when you press the toggle check list button | ||
/// ? if true then we will request the keyboard, if false then we will not | ||
/// but I think you already know that | ||
final bool isShouldRequestKeyboard; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import 'package:flutter/foundation.dart' show immutable; | ||
|
||
@immutable | ||
class Experimental { | ||
const Experimental([this.reason = 'Experimental feature']); | ||
final String reason; | ||
} |
Oops, something went wrong.