Skip to content

armgit / ente

Public Imported from GitHub
0

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

update user avatar widget

AmanRajSinghMouryaf709d9d73d7d
diff --git a/mobile/apps/photos/lib/emergency/emergency_page.dart b/mobile/apps/photos/lib/emergency/emergency_page.dart
index b03531e487..ecbbd5954d 100644
--- a/mobile/apps/photos/lib/emergency/emergency_page.dart
+++ b/mobile/apps/photos/lib/emergency/emergency_page.dart
@@ -127,7 +127,7 @@ class _EmergencyPageState extends State<EmergencyPage> {
leadingIconSize: 24,
leadingIconWidget: UserAvatarWidget(
emergencyUser,
- type: AvatarType.md,
+ type: AvatarType.medium,
currentUserID: currentUserID,
),
menuItemColor: colorScheme.fillFaint,
@@ -178,7 +178,7 @@ class _EmergencyPageState extends State<EmergencyPage> {
leadingIconSize: 24,
leadingIconWidget: UserAvatarWidget(
emergencyUser,
- type: AvatarType.md,
+ type: AvatarType.medium,
currentUserID: currentUserID,
),
menuItemColor: colorScheme.fillFaint,
@@ -288,7 +288,7 @@ class _EmergencyPageState extends State<EmergencyPage> {
leadingIconSize: 24,
leadingIconWidget: UserAvatarWidget(
emergencyUser,
- type: AvatarType.md,
+ type: AvatarType.medium,
currentUserID: currentUserID,
),
menuItemColor: colorScheme.fillFaint,
diff --git a/mobile/apps/photos/lib/emergency/select_contact_page.dart b/mobile/apps/photos/lib/emergency/select_contact_page.dart
index 701702b104..8a9a6f13ed 100644
--- a/mobile/apps/photos/lib/emergency/select_contact_page.dart
+++ b/mobile/apps/photos/lib/emergency/select_contact_page.dart
@@ -129,7 +129,7 @@ class _AddContactSheetState extends State<AddContactSheet> {
titleColor: colorScheme.textMuted,
leadingIconWidget: UserAvatarWidget(
user,
- type: AvatarType.md,
+ type: AvatarType.medium,
currentUserID: Configuration.instance.getUserID()!,
),
leadingIconSize: 24,
diff --git a/mobile/apps/photos/lib/services/memories_cache_service.dart b/mobile/apps/photos/lib/services/memories_cache_service.dart
index 263e3494a9..6c98cb0da6 100644
--- a/mobile/apps/photos/lib/services/memories_cache_service.dart
+++ b/mobile/apps/photos/lib/services/memories_cache_service.dart
@@ -741,8 +741,7 @@ class MemoriesCacheService {
if (tripInsertIdx < 0) {
tripInsertIdx = nowEntries.indexWhere(
(e) =>
- e.type != MemoryType.onThisDay &&
- e.type != MemoryType.people,
+ e.type != MemoryType.onThisDay && e.type != MemoryType.people,
);
if (tripInsertIdx < 0) {
tripInsertIdx = nowEntries.length;
diff --git a/mobile/apps/photos/lib/ui/collections/album/column_item.dart b/mobile/apps/photos/lib/ui/collections/album/column_item.dart
index 452ad6c2c6..3848414767 100644
--- a/mobile/apps/photos/lib/ui/collections/album/column_item.dart
+++ b/mobile/apps/photos/lib/ui/collections/album/column_item.dart
@@ -86,7 +86,7 @@ class AlbumColumnItemWidget extends StatelessWidget {
top: 4,
child: UserAvatarWidget(
collection.owner,
- type: AvatarType.sm,
+ type: AvatarType.small,
thumbnailView: true,
),
),
diff --git a/mobile/apps/photos/lib/ui/sharing/add_participant_page.dart b/mobile/apps/photos/lib/ui/sharing/add_participant_page.dart
index 6487a83d78..c6193ccca3 100644
--- a/mobile/apps/photos/lib/ui/sharing/add_participant_page.dart
+++ b/mobile/apps/photos/lib/ui/sharing/add_participant_page.dart
@@ -171,7 +171,7 @@ class _AddParticipantPage extends State<AddParticipantPage> {
leadingIconSize: 24.0,
leadingIconWidget: UserAvatarWidget(
currentUser,
- type: AvatarType.md,
+ type: AvatarType.medium,
),
menuItemColor:
getEnteColorScheme(context).fillFaint,
diff --git a/mobile/apps/photos/lib/ui/sharing/album_participants_page.dart b/mobile/apps/photos/lib/ui/sharing/album_participants_page.dart
index 08e74e6cf8..4c2179efd7 100644
--- a/mobile/apps/photos/lib/ui/sharing/album_participants_page.dart
+++ b/mobile/apps/photos/lib/ui/sharing/album_participants_page.dart
@@ -218,7 +218,7 @@ class _AlbumParticipantsPageState extends State<AlbumParticipantsPage> {
leadingIconSize: 24.0,
leadingIconWidget: UserAvatarWidget(
currentUser,
- type: AvatarType.md,
+ type: AvatarType.medium,
currentUserID: currentUserID,
),
menuItemColor: colorScheme.fillFaint,
@@ -301,7 +301,7 @@ class _AlbumParticipantsPageState extends State<AlbumParticipantsPage> {
leadingIconSize: 24.0,
leadingIconWidget: UserAvatarWidget(
currentUser,
- type: AvatarType.md,
+ type: AvatarType.medium,
currentUserID: currentUserID,
),
menuItemColor: colorScheme.fillFaint,
@@ -382,7 +382,7 @@ class _AlbumParticipantsPageState extends State<AlbumParticipantsPage> {
leadingIconSize: 24.0,
leadingIconWidget: UserAvatarWidget(
currentUser,
- type: AvatarType.md,
+ type: AvatarType.medium,
currentUserID: currentUserID,
),
menuItemColor: colorScheme.fillFaint,
diff --git a/mobile/apps/photos/lib/ui/sharing/album_share_info_widget.dart b/mobile/apps/photos/lib/ui/sharing/album_share_info_widget.dart
index 2835586918..8bdadf0213 100644
--- a/mobile/apps/photos/lib/ui/sharing/album_share_info_widget.dart
+++ b/mobile/apps/photos/lib/ui/sharing/album_share_info_widget.dart
@@ -17,7 +17,7 @@ class AlbumSharesIcons extends StatelessWidget {
const AlbumSharesIcons({
super.key,
required this.sharees,
- this.type = AvatarType.sm,
+ this.type = AvatarType.small,
this.limitCountTo = 2,
this.removeBorder = true,
this.trailingWidget,
@@ -77,30 +77,26 @@ class AlbumSharesIcons extends StatelessWidget {
double getOverlapPadding(AvatarType type) {
switch (type) {
- case AvatarType.xs:
- return 14.0;
- case AvatarType.sm:
- return 14.0;
- case AvatarType.md:
- return 20.0;
- case AvatarType.lg:
+ case AvatarType.small:
+ return 12.0;
+ case AvatarType.medium:
+ return 18.0;
+ case AvatarType.large:
return 24.0;
- case AvatarType.xl:
- return 28.0;
+ case AvatarType.huge:
+ return 42.0;
}
}
MoreCountType moreCountTypeFromAvatarType(AvatarType type) {
switch (type) {
- case AvatarType.xs:
- return MoreCountType.xs;
- case AvatarType.sm:
- return MoreCountType.sm;
- case AvatarType.md:
- return MoreCountType.md;
- case AvatarType.lg:
- return MoreCountType.lg;
- case AvatarType.xl:
- return MoreCountType.xl;
+ case AvatarType.small:
+ return MoreCountType.small;
+ case AvatarType.medium:
+ return MoreCountType.medium;
+ case AvatarType.large:
+ return MoreCountType.large;
+ case AvatarType.huge:
+ return MoreCountType.huge;
}
}
diff --git a/mobile/apps/photos/lib/ui/sharing/more_count_badge.dart b/mobile/apps/photos/lib/ui/sharing/more_count_badge.dart
index c98f5f8fe7..00be717aac 100644
--- a/mobile/apps/photos/lib/ui/sharing/more_count_badge.dart
+++ b/mobile/apps/photos/lib/ui/sharing/more_count_badge.dart
@@ -3,7 +3,7 @@ import 'package:photos/theme/colors.dart';
import 'package:photos/theme/ente_theme.dart';
import 'package:tuple/tuple.dart';
-enum MoreCountType { xl, lg, md, sm, xs }
+enum MoreCountType { small, medium, large, huge }
class MoreCountWidget extends StatelessWidget {
final MoreCountType type;
@@ -13,7 +13,7 @@ class MoreCountWidget extends StatelessWidget {
const MoreCountWidget(
this.count, {
super.key,
- this.type = MoreCountType.md,
+ this.type = MoreCountType.medium,
this.thumbnailView = false,
});
@@ -66,16 +66,14 @@ class MoreCountWidget extends StatelessWidget {
) {
final enteTextTheme = getEnteTextTheme(context);
switch (type) {
- case MoreCountType.xl:
- return Tuple2(32.0, enteTextTheme.small);
- case MoreCountType.lg:
- return Tuple2(28.0, enteTextTheme.mini);
- case MoreCountType.md:
+ case MoreCountType.huge:
+ return Tuple2(56.0, enteTextTheme.largeBold);
+ case MoreCountType.large:
+ return Tuple2(32.0, enteTextTheme.mini);
+ case MoreCountType.medium:
return Tuple2(24.0, enteTextTheme.mini);
- case MoreCountType.sm:
- return Tuple2(18.0, enteTextTheme.tiny);
- case MoreCountType.xs:
- return Tuple2(18.0, enteTextTheme.tiny);
+ case MoreCountType.small:
+ return Tuple2(16.0, enteTextTheme.tiny);
}
}
}
diff --git a/mobile/apps/photos/lib/ui/sharing/share_collection_page.dart b/mobile/apps/photos/lib/ui/sharing/share_collection_page.dart
index a7444477ec..24cf031728 100644
--- a/mobile/apps/photos/lib/ui/sharing/share_collection_page.dart
+++ b/mobile/apps/photos/lib/ui/sharing/share_collection_page.dart
@@ -396,7 +396,7 @@ class EmailItemWidget extends StatelessWidget {
sharees: collection.getSharees(),
padding: const EdgeInsets.all(0),
limitCountTo: 10,
- type: AvatarType.md,
+ type: AvatarType.medium,
removeBorder: false,
),
),
diff --git a/mobile/apps/photos/lib/ui/sharing/user_avator_widget.dart b/mobile/apps/photos/lib/ui/sharing/user_avator_widget.dart
index 30bb3fe070..e35f287b4f 100644
--- a/mobile/apps/photos/lib/ui/sharing/user_avator_widget.dart
+++ b/mobile/apps/photos/lib/ui/sharing/user_avator_widget.dart
@@ -11,12 +11,11 @@ import "package:photos/models/api/collection/user.dart";
import "package:photos/services/contacts/contact_identity_resolver.dart";
import "package:photos/services/machine_learning/face_ml/person/person_service.dart";
import "package:photos/services/photos_contacts_service.dart";
-import "package:photos/theme/colors.dart";
import 'package:photos/theme/ente_theme.dart';
import "package:photos/ui/viewer/people/person_face_widget.dart";
import 'package:tuple/tuple.dart';
-enum AvatarType { xl, lg, md, sm, xs }
+enum AvatarType { small, medium, large, huge }
class UserAvatarWidget extends StatefulWidget {
final User user;
@@ -29,7 +28,7 @@ class UserAvatarWidget extends StatefulWidget {
this.user, {
super.key,
this.currentUserID = -1,
- this.type = AvatarType.md,
+ this.type = AvatarType.medium,
this.thumbnailView = false,
this.addStroke = true,
});
@@ -135,75 +134,43 @@ class _UserAvatarWidgetState extends State<UserAvatarWidget> {
final int cachedPixelWidth =
(size * MediaQuery.devicePixelRatioOf(context)).toInt();
if (_contactPhotoBytes != null) {
- return Container(
- padding: widget.addStroke ? const EdgeInsets.all(0.5) : EdgeInsets.zero,
- decoration: widget.addStroke
- ? BoxDecoration(
- shape: BoxShape.circle,
- border: Border.all(
- color: widget.thumbnailView
- ? strokeMutedDark
- : getEnteColorScheme(context).strokeMuted,
- width: UserAvatarWidget.strokeWidth,
- strokeAlign: BorderSide.strokeAlignOutside,
- ),
- )
- : null,
- child: SizedBox(
- height: size,
- width: size,
- child: ClipOval(
- child: Image.memory(
- _contactPhotoBytes!,
- fit: BoxFit.cover,
- gaplessPlayback: true,
- ),
+ return SizedBox(
+ height: size,
+ width: size,
+ child: ClipOval(
+ child: Image.memory(
+ _contactPhotoBytes!,
+ fit: BoxFit.cover,
+ gaplessPlayback: true,
),
),
);
}
return _personId != null
- ? Container(
- padding:
- widget.addStroke ? const EdgeInsets.all(0.5) : EdgeInsets.zero,
- decoration: widget.addStroke
- ? BoxDecoration(
- shape: BoxShape.circle,
- border: Border.all(
- color: widget.thumbnailView
- ? strokeMutedDark
- : getEnteColorScheme(context).strokeMuted,
- width: UserAvatarWidget.strokeWidth,
- strokeAlign: BorderSide.strokeAlignOutside,
+ ? SizedBox(
+ height: size,
+ width: size,
+ child: ClipOval(
+ child: _canUsePersonFaceWidget
+ ? PersonFaceWidget(
+ key: ValueKey('$_personId-$lastSyncTimeForKey'),
+ personId: _personId!,
+ cachedPixelWidth: cachedPixelWidth,
+ onErrorCallback: () {
+ if (mounted) {
+ setState(() {
+ _personId = null;
+ _canUsePersonFaceWidget = false;
+ });
+ }
+ },
+ )
+ : _FirstLetterCircularAvatar(
+ user: widget.user,
+ currentUserID: widget.currentUserID,
+ thumbnailView: widget.thumbnailView,
+ type: widget.type,
),
- )
- : null,
- child: SizedBox(
- height: size,
- width: size,
- child: ClipOval(
- child: _canUsePersonFaceWidget
- ? PersonFaceWidget(
- key: ValueKey('$_personId-$lastSyncTimeForKey'),
- personId: _personId!,
- cachedPixelWidth: cachedPixelWidth,
- onErrorCallback: () {
- if (mounted) {
- setState(() {
- _personId = null;
- _canUsePersonFaceWidget = false;
- });
- }
- },
- )
- : _FirstLetterCircularAvatar(
- user: widget.user,
- currentUserID: widget.currentUserID,
- thumbnailView: widget.thumbnailView,
- type: widget.type,
- addStroke: widget.addStroke,
- ),
- ),
),
)
: _FirstLetterCircularAvatar(
@@ -211,7 +178,6 @@ class _UserAvatarWidgetState extends State<UserAvatarWidget> {
currentUserID: widget.currentUserID,
thumbnailView: widget.thumbnailView,
type: widget.type,
- addStroke: widget.addStroke,
);
}
}
@@ -221,13 +187,11 @@ class _FirstLetterCircularAvatar extends StatefulWidget {
final int currentUserID;
final bool thumbnailView;
final AvatarType type;
- final bool addStroke;
const _FirstLetterCircularAvatar({
required this.user,
required this.currentUserID,
required this.thumbnailView,
required this.type,
- required this.addStroke,
});
@override
@@ -260,30 +224,15 @@ class _FirstLetterCircularAvatarState
final avatarStyle = getAvatarStyle(context, widget.type);
final double size = avatarStyle.item1;
final TextStyle textStyle = avatarStyle.item2;
- return Container(
- padding: widget.addStroke ? const EdgeInsets.all(0.5) : EdgeInsets.zero,
- decoration: widget.addStroke
- ? BoxDecoration(
- shape: BoxShape.circle,
- border: Border.all(
- color: widget.thumbnailView
- ? strokeMutedDark
- : getEnteColorScheme(context).strokeMuted,
- width: UserAvatarWidget.strokeWidth,
- strokeAlign: BorderSide.strokeAlignOutside,
- ),
- )
- : null,
- child: SizedBox(
- height: size,
- width: size,
- child: CircleAvatar(
- backgroundColor: decorationColor,
- child: Text(
- displayChar.toUpperCase(),
- // fixed color
- style: textStyle.copyWith(color: Colors.white),
- ),
+ return SizedBox(
+ height: size,
+ width: size,
+ child: CircleAvatar(
+ backgroundColor: decorationColor,
+ child: Text(
+ displayChar.toUpperCase(),
+ // fixed color
+ style: textStyle.copyWith(color: Colors.white),
),
),
);
@@ -295,16 +244,14 @@ class _FirstLetterCircularAvatarState
) {
final enteTextTheme = getEnteTextTheme(context);
switch (type) {
- case AvatarType.xl:
- return Tuple2(32.0, enteTextTheme.small);
- case AvatarType.lg:
- return Tuple2(28.0, enteTextTheme.mini);
- case AvatarType.md:
+ case AvatarType.huge:
+ return Tuple2(56.0, enteTextTheme.largeBold);
+ case AvatarType.large:
+ return Tuple2(32.0, enteTextTheme.mini);
+ case AvatarType.medium:
return Tuple2(24.0, enteTextTheme.mini);
- case AvatarType.sm:
- return Tuple2(18.0, enteTextTheme.tiny);
- case AvatarType.xs:
- return Tuple2(18.0, enteTextTheme.tiny);
+ case AvatarType.small:
+ return Tuple2(16.0, enteTextTheme.tiny);
}
}
}
@@ -313,16 +260,14 @@ double getAvatarSize(
AvatarType type,
) {
switch (type) {
- case AvatarType.xl:
+ case AvatarType.huge:
+ return 56.0;
+ case AvatarType.large:
return 32.0;
- case AvatarType.lg:
- return 28.0;
- case AvatarType.md:
+ case AvatarType.medium:
return 24.0;
- case AvatarType.sm:
- return 18.0;
- case AvatarType.xs:
- return 18.0;
+ case AvatarType.small:
+ return 16.0;
}
}
diff --git a/mobile/apps/photos/lib/ui/social/comment_likes_bottom_sheet.dart b/mobile/apps/photos/lib/ui/social/comment_likes_bottom_sheet.dart
index 5e28905a4a..4004d8ccd9 100644
--- a/mobile/apps/photos/lib/ui/social/comment_likes_bottom_sheet.dart
+++ b/mobile/apps/photos/lib/ui/social/comment_likes_bottom_sheet.dart
@@ -210,7 +210,7 @@ class _CommentLikeListItem extends StatelessWidget {
UserAvatarWidget(
user,
currentUserID: currentUserID,
- type: AvatarType.lg,
+ type: AvatarType.large,
addStroke: false,
),
const SizedBox(width: 12),
diff --git a/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart b/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart
index 8ee62ec66a..6f459d3786 100644
--- a/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart
+++ b/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart
@@ -443,7 +443,7 @@ class _LikeListItem extends StatelessWidget {
UserAvatarWidget(
user,
currentUserID: currentUserID,
- type: AvatarType.lg,
+ type: AvatarType.large,
addStroke: false,
),
const SizedBox(width: 12),
diff --git a/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart b/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart
index 54d0ed937a..14c9141e0e 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart
@@ -897,7 +897,7 @@ class _Header extends StatelessWidget {
UserAvatarWidget(
user,
currentUserID: currentUserID,
- type: AvatarType.lg,
+ type: AvatarType.large,
thumbnailView: true,
addStroke: false,
),
@@ -909,7 +909,7 @@ class _Header extends StatelessWidget {
UserAvatarWidget(
user,
currentUserID: currentUserID,
- type: AvatarType.lg,
+ type: AvatarType.large,
thumbnailView: true,
addStroke: false,
),
diff --git a/mobile/apps/photos/lib/ui/social/widgets/feed_item_widget.dart b/mobile/apps/photos/lib/ui/social/widgets/feed_item_widget.dart
index 52700e3b80..1b94422dc1 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/feed_item_widget.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/feed_item_widget.dart
@@ -388,51 +388,51 @@ class _StackedAvatars extends StatelessWidget {
// Stacked avatars with overlap
return _wrapActorTap(
SizedBox(
- width: 28 + 21, // First avatar + second avatar offset
- height: 28,
- child: Stack(
- clipBehavior: Clip.none,
- children: [
- // First (front) avatar
- Positioned(
- left: 0,
- child: Container(
- decoration: BoxDecoration(
- shape: BoxShape.circle,
- border: Border.all(
- color: colorScheme.backgroundBase,
- width: 1.167,
+ width: 28 + 21, // First avatar + second avatar offset
+ height: 28,
+ child: Stack(
+ clipBehavior: Clip.none,
+ children: [
+ // First (front) avatar
+ Positioned(
+ left: 0,
+ child: Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ border: Border.all(
+ color: colorScheme.backgroundBase,
+ width: 1.167,
+ ),
+ ),
+ child: UserAvatarWidget(
+ actors.first,
+ type: AvatarType.large,
+ currentUserID: currentUserID,
+ addStroke: false,
),
- ),
- child: UserAvatarWidget(
- actors.first,
- type: AvatarType.lg,
- currentUserID: currentUserID,
- addStroke: false,
),
),
- ),
- // Second (back) avatar
- Positioned(
- left: 21, // Overlap by 7px (28 - 21 = 7)
- child: Container(
- decoration: BoxDecoration(
- shape: BoxShape.circle,
- border: Border.all(
- color: colorScheme.backgroundBase,
- width: 1.167,
+ // Second (back) avatar
+ Positioned(
+ left: 21, // Overlap by 7px (28 - 21 = 7)
+ child: Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ border: Border.all(
+ color: colorScheme.backgroundBase,
+ width: 1.167,
+ ),
+ ),
+ child: UserAvatarWidget(
+ actors[1],
+ type: AvatarType.large,
+ currentUserID: currentUserID,
+ addStroke: false,
),
- ),
- child: UserAvatarWidget(
- actors[1],
- type: AvatarType.lg,
- currentUserID: currentUserID,
- addStroke: false,
),
),
- ),
- ],
- ),
+ ],
+ ),
),
actors.first,
);
@@ -449,7 +449,7 @@ class _StackedAvatars extends StatelessWidget {
),
child: UserAvatarWidget(
user,
- type: AvatarType.lg,
+ type: AvatarType.large,
currentUserID: currentUserID,
addStroke: false,
),
diff --git a/mobile/apps/photos/lib/ui/social/widgets/feed_preview_item_widget.dart b/mobile/apps/photos/lib/ui/social/widgets/feed_preview_item_widget.dart
index 0e8726be8e..bec1c7b042 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/feed_preview_item_widget.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/feed_preview_item_widget.dart
@@ -145,7 +145,7 @@ class _PreviewAvatarStack extends StatelessWidget {
child: ClipOval(
child: UserAvatarWidget(
user,
- type: AvatarType.xl,
+ type: AvatarType.large,
currentUserID: currentUserID,
addStroke: false,
),
diff --git a/mobile/apps/photos/lib/ui/viewer/file/qr_code_highlight_overlay.dart b/mobile/apps/photos/lib/ui/viewer/file/qr_code_highlight_overlay.dart
index 2e1298312c..0b4fab2503 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/qr_code_highlight_overlay.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/qr_code_highlight_overlay.dart
@@ -21,46 +21,46 @@ class QrCodeHighlightOverlay extends StatelessWidget {
}
return LayoutBuilder(
- builder: (context, constraints) {
- final screenWidth = constraints.maxWidth;
- final screenHeight = constraints.maxHeight;
+ builder: (context, constraints) {
+ final screenWidth = constraints.maxWidth;
+ final screenHeight = constraints.maxHeight;
- double displayWidth;
- double displayHeight;
- if (file.hasDimensions) {
- final imageAspect = file.width / file.height;
- final screenAspect = screenWidth / screenHeight;
- if (imageAspect > screenAspect) {
- displayWidth = screenWidth;
- displayHeight = screenWidth / imageAspect;
- } else {
- displayHeight = screenHeight;
- displayWidth = screenHeight * imageAspect;
- }
- } else {
- displayWidth = screenWidth;
- displayHeight = screenHeight;
- }
+ double displayWidth;
+ double displayHeight;
+ if (file.hasDimensions) {
+ final imageAspect = file.width / file.height;
+ final screenAspect = screenWidth / screenHeight;
+ if (imageAspect > screenAspect) {
+ displayWidth = screenWidth;
+ displayHeight = screenWidth / imageAspect;
+ } else {
+ displayHeight = screenHeight;
+ displayWidth = screenHeight * imageAspect;
+ }
+ } else {
+ displayWidth = screenWidth;
+ displayHeight = screenHeight;
+ }
- final offsetX = (screenWidth - displayWidth) / 2;
- final offsetY = (screenHeight - displayHeight) / 2;
+ final offsetX = (screenWidth - displayWidth) / 2;
+ final offsetY = (screenHeight - displayHeight) / 2;
- return SizedBox.expand(
- child: Stack(
- children: [
- for (final detection in detections)
- _QrTapRegion(
- detection: detection,
- offsetX: offsetX,
- offsetY: offsetY,
- displayWidth: displayWidth,
- displayHeight: displayHeight,
- ),
- ],
- ),
- );
- },
+ return SizedBox.expand(
+ child: Stack(
+ children: [
+ for (final detection in detections)
+ _QrTapRegion(
+ detection: detection,
+ offsetX: offsetX,
+ offsetY: offsetY,
+ displayWidth: displayWidth,
+ displayHeight: displayHeight,
+ ),
+ ],
+ ),
);
+ },
+ );
}
}
diff --git a/mobile/apps/photos/lib/ui/viewer/people/link_email_screen.dart b/mobile/apps/photos/lib/ui/viewer/people/link_email_screen.dart
index bca8a4d78c..8e8cc89bd2 100644
--- a/mobile/apps/photos/lib/ui/viewer/people/link_email_screen.dart
+++ b/mobile/apps/photos/lib/ui/viewer/people/link_email_screen.dart
@@ -145,7 +145,7 @@ class _LinkEmailScreen extends State<LinkEmailScreen> {
leadingIconSize: 24.0,
leadingIconWidget: UserAvatarWidget(
currentUser,
- type: AvatarType.md,
+ type: AvatarType.medium,
),
menuItemColor:
getEnteColorScheme(context).fillFaint,
diff --git a/mobile/apps/photos/lib/ui/viewer/people/save_or_edit_person.dart b/mobile/apps/photos/lib/ui/viewer/people/save_or_edit_person.dart
index e8fd12c65c..8e2ea8b720 100644
--- a/mobile/apps/photos/lib/ui/viewer/people/save_or_edit_person.dart
+++ b/mobile/apps/photos/lib/ui/viewer/people/save_or_edit_person.dart
@@ -1056,8 +1056,8 @@ class _EmailSectionState extends State<_EmailSection> {
@override
Widget build(BuildContext context) {
const limitCountTo = 5;
- final avatarSize = getAvatarSize(AvatarType.xl);
- final overlapPadding = getOverlapPadding(AvatarType.xl);
+ final avatarSize = getAvatarSize(AvatarType.large);
+ final overlapPadding = getOverlapPadding(AvatarType.large);
if (_email == null || _email!.isEmpty) {
return AnimatedSize(
duration: const Duration(milliseconds: 200),
@@ -1085,7 +1085,7 @@ class _EmailSectionState extends State<_EmailSection> {
child: AlbumSharesIcons(
sharees: _contacts,
limitCountTo: limitCountTo,
- type: AvatarType.xl,
+ type: AvatarType.large,
padding: EdgeInsets.zero,
stackAlignment: Alignment.center,
),