mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-11 06:08:04 -06:00
feat: More resturcturings, adapt code to previous changes
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/core/database/tables/local_user_account.dart';
|
||||
import 'package:paperless_mobile/core/repository/user_repository.dart';
|
||||
|
||||
class UserAvatar extends StatelessWidget {
|
||||
final String userId;
|
||||
@@ -16,7 +19,7 @@ class UserAvatar extends StatelessWidget {
|
||||
final backgroundColor = Colors.primaries[userId.hashCode % Colors.primaries.length];
|
||||
final foregroundColor = backgroundColor.computeLuminance() > 0.5 ? Colors.black : Colors.white;
|
||||
return CircleAvatar(
|
||||
child: Text((account.fullName ?? account.username)
|
||||
child: Text((account.paperlessUser.fullName ?? account.paperlessUser.username)
|
||||
.split(" ")
|
||||
.take(2)
|
||||
.map((e) => e.substring(0, 1))
|
||||
|
||||
Reference in New Issue
Block a user