|
|
@ -6,10 +6,7 @@ import 'package:vrouter/vrouter.dart';
|
|
|
|
import 'package:fluffychat/pages/chat/chat.dart';
|
|
|
|
import 'package:fluffychat/pages/chat/chat.dart';
|
|
|
|
import 'package:fluffychat/pages/user_bottom_sheet/user_bottom_sheet.dart';
|
|
|
|
import 'package:fluffychat/pages/user_bottom_sheet/user_bottom_sheet.dart';
|
|
|
|
import 'package:fluffychat/utils/matrix_sdk_extensions.dart/matrix_locals.dart';
|
|
|
|
import 'package:fluffychat/utils/matrix_sdk_extensions.dart/matrix_locals.dart';
|
|
|
|
import 'package:fluffychat/utils/room_status_extension.dart';
|
|
|
|
|
|
|
|
import 'package:fluffychat/utils/stream_extension.dart';
|
|
|
|
|
|
|
|
import 'package:fluffychat/widgets/avatar.dart';
|
|
|
|
import 'package:fluffychat/widgets/avatar.dart';
|
|
|
|
import 'package:fluffychat/widgets/matrix.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ChatAppBarTitle extends StatelessWidget {
|
|
|
|
class ChatAppBarTitle extends StatelessWidget {
|
|
|
|
final ChatController controller;
|
|
|
|
final ChatController controller;
|
|
|
@ -25,12 +22,9 @@ class ChatAppBarTitle extends StatelessWidget {
|
|
|
|
return Text(controller.selectedEvents.length.toString());
|
|
|
|
return Text(controller.selectedEvents.length.toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
final directChatMatrixID = room.directChatMatrixID;
|
|
|
|
final directChatMatrixID = room.directChatMatrixID;
|
|
|
|
return ListTile(
|
|
|
|
return InkWell(
|
|
|
|
leading: Avatar(
|
|
|
|
splashColor: Colors.transparent,
|
|
|
|
mxContent: room.avatar,
|
|
|
|
highlightColor: Colors.transparent,
|
|
|
|
name: room.displayname,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
|
|
|
|
onTap: directChatMatrixID != null
|
|
|
|
onTap: directChatMatrixID != null
|
|
|
|
? () => showModalBottomSheet(
|
|
|
|
? () => showModalBottomSheet(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
@ -42,20 +36,22 @@ class ChatAppBarTitle extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: () => VRouter.of(context).toSegments(['rooms', room.id, 'details']),
|
|
|
|
: () => VRouter.of(context).toSegments(['rooms', room.id, 'details']),
|
|
|
|
title: Text(room.getLocalizedDisplayname(MatrixLocals(L10n.of(context)!)),
|
|
|
|
child: Row(
|
|
|
|
maxLines: 1),
|
|
|
|
children: [
|
|
|
|
subtitle: StreamBuilder<Object>(
|
|
|
|
Avatar(
|
|
|
|
stream: Matrix.of(context)
|
|
|
|
mxContent: room.avatar,
|
|
|
|
.client
|
|
|
|
name: room.displayname,
|
|
|
|
.onPresence
|
|
|
|
size: 32,
|
|
|
|
.stream
|
|
|
|
),
|
|
|
|
.where((p) => p.senderId == room.directChatMatrixID)
|
|
|
|
const SizedBox(width: 12),
|
|
|
|
.rateLimit(const Duration(seconds: 1)),
|
|
|
|
Text(
|
|
|
|
builder: (context, snapshot) => Text(
|
|
|
|
room.getLocalizedDisplayname(MatrixLocals(L10n.of(context)!)),
|
|
|
|
room.getLocalizedStatus(context),
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
maxLines: 1,
|
|
|
|
//overflow: TextOverflow.ellipsis,
|
|
|
|
style: const TextStyle(
|
|
|
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|