PrettyDiffText class

Inheritance

Constructors

PrettyDiffText({Key? key, required String oldText, required String newText, TextStyle defaultTextStyle = const TextStyle(color: Colors.black), TextStyle addedTextStyle = const TextStyle(backgroundColor: Color.fromARGB(255, 139, 197, 139)), TextStyle deletedTextStyle = const TextStyle(backgroundColor: Color.fromARGB(255, 255, 129, 129), decoration: TextDecoration.lineThrough), double diffTimeout = 1.0, DiffCleanupType diffCleanupType = DiffCleanupType.SEMANTIC, int diffEditCost = 4, TextAlign textAlign = TextAlign.start, TextDirection? textDirection, bool softWrap = true, TextOverflow overflow = TextOverflow.clip, double textScaleFactor = 1.0, int? maxLines, Locale? locale, StrutStyle? strutStyle, TextWidthBasis textWidthBasis = TextWidthBasis.parent, TextHeightBehavior? textHeightBehavior})
const

Properties

addedTextStyle TextStyle
Text style of text which was added.
final
defaultTextStyle TextStyle
Default text style of RichText. Mainly will be used for the text which did not change. addedTextStyle and deletedTextStyle will inherit styles from it.
final
deletedTextStyle TextStyle
Text style of text which was deleted.
final
diffCleanupType DiffCleanupType
See DiffCleanupType for types.
final
diffEditCost int
Cost of an empty edit operation in terms of edit characters. This value is used when DiffCleanupType is selected as DiffCleanupType.EFFICIENCY The larger the edit cost, the more aggressive the cleanup. The default value is 4.
final
diffTimeout double
If the mapping phase of the diff computation takes longer than this, then the computation is truncated and the best solution to date is returned. While guaranteed to be correct, it may not be optimal. A timeout of '0' allows for unlimited computation. The default value is 1.0.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
locale Locale?
final
maxLines int?
final
newText String
Edited text which is going to be compared with oldText.
final
oldText String
The original text which is going to be compared with newText.
final
overflow TextOverflow
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
softWrap bool
final
strutStyle StrutStyle?
final
textAlign TextAlign
!!! DERIVED PROPERTIES FROM FLUTTER'S RichText IN ORDER TO ALLOW CUSTOMIZABILITY !!! See RichText for documentation.
final
textDirection TextDirection?
final
textHeightBehavior TextHeightBehavior?
final
textScaleFactor double
final
textWidthBasis TextWidthBasis
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
cleanupDiffs(DiffMatchPatch dmp, List<Diff> diffs) → void
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
getTextStyleByDiffOperation(Diff diff) TextStyle
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited