Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

lint

AmanRajSinghMourya17f6350a3a3d
diff --git a/mobile/packages/ente_components/lib/components/app_bar_component.dart b/mobile/packages/ente_components/lib/components/app_bar_component.dart
index 7c5d50b7a4..466c6ada8e 100644
--- a/mobile/packages/ente_components/lib/components/app_bar_component.dart
+++ b/mobile/packages/ente_components/lib/components/app_bar_component.dart
@@ -476,7 +476,9 @@ class _HeaderAppBarDelegate extends SliverPersistentHeaderDelegate {
);
final expandedTextBlockHeight =
expandedTitleHeight +
- (subtitle == null ? 0 : _subtitleGap + subtitleLineHeight);
+ (subtitle == null
+ ? 0
+ : _subtitleGap + subtitleLineHeight * _subtitleMaxLines);
final leadingTop =
_expandedContentTop +
_centerOffset(expandedTextBlockHeight, _headerControlSize);
@@ -564,7 +566,7 @@ class _HeaderAppBarDelegate extends SliverPersistentHeaderDelegate {
opacity: 1 - titleProgress,
child: Text(
subtitle!,
- maxLines: 1,
+ maxLines: _subtitleMaxLines,
overflow: TextOverflow.ellipsis,
style: TextStyles.mini.copyWith(
color: colors.textLight,
@@ -759,6 +761,7 @@ const _subtitleExpandedHeight = 110.0;
const _expandedContentTop = 48.0;
const _expandedContentBottomGap = Spacing.lg;
const _subtitleGap = 2.0;
+const _subtitleMaxLines = 2;
const _headerSnapTolerance = 1.0;
const _headerSnapDuration = Duration(milliseconds: 160);
const _titleTooltipShowDuration = Duration(seconds: 3);
@@ -810,6 +813,9 @@ _HeaderAppBarMetrics _resolveHeaderAppBarMetrics(
TextStyles.display3,
);
final subtitleLineHeight = _scaledLineHeight(textScaler, TextStyles.mini);
+ final subtitleHeight = subtitle == null
+ ? 0.0
+ : subtitleLineHeight * _subtitleMaxLines;
final defaultExpandedHeight = subtitle == null
? _titleOnlyExpandedHeight
: _subtitleExpandedHeight;
@@ -822,7 +828,7 @@ _HeaderAppBarMetrics _resolveHeaderAppBarMetrics(
);
final expandedTextBlockHeight =
expandedTitleLineHeight +
- (subtitle == null ? 0 : _subtitleGap + subtitleLineHeight);
+ (subtitle == null ? 0 : _subtitleGap + subtitleHeight);
final effectiveExpandedHeight = _maxDouble(
expandedHeight ?? defaultExpandedHeight,
_expandedContentTop +