chore: Follow up navrail
This commit is contained in:
parent
659174b828
commit
956a2e6523
3 changed files with 14 additions and 15 deletions
|
|
@ -142,14 +142,7 @@ class ChatListItem extends StatelessWidget {
|
||||||
right: 0,
|
right: 0,
|
||||||
child: Avatar(
|
child: Avatar(
|
||||||
border: space == null
|
border: space == null
|
||||||
? room.isSpace
|
? null
|
||||||
? BorderSide(
|
|
||||||
width: 0,
|
|
||||||
color: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.outline,
|
|
||||||
)
|
|
||||||
: null
|
|
||||||
: BorderSide(
|
: BorderSide(
|
||||||
width: 2,
|
width: 2,
|
||||||
color: backgroundColor ??
|
color: backgroundColor ??
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,14 @@ import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:keyboard_shortcuts/keyboard_shortcuts.dart';
|
import 'package:keyboard_shortcuts/keyboard_shortcuts.dart';
|
||||||
|
import 'package:matrix/matrix.dart';
|
||||||
|
|
||||||
import 'package:fluffychat/config/app_config.dart';
|
import 'package:fluffychat/config/app_config.dart';
|
||||||
import 'package:fluffychat/config/themes.dart';
|
import 'package:fluffychat/config/themes.dart';
|
||||||
import 'package:fluffychat/pages/chat_list/chat_list.dart';
|
import 'package:fluffychat/pages/chat_list/chat_list.dart';
|
||||||
import 'package:fluffychat/pages/chat_list/navi_rail_item.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/matrix_sdk_extensions/matrix_locals.dart';
|
||||||
|
import 'package:fluffychat/utils/stream_extension.dart';
|
||||||
import 'package:fluffychat/widgets/avatar.dart';
|
import 'package:fluffychat/widgets/avatar.dart';
|
||||||
import '../../widgets/matrix.dart';
|
import '../../widgets/matrix.dart';
|
||||||
import 'chat_list_body.dart';
|
import 'chat_list_body.dart';
|
||||||
|
|
@ -21,6 +23,7 @@ class ChatListView extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final client = Matrix.of(context).client;
|
||||||
return StreamBuilder<Object?>(
|
return StreamBuilder<Object?>(
|
||||||
stream: Matrix.of(context).onShareContentChanged.stream,
|
stream: Matrix.of(context).onShareContentChanged.stream,
|
||||||
builder: (_, __) {
|
builder: (_, __) {
|
||||||
|
|
@ -44,8 +47,14 @@ class ChatListView extends StatelessWidget {
|
||||||
children: [
|
children: [
|
||||||
if (FluffyThemes.isColumnMode(context) &&
|
if (FluffyThemes.isColumnMode(context) &&
|
||||||
controller.widget.displayNavigationRail) ...[
|
controller.widget.displayNavigationRail) ...[
|
||||||
Builder(
|
StreamBuilder(
|
||||||
builder: (context) {
|
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)
|
final allSpaces = Matrix.of(context)
|
||||||
.client
|
.client
|
||||||
.rooms
|
.rooms
|
||||||
|
|
|
||||||
|
|
@ -66,13 +66,10 @@ class Avatar extends StatelessWidget {
|
||||||
width: size,
|
width: size,
|
||||||
height: size,
|
height: size,
|
||||||
child: Material(
|
child: Material(
|
||||||
|
color: Theme.of(context).colorScheme.surfaceContainerLowest,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: borderRadius,
|
borderRadius: borderRadius,
|
||||||
side: border ??
|
side: border ?? BorderSide.none,
|
||||||
BorderSide(
|
|
||||||
color: Theme.of(context).dividerColor,
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
child: noPic
|
child: noPic
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue