forked from Nexus/nexus
Remove flutter chat (#26)
Had to squash merge manually as Forgejo was erroring
This commit is contained in:
parent
bd1d5ea745
commit
16cf126df4
111 changed files with 3162 additions and 2366 deletions
|
|
@ -2,8 +2,10 @@ import "package:color_hash/color_hash.dart";
|
|||
import "package:cross_cache/cross_cache.dart";
|
||||
import "package:flutter/material.dart";
|
||||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||
import "package:nexus/controllers/client_state_controller.dart";
|
||||
import "package:nexus/controllers/cross_cache_controller.dart";
|
||||
import "package:nexus/helpers/extensions/get_headers.dart";
|
||||
import "package:nexus/helpers/extensions/mxc_to_https.dart";
|
||||
|
||||
class AvatarOrHash extends ConsumerWidget {
|
||||
final Uri? avatar;
|
||||
|
|
@ -28,6 +30,14 @@ class AvatarOrHash extends ConsumerWidget {
|
|||
color: ColorHash(title).color,
|
||||
child: Center(child: Text(title.isEmpty ? "" : title[0])),
|
||||
);
|
||||
final parsedAvatar = avatar?.mxcToHttps(
|
||||
ref.watch(
|
||||
ClientStateController.provider.select(
|
||||
(value) => value?.homeserverUrl,
|
||||
),
|
||||
) ??
|
||||
"",
|
||||
);
|
||||
return SizedBox(
|
||||
width: height,
|
||||
height: height,
|
||||
|
|
@ -42,11 +52,11 @@ class AvatarOrHash extends ConsumerWidget {
|
|||
child: SizedBox(
|
||||
width: height,
|
||||
height: height,
|
||||
child: avatar == null
|
||||
child: parsedAvatar == null
|
||||
? fallback ?? box
|
||||
: Image(
|
||||
image: CachedNetworkImage(
|
||||
avatar.toString(),
|
||||
parsedAvatar.toString(),
|
||||
ref.watch(CrossCacheController.provider),
|
||||
headers: ref.headers,
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue