mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-10 20:07:55 -06:00
feat: Add new translations, add list of existing accounts to login page
This commit is contained in:
@@ -2,18 +2,16 @@ import 'package:flutter/material.dart';
|
||||
import 'package:paperless_mobile/core/database/tables/local_user_account.dart';
|
||||
|
||||
class UserAvatar extends StatelessWidget {
|
||||
final String userId;
|
||||
final LocalUserAccount account;
|
||||
|
||||
const UserAvatar({
|
||||
super.key,
|
||||
required this.userId,
|
||||
required this.account,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final backgroundColor = Colors.primaries[userId.hashCode % Colors.primaries.length];
|
||||
final backgroundColor = Colors.primaries[account.id.hashCode % Colors.primaries.length];
|
||||
final foregroundColor = backgroundColor.computeLuminance() > 0.5 ? Colors.black : Colors.white;
|
||||
return CircleAvatar(
|
||||
child: Text((account.paperlessUser.fullName ?? account.paperlessUser.username)
|
||||
|
||||
Reference in New Issue
Block a user