Skip to content

Commit

Permalink
chore: Follow up navrail
Browse files Browse the repository at this point in the history
  • Loading branch information
krille-chan committed Jul 18, 2024
1 parent 659174b commit 956a2e6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
9 changes: 1 addition & 8 deletions lib/pages/chat_list/chat_list_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,7 @@ class ChatListItem extends StatelessWidget {
right: 0,
child: Avatar(
border: space == null
? room.isSpace
? BorderSide(
width: 0,
color: Theme.of(context)
.colorScheme
.outline,
)
: null
? null
: BorderSide(
width: 2,
color: backgroundColor ??
Expand Down
13 changes: 11 additions & 2 deletions lib/pages/chat_list/chat_list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:go_router/go_router.dart';
import 'package:keyboard_shortcuts/keyboard_shortcuts.dart';
import 'package:matrix/matrix.dart';

import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/config/themes.dart';
import 'package:fluffychat/pages/chat_list/chat_list.dart';
import 'package:fluffychat/pages/chat_list/navi_rail_item.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
import 'package:fluffychat/utils/stream_extension.dart';
import 'package:fluffychat/widgets/avatar.dart';
import '../../widgets/matrix.dart';
import 'chat_list_body.dart';
Expand All @@ -21,6 +23,7 @@ class ChatListView extends StatelessWidget {

@override
Widget build(BuildContext context) {
final client = Matrix.of(context).client;
return StreamBuilder<Object?>(
stream: Matrix.of(context).onShareContentChanged.stream,
builder: (_, __) {
Expand All @@ -44,8 +47,14 @@ class ChatListView extends StatelessWidget {
children: [
if (FluffyThemes.isColumnMode(context) &&
controller.widget.displayNavigationRail) ...[
Builder(
builder: (context) {
StreamBuilder(
key: ValueKey(
client.userID.toString(),
),
stream: client.onSync.stream
.where((s) => s.hasRoomUpdate)
.rateLimit(const Duration(seconds: 1)),
builder: (context, _) {
final allSpaces = Matrix.of(context)
.client
.rooms
Expand Down
7 changes: 2 additions & 5 deletions lib/widgets/avatar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,10 @@ class Avatar extends StatelessWidget {
width: size,
height: size,
child: Material(
color: Theme.of(context).colorScheme.surfaceContainerLowest,
shape: RoundedRectangleBorder(
borderRadius: borderRadius,
side: border ??
BorderSide(
color: Theme.of(context).dividerColor,
width: 1,
),
side: border ?? BorderSide.none,
),
clipBehavior: Clip.hardEdge,
child: noPic
Expand Down

0 comments on commit 956a2e6

Please sign in to comment.