Files
tatuchat/lib/pages/chat_list/client_chooser_button.dart
Welton Moura 5a72c71cfc
Some checks failed
Main Deploy Workflow / deploy_web (push) Has been cancelled
Main Deploy Workflow / deploy_playstore_internal (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled
feat: menu de contexto em bottom sheet, painel de anexos, perfil e feed do mural
- Salas (chat, canais, murais e salas de espacos) abrem bottom sheet com grid de acoes
- Botao + da barra de digitacao abre painel de anexos em grid de 3 colunas que empurra a caixa de texto
- Modal do perfil permite editar nome/status e ler QR code (mobile)
- Alterar status atualiza localmente via extensao do SDK matrix
- Mural pre-carrega historico para exibir todas as midias em dispositivos sem cache
2026-09-21 14:30:47 -03:00

50 lines
1.7 KiB
Dart

// SPDX-FileCopyrightText: 2019-Present Christian Kußowski
// SPDX-FileCopyrightText: 2019-Present Contributors to FluffyChat
//
// SPDX-License-Identifier: AGPL-3.0-or-later
import 'package:async/async.dart';
import 'package:material_ui/material_ui.dart';
import 'package:matrix/matrix.dart' hide Result;
import 'package:tatchat/l10n/l10n.dart';
import 'package:tatchat/widgets/avatar.dart';
import 'package:tatchat/widgets/matrix.dart';
import 'package:tatchat/widgets/self_profile_dialog.dart';
import 'chat_list.dart';
/// The header avatar of the active account. Tapping it opens the own profile
/// dialog. Account switching and the former avatar popup actions live in the
/// navigation drawer (Sidebar).
class ClientChooserButton extends StatelessWidget {
final ChatListController controller;
const ClientChooserButton(this.controller, {super.key});
@override
Widget build(BuildContext context) {
final matrix = Matrix.of(context);
final client = Result(() => matrix.client).asValue?.value;
return FutureBuilder<Profile>(
future: client?.isLogged() == true ? client?.fetchOwnProfile() : null,
builder: (context, snapshot) => Material(
clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.circular(99),
color: Colors.transparent,
child: Tooltip(
message: L10n.of(context).accountsAndSettings,
child: InkWell(
key: const Key('accounts_and_settings_buttons'),
onTap: () => showSelfProfileDialog(context),
child: Avatar(
mxContent: snapshot.data?.avatarUrl,
name: snapshot.data?.displayName ?? client?.userID?.localpart,
size: 32,
),
),
),
),
);
}
}