mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-09 08:08:14 -06:00
feat: More resturcturings, adapt code to previous changes
This commit is contained in:
@@ -86,11 +86,11 @@ class ManageAccountsPage extends StatelessWidget {
|
||||
final child = SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: ListTile(
|
||||
title: Text(account.username),
|
||||
title: Text(account.paperlessUser.username),
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (account.fullName != null) Text(account.fullName!),
|
||||
if (account.paperlessUser.fullName != null) Text(account.paperlessUser.fullName!),
|
||||
Text(
|
||||
account.serverUrl.replaceFirst(RegExp(r'https://?'), ''),
|
||||
style: TextStyle(
|
||||
@@ -99,7 +99,7 @@ class ManageAccountsPage extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
isThreeLine: account.fullName != null,
|
||||
isThreeLine: account.paperlessUser.fullName != null,
|
||||
leading: UserAvatar(
|
||||
account: account,
|
||||
userId: userId,
|
||||
|
||||
@@ -22,7 +22,7 @@ class SettingsPage extends StatelessWidget {
|
||||
final host = user!.serverUrl.replaceFirst(RegExp(r"https?://"), "");
|
||||
return ListTile(
|
||||
title: Text(
|
||||
S.of(context)!.loggedInAs(user.username) + "@$host",
|
||||
S.of(context)!.loggedInAs(user.paperlessUser.username) + "@$host",
|
||||
style: Theme.of(context).textTheme.labelSmall,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
|
||||
@@ -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