Adds default avatars to spaces in find your people
This commit is contained in:
parent
622f96c29a
commit
8c4d6379b5
1 changed files with 27 additions and 8 deletions
|
|
@ -1,11 +1,15 @@
|
|||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/config/themes.dart';
|
||||
import 'package:fluffychat/l10n/l10n.dart';
|
||||
import 'package:fluffychat/pangea/analytics_summary/learning_progress_indicator_button.dart';
|
||||
import 'package:fluffychat/pangea/public_spaces/public_room_bottom_sheet.dart';
|
||||
import 'package:fluffychat/pangea/spaces/constants/space_constants.dart';
|
||||
import 'package:fluffychat/widgets/avatar.dart';
|
||||
|
||||
class PublicSpaceTile extends StatelessWidget {
|
||||
|
|
@ -35,14 +39,29 @@ class PublicSpaceTile extends StatelessWidget {
|
|||
height: isColumnMode ? 80.0 : 58.0,
|
||||
child: Row(
|
||||
children: [
|
||||
Avatar(
|
||||
mxContent: space.avatarUrl,
|
||||
name: space.name,
|
||||
size: isColumnMode ? 80.0 : 58.0,
|
||||
borderRadius: BorderRadius.circular(
|
||||
10,
|
||||
),
|
||||
),
|
||||
(space.avatarUrl != null)
|
||||
? Avatar(
|
||||
mxContent: space.avatarUrl,
|
||||
name: space.name,
|
||||
size: isColumnMode ? 80.0 : 58.0,
|
||||
borderRadius: BorderRadius.circular(
|
||||
10,
|
||||
),
|
||||
)
|
||||
: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(
|
||||
10,
|
||||
),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: SpaceConstants
|
||||
.publicSpaceIcons[Random().nextInt(
|
||||
SpaceConstants.publicSpaceIcons.length,
|
||||
)],
|
||||
width: isColumnMode ? 80.0 : 58.0,
|
||||
height: isColumnMode ? 80.0 : 58.0,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue