mirror of
https://github.com/krille-chan/fluffychat
synced 2024-10-05 15:52:44 +00:00
design: Chat list design adjustments
This commit is contained in:
parent
7faa01f67a
commit
6420f1d385
10 changed files with 50 additions and 37 deletions
|
@ -950,7 +950,7 @@
|
|||
"type": "text",
|
||||
"placeholders": {}
|
||||
},
|
||||
"inviteText": "{username} hat Dich zu FluffyChat eingeladen. \n1. Installiere FluffyChat: https://fluffychat.im \n2. Melde Dich in der App an \n3. Öffne den Einladungslink: {link}",
|
||||
"inviteText": "{username} hat Dich zu FluffyChat eingeladen. \n1. Gehe auf fluffychat.im und installiere die App \n2. Melde Dich in der App an \n3. Öffne den Einladungslink: \n {link}",
|
||||
"@inviteText": {
|
||||
"type": "text",
|
||||
"placeholders": {
|
||||
|
|
|
@ -633,11 +633,7 @@
|
|||
"username": {}
|
||||
}
|
||||
},
|
||||
"createNewGroup": "Create new group",
|
||||
"@createNewGroup": {
|
||||
"type": "text",
|
||||
"placeholders": {}
|
||||
},
|
||||
"createGroup": "Create group",
|
||||
"createNewSpace": "New space",
|
||||
"@createNewSpace": {
|
||||
"type": "text",
|
||||
|
@ -1071,7 +1067,7 @@
|
|||
"type": "text",
|
||||
"placeholders": {}
|
||||
},
|
||||
"inviteText": "{username} invited you to FluffyChat. \n1. Install FluffyChat: https://fluffychat.im \n2. Sign up or sign in \n3. Open the invite link: {link}",
|
||||
"inviteText": "{username} invited you to FluffyChat.\n1. Visit fluffychat.im and install the app \n2. Sign up or sign in \n3. Open the invite link: \n {link}",
|
||||
"@inviteText": {
|
||||
"type": "text",
|
||||
"placeholders": {
|
||||
|
@ -1303,8 +1299,7 @@
|
|||
"server2": {}
|
||||
}
|
||||
},
|
||||
"shareYourInviteLink": "Share your invite link",
|
||||
"@shareYourInviteLink": {},
|
||||
"shareInviteLink": "Share invite link",
|
||||
"scanQrCode": "Scan QR code",
|
||||
"@scanQrCode": {},
|
||||
"none": "None",
|
||||
|
|
|
@ -164,6 +164,7 @@ class MessageContent extends StatelessWidget {
|
|||
onPressed: () => _verifyOrRequestKey(context),
|
||||
icon: const Icon(Icons.lock_outline),
|
||||
label: L10n.of(context)!.encrypted,
|
||||
fontSize: fontSize,
|
||||
);
|
||||
case MessageTypes.Location:
|
||||
final geoUri =
|
||||
|
@ -215,6 +216,7 @@ class MessageContent extends StatelessWidget {
|
|||
icon: const Icon(Icons.delete_outlined),
|
||||
textColor: buttonTextColor,
|
||||
onPressed: () => onInfoTab!(event),
|
||||
fontSize: fontSize,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
@ -264,6 +266,7 @@ class MessageContent extends StatelessWidget {
|
|||
icon: const Icon(Icons.phone_outlined),
|
||||
textColor: buttonTextColor,
|
||||
onPressed: () => onInfoTab!(event),
|
||||
fontSize: fontSize,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
@ -280,6 +283,7 @@ class MessageContent extends StatelessWidget {
|
|||
icon: const Icon(Icons.info_outlined),
|
||||
textColor: buttonTextColor,
|
||||
onPressed: () => onInfoTab!(event),
|
||||
fontSize: fontSize,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
@ -292,24 +296,35 @@ class _ButtonContent extends StatelessWidget {
|
|||
final String label;
|
||||
final Icon icon;
|
||||
final Color? textColor;
|
||||
final double fontSize;
|
||||
|
||||
const _ButtonContent({
|
||||
required this.label,
|
||||
required this.icon,
|
||||
required this.textColor,
|
||||
required this.onPressed,
|
||||
required this.fontSize,
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return TextButton.icon(
|
||||
onPressed: onPressed,
|
||||
icon: icon,
|
||||
label: Text(label, overflow: TextOverflow.ellipsis),
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: textColor,
|
||||
textStyle: const TextStyle(fontWeight: FontWeight.bold),
|
||||
return InkWell(
|
||||
onTap: onPressed,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
icon,
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
label,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: textColor,
|
||||
fontSize: fontSize,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
|||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.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/client_chooser_button.dart';
|
||||
|
@ -48,10 +47,10 @@ class ChatListHeader extends StatelessWidget implements PreferredSizeWidget {
|
|||
textInputAction: TextInputAction.search,
|
||||
onChanged: controller.onSearchEnter,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Theme.of(context).colorScheme.secondaryContainer,
|
||||
border: UnderlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
borderRadius:
|
||||
BorderRadius.circular(AppConfig.borderRadius),
|
||||
borderRadius: BorderRadius.circular(99),
|
||||
),
|
||||
hintText: L10n.of(context)!.search,
|
||||
floatingLabelBehavior: FloatingLabelBehavior.never,
|
||||
|
|
|
@ -44,7 +44,7 @@ class ClientChooserButton extends StatelessWidget {
|
|||
children: [
|
||||
const Icon(Icons.group_add_outlined),
|
||||
const SizedBox(width: 18),
|
||||
Text(L10n.of(context)!.createNewGroup),
|
||||
Text(L10n.of(context)!.createGroup),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -221,7 +221,7 @@ class ClientChooserButton extends StatelessWidget {
|
|||
mxContent: snapshot.data?.avatarUrl,
|
||||
name: snapshot.data?.displayName ??
|
||||
matrix.client.userID!.localpart,
|
||||
size: 28,
|
||||
size: 32,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
|
@ -273,13 +273,7 @@ class ClientChooserButton extends StatelessWidget {
|
|||
context.go('/rooms/newspace');
|
||||
break;
|
||||
case SettingsAction.invite:
|
||||
FluffyShare.share(
|
||||
L10n.of(context)!.inviteText(
|
||||
Matrix.of(context).client.userID!,
|
||||
'https://matrix.to/#/${Matrix.of(context).client.userID}?client=im.fluffychat',
|
||||
),
|
||||
context,
|
||||
);
|
||||
FluffyShare.shareInviteLink(context);
|
||||
break;
|
||||
case SettingsAction.settings:
|
||||
context.go('/rooms/settings');
|
||||
|
|
|
@ -14,7 +14,7 @@ class NewGroupView extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(L10n.of(context)!.createNewGroup),
|
||||
title: Text(L10n.of(context)!.createGroup),
|
||||
),
|
||||
body: MaxWidthBody(
|
||||
child: Column(
|
||||
|
|
|
@ -57,10 +57,7 @@ class NewPrivateChatController extends State<NewPrivateChat> {
|
|||
return null;
|
||||
}
|
||||
|
||||
void inviteAction() => FluffyShare.share(
|
||||
'https://matrix.to/#/${Matrix.of(context).client.userID}',
|
||||
context,
|
||||
);
|
||||
void inviteAction() => FluffyShare.shareInviteLink(context);
|
||||
|
||||
void openScannerAction() async {
|
||||
if (PlatformInfos.isAndroid) {
|
||||
|
|
|
@ -33,7 +33,7 @@ class NewPrivateChatView extends StatelessWidget {
|
|||
child: TextButton(
|
||||
onPressed: () => context.go('/rooms/newgroup'),
|
||||
child: Text(
|
||||
L10n.of(context)!.createNewGroup,
|
||||
L10n.of(context)!.createGroup,
|
||||
style:
|
||||
TextStyle(color: Theme.of(context).colorScheme.secondary),
|
||||
),
|
||||
|
@ -72,7 +72,7 @@ class NewPrivateChatView extends StatelessWidget {
|
|||
foregroundColor: Colors.black,
|
||||
),
|
||||
icon: Icon(Icons.adaptive.share_outlined),
|
||||
label: Text(L10n.of(context)!.shareYourInviteLink),
|
||||
label: Text(L10n.of(context)!.shareInviteLink),
|
||||
onPressed: controller.inviteAction,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
|
|
@ -5,6 +5,7 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
import '../widgets/matrix.dart';
|
||||
|
||||
abstract class FluffyShare {
|
||||
static Future<void> share(
|
||||
|
@ -27,4 +28,16 @@ abstract class FluffyShare {
|
|||
);
|
||||
return;
|
||||
}
|
||||
|
||||
static Future<void> shareInviteLink(BuildContext context) async {
|
||||
final client = Matrix.of(context).client;
|
||||
final ownProfile = await client.fetchOwnProfile();
|
||||
await FluffyShare.share(
|
||||
L10n.of(context)!.inviteText(
|
||||
ownProfile.displayName ?? client.userID!,
|
||||
'https://matrix.to/#/${client.userID}?client=im.fluffychat',
|
||||
),
|
||||
context,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,11 +59,11 @@ abstract class PlatformInfos {
|
|||
label: const Text(AppConfig.emojiFontName),
|
||||
),
|
||||
Builder(
|
||||
builder: (context) {
|
||||
builder: (innerContext) {
|
||||
return TextButton.icon(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
context.go('/logs');
|
||||
Navigator.of(innerContext).pop();
|
||||
},
|
||||
icon: const Icon(Icons.list_outlined),
|
||||
label: const Text('Logs'),
|
||||
|
|
Loading…
Reference in a new issue