refactor: Calc avatar font size by avatar size
This commit is contained in:
parent
f2d42936ad
commit
bd5dc8405d
9 changed files with 1 additions and 12 deletions
|
|
@ -42,7 +42,6 @@ class SeenByRow extends StatelessWidget {
|
||||||
mxContent: user.avatarUrl,
|
mxContent: user.avatarUrl,
|
||||||
name: user.calcDisplayname(),
|
name: user.calcDisplayname(),
|
||||||
size: 16,
|
size: 16,
|
||||||
fontSize: 9,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (seenByUsers.length > maxAvatars)
|
if (seenByUsers.length > maxAvatars)
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,6 @@ class ChatDetailsView extends StatelessWidget {
|
||||||
mxContent: room.avatar,
|
mxContent: room.avatar,
|
||||||
name: displayname,
|
name: displayname,
|
||||||
size: Avatar.defaultSize * 2.5,
|
size: Avatar.defaultSize * 2.5,
|
||||||
fontSize: 18 * 2.5,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,6 @@ class ChatListView extends StatelessWidget {
|
||||||
MatrixLocals(L10n.of(context)!),
|
MatrixLocals(L10n.of(context)!),
|
||||||
),
|
),
|
||||||
size: 32,
|
size: 32,
|
||||||
fontSize: 12,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,6 @@ class ClientChooserButton extends StatelessWidget {
|
||||||
name:
|
name:
|
||||||
snapshot.data?.displayName ?? client.userID!.localpart,
|
snapshot.data?.displayName ?? client.userID!.localpart,
|
||||||
size: 32,
|
size: 32,
|
||||||
fontSize: 12,
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
|
@ -216,7 +215,6 @@ class ClientChooserButton extends StatelessWidget {
|
||||||
name: snapshot.data?.displayName ??
|
name: snapshot.data?.displayName ??
|
||||||
matrix.client.userID!.localpart,
|
matrix.client.userID!.localpart,
|
||||||
size: 32,
|
size: 32,
|
||||||
fontSize: 12,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -461,7 +461,6 @@ class _SpaceViewState extends State<SpaceView> {
|
||||||
size: 24,
|
size: 24,
|
||||||
mxContent: spaceChild.avatarUrl,
|
mxContent: spaceChild.avatarUrl,
|
||||||
name: spaceChild.name,
|
name: spaceChild.name,
|
||||||
fontSize: 9,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
color: Theme.of(context)
|
color: Theme.of(context)
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,6 @@ class SettingsView extends StatelessWidget {
|
||||||
mxContent: profile?.avatarUrl,
|
mxContent: profile?.avatarUrl,
|
||||||
name: displayname,
|
name: displayname,
|
||||||
size: Avatar.defaultSize * 2.5,
|
size: Avatar.defaultSize * 2.5,
|
||||||
fontSize: 18 * 2.5,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (profile != null)
|
if (profile != null)
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,6 @@ class UserBottomSheetView extends StatelessWidget {
|
||||||
mxContent: avatarUrl,
|
mxContent: avatarUrl,
|
||||||
name: displayname,
|
name: displayname,
|
||||||
size: Avatar.defaultSize * 2.5,
|
size: Avatar.defaultSize * 2.5,
|
||||||
fontSize: 18 * 2.5,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ class Avatar extends StatelessWidget {
|
||||||
final void Function()? onTap;
|
final void Function()? onTap;
|
||||||
static const double defaultSize = 44;
|
static const double defaultSize = 44;
|
||||||
final Client? client;
|
final Client? client;
|
||||||
final double fontSize;
|
|
||||||
final String? presenceUserId;
|
final String? presenceUserId;
|
||||||
final Color? presenceBackgroundColor;
|
final Color? presenceBackgroundColor;
|
||||||
|
|
||||||
|
|
@ -23,7 +22,6 @@ class Avatar extends StatelessWidget {
|
||||||
this.size = defaultSize,
|
this.size = defaultSize,
|
||||||
this.onTap,
|
this.onTap,
|
||||||
this.client,
|
this.client,
|
||||||
this.fontSize = 18,
|
|
||||||
this.presenceUserId,
|
this.presenceUserId,
|
||||||
this.presenceBackgroundColor,
|
this.presenceBackgroundColor,
|
||||||
super.key,
|
super.key,
|
||||||
|
|
@ -48,7 +46,7 @@ class Avatar extends StatelessWidget {
|
||||||
fallbackLetters,
|
fallbackLetters,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: noPic ? Colors.white : null,
|
color: noPic ? Colors.white : null,
|
||||||
fontSize: fontSize,
|
fontSize: (size / 2.5).roundToDouble(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,6 @@ class PublicRoomBottomSheet extends StatelessWidget {
|
||||||
mxContent: profile.avatarUrl,
|
mxContent: profile.avatarUrl,
|
||||||
name: profile.name ?? roomAlias,
|
name: profile.name ?? roomAlias,
|
||||||
size: Avatar.defaultSize * 3,
|
size: Avatar.defaultSize * 3,
|
||||||
fontSize: 36,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue