feat(ui): add support for StreamMessageThemeData.urlAttachmentTextMaxLine.
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
@@ -27,6 +27,7 @@ class StreamMessageThemeData with Diagnosticable {
|
||||
this.urlAttachmentTitleStyle,
|
||||
this.urlAttachmentTextStyle,
|
||||
this.urlAttachmentTitleMaxLine,
|
||||
this.urlAttachmentTextMaxLine,
|
||||
}) : urlAttachmentBackgroundColor =
|
||||
urlAttachmentBackgroundColor ?? linkBackgroundColor;
|
||||
|
||||
@@ -82,6 +83,9 @@ class StreamMessageThemeData with Diagnosticable {
|
||||
/// Max number of lines in Url link title.
|
||||
final int? urlAttachmentTitleMaxLine;
|
||||
|
||||
/// Max number of lines in Url link text.
|
||||
final int? urlAttachmentTextMaxLine;
|
||||
|
||||
/// Copy with a theme
|
||||
StreamMessageThemeData copyWith({
|
||||
TextStyle? messageTextStyle,
|
||||
@@ -102,6 +106,7 @@ class StreamMessageThemeData with Diagnosticable {
|
||||
TextStyle? urlAttachmentTitleStyle,
|
||||
TextStyle? urlAttachmentTextStyle,
|
||||
int? urlAttachmentTitleMaxLine,
|
||||
int? urlAttachmentTextMaxLine,
|
||||
}) {
|
||||
return StreamMessageThemeData(
|
||||
messageTextStyle: messageTextStyle ?? this.messageTextStyle,
|
||||
@@ -128,6 +133,8 @@ class StreamMessageThemeData with Diagnosticable {
|
||||
urlAttachmentTextStyle ?? this.urlAttachmentTextStyle,
|
||||
urlAttachmentTitleMaxLine:
|
||||
urlAttachmentTitleMaxLine ?? this.urlAttachmentTitleMaxLine,
|
||||
urlAttachmentTextMaxLine:
|
||||
urlAttachmentTextMaxLine ?? this.urlAttachmentTextMaxLine,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -178,6 +185,14 @@ class StreamMessageThemeData with Diagnosticable {
|
||||
b.urlAttachmentTitleStyle,
|
||||
t,
|
||||
),
|
||||
urlAttachmentTitleMaxLine: IntTween(
|
||||
begin: a.urlAttachmentTitleMaxLine,
|
||||
end: b.urlAttachmentTitleMaxLine,
|
||||
).lerp(t),
|
||||
urlAttachmentTextMaxLine: IntTween(
|
||||
begin: a.urlAttachmentTextMaxLine,
|
||||
end: b.urlAttachmentTextMaxLine,
|
||||
).lerp(t),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -206,6 +221,7 @@ class StreamMessageThemeData with Diagnosticable {
|
||||
urlAttachmentTitleStyle: other.urlAttachmentTitleStyle,
|
||||
urlAttachmentTextStyle: other.urlAttachmentTextStyle,
|
||||
urlAttachmentTitleMaxLine: other.urlAttachmentTitleMaxLine,
|
||||
urlAttachmentTextMaxLine: other.urlAttachmentTextMaxLine,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -229,7 +245,8 @@ class StreamMessageThemeData with Diagnosticable {
|
||||
urlAttachmentHostStyle == other.urlAttachmentHostStyle &&
|
||||
urlAttachmentTitleStyle == other.urlAttachmentTitleStyle &&
|
||||
urlAttachmentTextStyle == other.urlAttachmentTextStyle &&
|
||||
urlAttachmentTitleMaxLine == other.urlAttachmentTitleMaxLine;
|
||||
urlAttachmentTitleMaxLine == other.urlAttachmentTitleMaxLine &&
|
||||
urlAttachmentTextMaxLine == other.urlAttachmentTextMaxLine;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
@@ -248,7 +265,8 @@ class StreamMessageThemeData with Diagnosticable {
|
||||
urlAttachmentHostStyle.hashCode ^
|
||||
urlAttachmentTitleStyle.hashCode ^
|
||||
urlAttachmentTextStyle.hashCode ^
|
||||
urlAttachmentTitleMaxLine.hashCode;
|
||||
urlAttachmentTitleMaxLine.hashCode ^
|
||||
urlAttachmentTextMaxLine.hashCode;
|
||||
|
||||
@override
|
||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||
@@ -284,6 +302,10 @@ class StreamMessageThemeData with Diagnosticable {
|
||||
..add(DiagnosticsProperty(
|
||||
'urlAttachmentTitleMaxLine',
|
||||
urlAttachmentTitleMaxLine,
|
||||
))
|
||||
..add(DiagnosticsProperty(
|
||||
'urlAttachmentTextMaxLine',
|
||||
urlAttachmentTextMaxLine,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user