Public space click (#2327)
* chore: open space bottom chat on click public space card * chore: use boxfit.cover for images in activity card and public space card
This commit is contained in:
parent
1b18810c83
commit
5831860355
5 changed files with 26 additions and 16 deletions
|
|
@ -35,7 +35,7 @@ class BookmarkedActivitiesListState extends State<BookmarkedActivitiesList> {
|
|||
|
||||
bool get _isColumnMode => FluffyThemes.isColumnMode(context);
|
||||
|
||||
double get cardHeight => _isColumnMode ? 315.0 : 240.0;
|
||||
double get cardHeight => _isColumnMode ? 325.0 : 250.0;
|
||||
double get cardWidth => _isColumnMode ? 225.0 : 150.0;
|
||||
|
||||
Future<void> _onEdit(
|
||||
|
|
|
|||
|
|
@ -69,23 +69,23 @@ class ActivitySuggestionCard extends StatelessWidget {
|
|||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
height: width - 16.0,
|
||||
width: width - 16.0,
|
||||
height: width,
|
||||
width: width,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(24.0),
|
||||
),
|
||||
margin: const EdgeInsets.only(top: 8.0),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(24.0),
|
||||
child: image != null
|
||||
? Image.memory(image!)
|
||||
? Image.memory(image!, fit: BoxFit.cover)
|
||||
: activity.imageURL != null
|
||||
? activity.imageURL!.startsWith("mxc")
|
||||
? MxcImage(
|
||||
uri: Uri.parse(activity.imageURL!),
|
||||
width: width - 16.0,
|
||||
height: width - 16.0,
|
||||
width: width,
|
||||
height: width,
|
||||
cacheKey: activity.bookmarkId,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: CachedNetworkImage(
|
||||
imageUrl: activity.imageURL!,
|
||||
|
|
@ -94,6 +94,7 @@ class ActivitySuggestionCard extends StatelessWidget {
|
|||
),
|
||||
errorWidget: (context, url, error) =>
|
||||
const SizedBox(),
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: null,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class ActivitySuggestionCarouselState
|
|||
String? _error;
|
||||
|
||||
double get _cardWidth => _isColumnMode ? 250.0 : 175.0;
|
||||
double get _cardHeight => _isColumnMode ? 350.0 : 265.0;
|
||||
double get _cardHeight => _isColumnMode ? 360.0 : 275.0;
|
||||
|
||||
ActivityPlanModel? _currentActivity;
|
||||
final List<ActivityPlanModel> _activityItems = [];
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class ActivitySuggestionsAreaState extends State<ActivitySuggestionsArea> {
|
|||
|
||||
final List<ActivityPlanModel> _activityItems = [];
|
||||
final ScrollController _scrollController = ScrollController();
|
||||
double get cardHeight => _isColumnMode ? 315.0 : 240.0;
|
||||
double get cardHeight => _isColumnMode ? 325.0 : 250.0;
|
||||
double get cardWidth => _isColumnMode ? 225.0 : 150.0;
|
||||
|
||||
Future<void> _setActivityItems() async {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/pangea/common/widgets/pressable_button.dart';
|
||||
import 'package:fluffychat/utils/adaptive_bottom_sheet.dart';
|
||||
import 'package:fluffychat/widgets/mxc_image.dart';
|
||||
import 'package:fluffychat/widgets/public_room_bottom_sheet.dart';
|
||||
|
||||
class PublicSpaceCard extends StatelessWidget {
|
||||
final PublicRoomsChunk space;
|
||||
|
|
@ -23,7 +25,14 @@ class PublicSpaceCard extends StatelessWidget {
|
|||
final theme = Theme.of(context);
|
||||
|
||||
return PressableButton(
|
||||
onPressed: () {},
|
||||
onPressed: () => showAdaptiveBottomSheet(
|
||||
context: context,
|
||||
builder: (c) => PublicRoomBottomSheet(
|
||||
roomAlias: space.canonicalAlias ?? space.roomId,
|
||||
outerContext: context,
|
||||
chunk: space,
|
||||
),
|
||||
),
|
||||
borderRadius: BorderRadius.circular(24.0),
|
||||
color: theme.brightness == Brightness.dark
|
||||
? theme.colorScheme.primary
|
||||
|
|
@ -47,19 +56,19 @@ class PublicSpaceCard extends StatelessWidget {
|
|||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
height: height - 16.0,
|
||||
width: height - 16.0,
|
||||
height: height,
|
||||
width: height,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(24.0),
|
||||
),
|
||||
margin: const EdgeInsets.all(8.0),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(24.0),
|
||||
child: space.avatarUrl != null
|
||||
? MxcImage(
|
||||
uri: space.avatarUrl!,
|
||||
width: width - 16.0,
|
||||
height: width - 16.0,
|
||||
width: width,
|
||||
height: width,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: const SizedBox(),
|
||||
),
|
||||
|
|
@ -125,7 +134,7 @@ class PublicSpaceCard extends StatelessWidget {
|
|||
style: theme.textTheme.bodySmall,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.start,
|
||||
maxLines: 4,
|
||||
maxLines: 5,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue