Compare commits
2 Commits
48a50744de
...
288b5e70d4
| Author | SHA1 | Date | |
|---|---|---|---|
| 288b5e70d4 | |||
| c0463e51f9 |
BIN
assets/logo/background.png
Normal file
BIN
assets/logo/background.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 MiB |
@@ -2010,7 +2010,7 @@
|
||||
"select": "Selecionar",
|
||||
"pleaseChooseAStrongPassword": "Escolha uma senha forte",
|
||||
"blockUsername": "Ignorar nome de usuário",
|
||||
"addChatOrSubSpace": "Adicionar conversa ou subespaço",
|
||||
"addChatOrSubSpace": "Criar grupo aqui",
|
||||
"groupName": "Nome do grupo",
|
||||
"leaveEmptyToClearStatus": "Deixe em branco para limpar seu estado.",
|
||||
"joinSpace": "Entrar no espaço",
|
||||
|
||||
@@ -13,7 +13,6 @@ import 'package:tatchat/pages/chat/encryption_info.dart';
|
||||
import 'package:tatchat/pages/chat/events/message.dart';
|
||||
import 'package:tatchat/pages/chat/seen_by_row.dart';
|
||||
import 'package:tatchat/pages/chat/typing_indicators.dart';
|
||||
import 'package:tatchat/utils/account_config.dart';
|
||||
import 'package:tatchat/utils/matrix_sdk_extensions/filtered_timeline_extension.dart';
|
||||
import 'package:tatchat/utils/platform_infos.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
@@ -53,8 +52,7 @@ class ChatEventList extends StatelessWidget {
|
||||
thisEventsKeyMap[events[i].eventId] = i;
|
||||
}
|
||||
|
||||
final hasWallpaper =
|
||||
controller.room.client.applicationAccountConfig.wallpaperUrl != null;
|
||||
const hasWallpaper = true;
|
||||
|
||||
return SelectionArea(
|
||||
child: MediaQuery(
|
||||
|
||||
@@ -352,25 +352,38 @@ class ChatView extends StatelessWidget {
|
||||
top: false,
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
if (accountConfig.wallpaperUrl != null)
|
||||
Opacity(
|
||||
opacity: accountConfig.wallpaperOpacity ?? 0.5,
|
||||
child: ImageFiltered(
|
||||
imageFilter: ui.ImageFilter.blur(
|
||||
sigmaX: accountConfig.wallpaperBlur ?? 0.0,
|
||||
sigmaY: accountConfig.wallpaperBlur ?? 0.0,
|
||||
),
|
||||
child: MxcImage(
|
||||
cacheKey: accountConfig.wallpaperUrl.toString(),
|
||||
uri: accountConfig.wallpaperUrl,
|
||||
fit: BoxFit.cover,
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
isThumbnail: false,
|
||||
placeholder: (_) => Container(),
|
||||
),
|
||||
Opacity(
|
||||
opacity: accountConfig.wallpaperUrl != null
|
||||
? accountConfig.wallpaperOpacity ?? 0.5
|
||||
: 0.3,
|
||||
child: ImageFiltered(
|
||||
imageFilter: ui.ImageFilter.blur(
|
||||
sigmaX: accountConfig.wallpaperUrl != null
|
||||
? accountConfig.wallpaperBlur ?? 0.0
|
||||
: 0.0,
|
||||
sigmaY: accountConfig.wallpaperUrl != null
|
||||
? accountConfig.wallpaperBlur ?? 0.0
|
||||
: 0.0,
|
||||
),
|
||||
child: accountConfig.wallpaperUrl != null
|
||||
? MxcImage(
|
||||
cacheKey: accountConfig.wallpaperUrl
|
||||
.toString(),
|
||||
uri: accountConfig.wallpaperUrl,
|
||||
fit: BoxFit.cover,
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
isThumbnail: false,
|
||||
placeholder: (_) => Container(),
|
||||
)
|
||||
: Image.asset(
|
||||
'./assets/logo/background.png',
|
||||
fit: BoxFit.cover,
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: controller.clearSingleSelectedEvent,
|
||||
child: ChatEventList(controller: controller),
|
||||
|
||||
@@ -73,10 +73,15 @@ class ChatListItem extends StatelessWidget {
|
||||
final space = this.space;
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
child: Material(
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
side: BorderSide(
|
||||
color: theme.colorScheme.surfaceContainer,
|
||||
width: 1.5,
|
||||
),
|
||||
), clipBehavior: Clip.hardEdge,
|
||||
color: backgroundColor,
|
||||
child: FutureBuilder(
|
||||
future: room.name.isEmpty ? room.loadHeroUsers() : null,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:tatchat/config/app_config.dart';
|
||||
import 'package:tatchat/l10n/l10n.dart';
|
||||
@@ -45,7 +45,7 @@ class MuralListItem extends StatelessWidget {
|
||||
final isMuted = room.pushRuleState != PushRuleState.notify;
|
||||
final backgroundColor = activeChat
|
||||
? theme.colorScheme.secondaryContainer
|
||||
: theme.colorScheme.surfaceContainerLow;
|
||||
: theme.colorScheme.surface;
|
||||
final description = this.description;
|
||||
final creatorName = this.creatorName;
|
||||
final followers = room.summary.mJoinedMemberCount ?? 0;
|
||||
@@ -56,7 +56,13 @@ class MuralListItem extends StatelessWidget {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
child: Material(
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
side: BorderSide(
|
||||
color: theme.colorScheme.surfaceContainer,
|
||||
width: 1.5,
|
||||
),
|
||||
),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
color: backgroundColor,
|
||||
child: InkWell(
|
||||
@@ -80,52 +86,80 @@ class MuralListItem extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Text(
|
||||
displayname,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: theme.textTheme.titleMedium?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (isMuted)
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(left: 4),
|
||||
child: Icon(Icons.notifications_off_outlined, size: 16),
|
||||
),
|
||||
if (room.isFavourite)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 4),
|
||||
child: Icon(
|
||||
Icons.push_pin,
|
||||
size: 16,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
),
|
||||
if (creatorName != null && creatorName.isNotEmpty) ...[
|
||||
const SizedBox(width: 12),
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
'${l10n.by} $creatorName',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: mutedStyle?.copyWith(
|
||||
fontStyle: FontStyle.italic,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Text(
|
||||
displayname,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: theme.textTheme.titleMedium?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (isMuted)
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(left: 4),
|
||||
child: Icon(
|
||||
Icons.notifications_off_outlined,
|
||||
size: 16,
|
||||
),
|
||||
),
|
||||
if (room.isFavourite)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 4),
|
||||
child: Icon(
|
||||
Icons.push_pin,
|
||||
size: 16,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
if (creatorName != null &&
|
||||
creatorName.isNotEmpty) ...[
|
||||
// const SizedBox(width: 12),
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
'${l10n.by} $creatorName',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: mutedStyle?.copyWith(
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
const Spacer(),
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.group_outlined,
|
||||
size: 16,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
const SizedBox(width: 2),
|
||||
Text(
|
||||
l10n.countFollowers(followers),
|
||||
style: mutedStyle,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
const SizedBox(width: 8),
|
||||
Icon(
|
||||
Icons.group_outlined,
|
||||
size: 16,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(l10n.countFollowers(followers), style: mutedStyle),
|
||||
],
|
||||
),
|
||||
if (description != null && description.isNotEmpty)
|
||||
@@ -133,7 +167,7 @@ class MuralListItem extends StatelessWidget {
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: Text(
|
||||
description,
|
||||
maxLines: 2,
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
|
||||
@@ -4,11 +4,10 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import 'package:badges/badges.dart';
|
||||
import 'package:tatchat/config/app_config.dart';
|
||||
import 'package:tatchat/widgets/hover_builder.dart';
|
||||
import 'package:tatchat/widgets/unread_rooms_badge.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:tatchat/widgets/hover_builder.dart';
|
||||
import 'package:tatchat/widgets/unread_rooms_badge.dart';
|
||||
|
||||
import '../../config/themes.dart';
|
||||
|
||||
@@ -33,7 +32,7 @@ class NaviRailItem extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
|
||||
final borderRadius = BorderRadius.circular(AppConfig.borderRadius);
|
||||
final borderRadius = BorderRadius.circular(1000);
|
||||
final icon = isSelected ? selectedIcon ?? this.icon : this.icon;
|
||||
final unreadBadgeFilter = this.unreadBadgeFilter;
|
||||
return HoverBuilder(
|
||||
@@ -73,7 +72,7 @@ class NaviRailItem extends StatelessWidget {
|
||||
borderRadius: borderRadius,
|
||||
color: isSelected
|
||||
? theme.colorScheme.secondaryContainer
|
||||
: Colors.transparent,
|
||||
: theme.colorScheme.surfaceContainerHighest,
|
||||
child: Tooltip(
|
||||
message: toolTip,
|
||||
child: InkWell(
|
||||
|
||||
@@ -36,19 +36,25 @@ class Sidebar extends StatelessWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 14,
|
||||
vertical: 4,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
'./assets/logo/mini/logo_mini.png',
|
||||
width: 28,
|
||||
height: 28,
|
||||
ColorFiltered(
|
||||
colorFilter: ColorFilter.mode(
|
||||
theme.colorScheme.primary,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
child: Image.asset(
|
||||
'./assets/logo/mini/logo_mini.png',
|
||||
width: 58,
|
||||
height: 58,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
'TatuChat',
|
||||
style: theme.textTheme.titleMedium?.copyWith(
|
||||
style: theme.textTheme.titleLarge?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: theme.colorScheme.onSurface,
|
||||
),
|
||||
|
||||
@@ -375,71 +375,43 @@ class _SpaceViewState extends State<SpaceView> {
|
||||
theme.colorScheme.onPrimaryContainer,
|
||||
),
|
||||
),
|
||||
suffixIcon: PopupMenuButton<SpaceActions>(
|
||||
icon: Avatar(
|
||||
size: avatarSize,
|
||||
mxContent: room.avatar,
|
||||
name: displayname,
|
||||
shapeBorder: RoundedSuperellipseBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
color: theme.dividerColor,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConfig.spaceBorderRadius,
|
||||
),
|
||||
),
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConfig.spaceBorderRadius,
|
||||
),
|
||||
),
|
||||
useRootNavigator: true,
|
||||
onSelected: _onSpaceAction,
|
||||
itemBuilder: (context) => [
|
||||
if (isAdmin)
|
||||
PopupMenuItem(
|
||||
value: SpaceActions.addChild,
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.edit_square),
|
||||
title: Text(
|
||||
L10n.of(
|
||||
context,
|
||||
).addChatOrSubSpace,
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: SpaceActions.settings,
|
||||
child: ListTile(
|
||||
leading: Icon(
|
||||
Icons.settings_outlined,
|
||||
),
|
||||
title: Text(
|
||||
L10n.of(context).settings,
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: SpaceActions.leave,
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.delete_outlined),
|
||||
title: Text(L10n.of(context).leave),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
if (isAdmin)
|
||||
IconButton.filledTonal(
|
||||
tooltip: L10n.of(context).addChatOrSubSpace,
|
||||
onPressed: () => context.go(
|
||||
'/rooms/newgroup?space_id=${widget.spaceId}',
|
||||
PopupMenuButton<SpaceActions>(
|
||||
tooltip: L10n.of(context).settings,
|
||||
useRootNavigator: true,
|
||||
onSelected: _onSpaceAction,
|
||||
itemBuilder: (context) => [
|
||||
if (isAdmin)
|
||||
PopupMenuItem(
|
||||
value: SpaceActions.addChild,
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.add_circle_outline_rounded),
|
||||
title: Text(
|
||||
L10n.of(context).addChatOrSubSpace,
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: SpaceActions.settings,
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.settings_outlined,),
|
||||
title: Text(L10n.of(context).settings),
|
||||
),
|
||||
),
|
||||
icon: const Icon(Icons.add),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: SpaceActions.leave,
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.delete_outlined,color: theme.colorScheme.error ),
|
||||
title: Text(L10n.of(context).leave, style: TextStyle(color: theme.colorScheme.error),),
|
||||
),
|
||||
),
|
||||
],
|
||||
icon: const Icon(Icons.settings_outlined),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -672,21 +644,6 @@ class _SpaceViewState extends State<SpaceView> {
|
||||
bottom: 12,
|
||||
child: Row(
|
||||
children: [
|
||||
Avatar(
|
||||
mxContent: avatar,
|
||||
name: displayname,
|
||||
size: 56,
|
||||
shapeBorder: RoundedSuperellipseBorder(
|
||||
side: BorderSide(
|
||||
width: 2,
|
||||
color: theme.colorScheme.surface,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConfig.spaceBorderRadius,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
displayname,
|
||||
|
||||
@@ -136,6 +136,7 @@ class _SpacesTabState extends State<SpacesTab> {
|
||||
child: Icon(Icons.add),
|
||||
),
|
||||
toolTip: L10n.of(context).createNewSpace,
|
||||
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
|
||||
@@ -31,10 +31,10 @@ import 'package:tatchat/widgets/qr_code_viewer.dart';
|
||||
/// Shows the profile of the active account: avatar, display name, status, the
|
||||
/// own QR code, the global user ID and an optional QR code scanner.
|
||||
Future<void> showSelfProfileDialog(BuildContext context) => showAdaptiveDialog(
|
||||
context: context,
|
||||
barrierDismissible: true,
|
||||
builder: (context) => const SelfProfileDialog(),
|
||||
);
|
||||
context: context,
|
||||
barrierDismissible: true,
|
||||
builder: (context) => const SelfProfileDialog(),
|
||||
);
|
||||
|
||||
class SelfProfileDialog extends StatefulWidget {
|
||||
const SelfProfileDialog({super.key});
|
||||
@@ -236,120 +236,126 @@ class _SelfProfileDialogState extends State<SelfProfileDialog> {
|
||||
final userId = client.userID;
|
||||
final l10n = L10n.of(context);
|
||||
_profileFuture ??= client.fetchOwnProfile();
|
||||
|
||||
return AlertDialog.adaptive(
|
||||
insetPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
|
||||
content: SingleChildScrollView(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 420),
|
||||
child: Column(
|
||||
mainAxisSize: .min,
|
||||
crossAxisAlignment: .stretch,
|
||||
children: [
|
||||
FutureBuilder<Profile>(
|
||||
future: _profileFuture,
|
||||
builder: (context, snapshot) {
|
||||
final profile = snapshot.data;
|
||||
final avatar = profile?.avatarUrl;
|
||||
final displayname =
|
||||
profile?.displayName ?? userId?.localpart ?? l10n.user;
|
||||
return Column(
|
||||
children: [
|
||||
Center(
|
||||
child: Stack(
|
||||
alignment: .center,
|
||||
children: [
|
||||
Avatar(
|
||||
mxContent: avatar,
|
||||
name: displayname,
|
||||
size: 96,
|
||||
shapeBorder: const CircleBorder(),
|
||||
onTap: avatar != null
|
||||
? () => showDialog(
|
||||
context: context,
|
||||
builder: (_) => MxcImageViewer(avatar),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
Positioned(
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: Material(
|
||||
color: theme.colorScheme.primary,
|
||||
shape: const CircleBorder(),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: InkWell(
|
||||
onTap: _editAvatar,
|
||||
child: SizedBox(
|
||||
width: 30,
|
||||
height: 30,
|
||||
child: Icon(
|
||||
Icons.edit_outlined,
|
||||
size: 16,
|
||||
color: theme.colorScheme.onPrimary,
|
||||
child: SizedBox(
|
||||
width: MediaQuery.of(context).size.width > 720 ? 420 : MediaQuery.of(context).size.width,
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 800),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
FutureBuilder<Profile>(
|
||||
future: _profileFuture,
|
||||
builder: (context, snapshot) {
|
||||
final profile = snapshot.data;
|
||||
final avatar = profile?.avatarUrl;
|
||||
final displayname =
|
||||
profile?.displayName ?? userId?.localpart ?? l10n.user;
|
||||
return Column(
|
||||
children: [
|
||||
Center(
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Avatar(
|
||||
mxContent: avatar,
|
||||
name: displayname,
|
||||
size: 96,
|
||||
shapeBorder: const CircleBorder(),
|
||||
onTap: avatar != null
|
||||
? () => showDialog(
|
||||
context: context,
|
||||
builder: (_) =>
|
||||
MxcImageViewer(avatar),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
Positioned(
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: Material(
|
||||
color: theme.colorScheme.primary,
|
||||
shape: const CircleBorder(),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: InkWell(
|
||||
onTap: _editAvatar,
|
||||
child: SizedBox(
|
||||
width: 30,
|
||||
height: 30,
|
||||
child: Icon(
|
||||
Icons.camera_alt_outlined,
|
||||
size: 18,
|
||||
color: theme.colorScheme.onPrimary,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
_EditableLine(
|
||||
text: displayname,
|
||||
style: theme.textTheme.titleLarge?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
tooltip: l10n.editDisplayname,
|
||||
onEdit: _editDisplayName,
|
||||
),
|
||||
const SizedBox(height: 0),
|
||||
_EditableLine(
|
||||
text: _statusMsg?.trim().isNotEmpty == true
|
||||
? _statusMsg!
|
||||
: l10n.setStatus,
|
||||
style: _statusMsg?.trim().isNotEmpty == true
|
||||
? theme.textTheme.bodyMedium
|
||||
: theme.textTheme.bodySmall?.copyWith(
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
tooltip: l10n.setStatus,
|
||||
onEdit: _editStatus,
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
if (userId != null) ...[
|
||||
Center(
|
||||
child: Material(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConfig.borderRadius,
|
||||
),
|
||||
side: BorderSide(
|
||||
width: 2,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
_EditableLine(
|
||||
text: displayname,
|
||||
style: theme.textTheme.titleLarge?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.transparent,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConfig.borderRadius,
|
||||
),
|
||||
tooltip: l10n.editDisplayname,
|
||||
onEdit: _editDisplayName,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
_EditableLine(
|
||||
text: _statusMsg?.trim().isNotEmpty == true
|
||||
? _statusMsg!
|
||||
: l10n.setStatus,
|
||||
style: _statusMsg?.trim().isNotEmpty == true
|
||||
? theme.textTheme.bodyMedium
|
||||
: theme.textTheme.bodySmall?.copyWith(
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
tooltip: l10n.setStatus,
|
||||
onEdit: _editStatus,
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
if (userId != null) ...[
|
||||
Center(
|
||||
child: Material(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConfig.borderRadius,
|
||||
),
|
||||
side: BorderSide(
|
||||
width: 2,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
),
|
||||
color: Colors.transparent,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConfig.borderRadius,
|
||||
),
|
||||
onTap: () => showQrCodeViewer(context, userId),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 160),
|
||||
child: PrettyQrView.data(
|
||||
data: 'https://matrix.to/#/$userId',
|
||||
decoration: PrettyQrDecoration(
|
||||
shape: PrettyQrSmoothSymbol(
|
||||
roundFactor: 1,
|
||||
color: theme.colorScheme.primary,
|
||||
onTap: () => showQrCodeViewer(context, userId),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 160),
|
||||
child: PrettyQrView.data(
|
||||
data: 'https://matrix.to/#/$userId',
|
||||
decoration: PrettyQrDecoration(
|
||||
shape: PrettyQrSmoothSymbol(
|
||||
roundFactor: 1,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -357,72 +363,72 @@ class _SelfProfileDialogState extends State<SelfProfileDialog> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Center(
|
||||
child: Material(
|
||||
color: theme.colorScheme.surfaceContainerHigh,
|
||||
borderRadius: BorderRadius.circular(99),
|
||||
child: InkWell(
|
||||
const SizedBox(height: 12),
|
||||
Center(
|
||||
child: Material(
|
||||
color: theme.colorScheme.surfaceContainerHigh,
|
||||
borderRadius: BorderRadius.circular(99),
|
||||
onTap: _copyUserId,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 8,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: .min,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
userId,
|
||||
maxLines: 1,
|
||||
overflow: .ellipsis,
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
fontFamily: 'RobotoMono',
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(99),
|
||||
onTap: _copyUserId,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 8,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
userId,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
fontFamily: 'RobotoMono',
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Icon(
|
||||
_copied
|
||||
? Icons.check_circle
|
||||
: Icons.copy_outlined,
|
||||
size: 14,
|
||||
color: _copied
|
||||
? Colors.green
|
||||
: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
],
|
||||
const SizedBox(width: 8),
|
||||
Icon(
|
||||
_copied
|
||||
? Icons.check_circle
|
||||
: Icons.copy_outlined,
|
||||
size: 14,
|
||||
color: _copied
|
||||
? Colors.green
|
||||
: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
const Divider(height: 32),
|
||||
if (PlatformInfos.isMobile)
|
||||
],
|
||||
const Divider(height: 32),
|
||||
if (PlatformInfos.isMobile)
|
||||
ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
dense: true,
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: theme.colorScheme.primaryContainer,
|
||||
foregroundColor: theme.colorScheme.onPrimaryContainer,
|
||||
child: const Icon(Icons.qr_code_scanner_outlined),
|
||||
),
|
||||
title: Text(l10n.scanQrCode),
|
||||
onTap: _openQrScanner,
|
||||
),
|
||||
ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
dense: true,
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: theme.colorScheme.primaryContainer,
|
||||
foregroundColor: theme.colorScheme.onPrimaryContainer,
|
||||
child: const Icon(Icons.qr_code_scanner_outlined),
|
||||
),
|
||||
title: Text(l10n.scanQrCode),
|
||||
onTap: _openQrScanner,
|
||||
leading: const Icon(Icons.settings_outlined),
|
||||
title: Text(l10n.settings),
|
||||
onTap: _openSettingsAction,
|
||||
),
|
||||
ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
dense: true,
|
||||
leading: const Icon(Icons.settings_outlined),
|
||||
title: Text(l10n.settings),
|
||||
onTap: _openSettingsAction,
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -448,14 +454,14 @@ class _EditableLine extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisAlignment: .center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
text,
|
||||
maxLines: 3,
|
||||
overflow: .ellipsis,
|
||||
textAlign: .center,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
style: style,
|
||||
),
|
||||
),
|
||||
@@ -473,4 +479,4 @@ class _EditableLine extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
enum _AvatarAction { camera, file, remove }
|
||||
enum _AvatarAction { camera, file, remove }
|
||||
Reference in New Issue
Block a user