design: Chat list design adjustments

pull/485/head
Krille 2 years ago
parent 7faa01f67a
commit 6420f1d385
No known key found for this signature in database

@ -950,7 +950,7 @@
"type": "text", "type": "text",
"placeholders": {} "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": { "@inviteText": {
"type": "text", "type": "text",
"placeholders": { "placeholders": {

@ -633,11 +633,7 @@
"username": {} "username": {}
} }
}, },
"createNewGroup": "Create new group", "createGroup": "Create group",
"@createNewGroup": {
"type": "text",
"placeholders": {}
},
"createNewSpace": "New space", "createNewSpace": "New space",
"@createNewSpace": { "@createNewSpace": {
"type": "text", "type": "text",
@ -1071,7 +1067,7 @@
"type": "text", "type": "text",
"placeholders": {} "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": { "@inviteText": {
"type": "text", "type": "text",
"placeholders": { "placeholders": {
@ -1303,8 +1299,7 @@
"server2": {} "server2": {}
} }
}, },
"shareYourInviteLink": "Share your invite link", "shareInviteLink": "Share invite link",
"@shareYourInviteLink": {},
"scanQrCode": "Scan QR code", "scanQrCode": "Scan QR code",
"@scanQrCode": {}, "@scanQrCode": {},
"none": "None", "none": "None",

@ -164,6 +164,7 @@ class MessageContent extends StatelessWidget {
onPressed: () => _verifyOrRequestKey(context), onPressed: () => _verifyOrRequestKey(context),
icon: const Icon(Icons.lock_outline), icon: const Icon(Icons.lock_outline),
label: L10n.of(context)!.encrypted, label: L10n.of(context)!.encrypted,
fontSize: fontSize,
); );
case MessageTypes.Location: case MessageTypes.Location:
final geoUri = final geoUri =
@ -215,6 +216,7 @@ class MessageContent extends StatelessWidget {
icon: const Icon(Icons.delete_outlined), icon: const Icon(Icons.delete_outlined),
textColor: buttonTextColor, textColor: buttonTextColor,
onPressed: () => onInfoTab!(event), onPressed: () => onInfoTab!(event),
fontSize: fontSize,
); );
}, },
); );
@ -264,6 +266,7 @@ class MessageContent extends StatelessWidget {
icon: const Icon(Icons.phone_outlined), icon: const Icon(Icons.phone_outlined),
textColor: buttonTextColor, textColor: buttonTextColor,
onPressed: () => onInfoTab!(event), onPressed: () => onInfoTab!(event),
fontSize: fontSize,
); );
}, },
); );
@ -280,6 +283,7 @@ class MessageContent extends StatelessWidget {
icon: const Icon(Icons.info_outlined), icon: const Icon(Icons.info_outlined),
textColor: buttonTextColor, textColor: buttonTextColor,
onPressed: () => onInfoTab!(event), onPressed: () => onInfoTab!(event),
fontSize: fontSize,
); );
}, },
); );
@ -292,24 +296,35 @@ class _ButtonContent extends StatelessWidget {
final String label; final String label;
final Icon icon; final Icon icon;
final Color? textColor; final Color? textColor;
final double fontSize;
const _ButtonContent({ const _ButtonContent({
required this.label, required this.label,
required this.icon, required this.icon,
required this.textColor, required this.textColor,
required this.onPressed, required this.onPressed,
required this.fontSize,
Key? key, Key? key,
}) : super(key: key); }) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return TextButton.icon( return InkWell(
onPressed: onPressed, onTap: onPressed,
icon: icon, child: Row(
label: Text(label, overflow: TextOverflow.ellipsis), mainAxisSize: MainAxisSize.min,
style: TextButton.styleFrom( children: [
foregroundColor: textColor, icon,
textStyle: const TextStyle(fontWeight: FontWeight.bold), 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:flutter_gen/gen_l10n/l10n.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/client_chooser_button.dart'; import 'package:fluffychat/pages/chat_list/client_chooser_button.dart';
@ -48,10 +47,10 @@ class ChatListHeader extends StatelessWidget implements PreferredSizeWidget {
textInputAction: TextInputAction.search, textInputAction: TextInputAction.search,
onChanged: controller.onSearchEnter, onChanged: controller.onSearchEnter,
decoration: InputDecoration( decoration: InputDecoration(
fillColor: Theme.of(context).colorScheme.secondaryContainer,
border: UnderlineInputBorder( border: UnderlineInputBorder(
borderSide: BorderSide.none, borderSide: BorderSide.none,
borderRadius: borderRadius: BorderRadius.circular(99),
BorderRadius.circular(AppConfig.borderRadius),
), ),
hintText: L10n.of(context)!.search, hintText: L10n.of(context)!.search,
floatingLabelBehavior: FloatingLabelBehavior.never, floatingLabelBehavior: FloatingLabelBehavior.never,

@ -44,7 +44,7 @@ class ClientChooserButton extends StatelessWidget {
children: [ children: [
const Icon(Icons.group_add_outlined), const Icon(Icons.group_add_outlined),
const SizedBox(width: 18), 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, mxContent: snapshot.data?.avatarUrl,
name: snapshot.data?.displayName ?? name: snapshot.data?.displayName ??
matrix.client.userID!.localpart, matrix.client.userID!.localpart,
size: 28, size: 32,
fontSize: 12, fontSize: 12,
), ),
), ),
@ -273,13 +273,7 @@ class ClientChooserButton extends StatelessWidget {
context.go('/rooms/newspace'); context.go('/rooms/newspace');
break; break;
case SettingsAction.invite: case SettingsAction.invite:
FluffyShare.share( FluffyShare.shareInviteLink(context);
L10n.of(context)!.inviteText(
Matrix.of(context).client.userID!,
'https://matrix.to/#/${Matrix.of(context).client.userID}?client=im.fluffychat',
),
context,
);
break; break;
case SettingsAction.settings: case SettingsAction.settings:
context.go('/rooms/settings'); context.go('/rooms/settings');

@ -14,7 +14,7 @@ class NewGroupView extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text(L10n.of(context)!.createNewGroup), title: Text(L10n.of(context)!.createGroup),
), ),
body: MaxWidthBody( body: MaxWidthBody(
child: Column( child: Column(

@ -57,10 +57,7 @@ class NewPrivateChatController extends State<NewPrivateChat> {
return null; return null;
} }
void inviteAction() => FluffyShare.share( void inviteAction() => FluffyShare.shareInviteLink(context);
'https://matrix.to/#/${Matrix.of(context).client.userID}',
context,
);
void openScannerAction() async { void openScannerAction() async {
if (PlatformInfos.isAndroid) { if (PlatformInfos.isAndroid) {

@ -33,7 +33,7 @@ class NewPrivateChatView extends StatelessWidget {
child: TextButton( child: TextButton(
onPressed: () => context.go('/rooms/newgroup'), onPressed: () => context.go('/rooms/newgroup'),
child: Text( child: Text(
L10n.of(context)!.createNewGroup, L10n.of(context)!.createGroup,
style: style:
TextStyle(color: Theme.of(context).colorScheme.secondary), TextStyle(color: Theme.of(context).colorScheme.secondary),
), ),
@ -72,7 +72,7 @@ class NewPrivateChatView extends StatelessWidget {
foregroundColor: Colors.black, foregroundColor: Colors.black,
), ),
icon: Icon(Icons.adaptive.share_outlined), icon: Icon(Icons.adaptive.share_outlined),
label: Text(L10n.of(context)!.shareYourInviteLink), label: Text(L10n.of(context)!.shareInviteLink),
onPressed: controller.inviteAction, onPressed: controller.inviteAction,
), ),
const SizedBox(height: 8), 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:share_plus/share_plus.dart';
import 'package:fluffychat/utils/platform_infos.dart'; import 'package:fluffychat/utils/platform_infos.dart';
import '../widgets/matrix.dart';
abstract class FluffyShare { abstract class FluffyShare {
static Future<void> share( static Future<void> share(
@ -27,4 +28,16 @@ abstract class FluffyShare {
); );
return; 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), label: const Text(AppConfig.emojiFontName),
), ),
Builder( Builder(
builder: (context) { builder: (innerContext) {
return TextButton.icon( return TextButton.icon(
onPressed: () { onPressed: () {
Navigator.of(context).pop();
context.go('/logs'); context.go('/logs');
Navigator.of(innerContext).pop();
}, },
icon: const Icon(Icons.list_outlined), icon: const Icon(Icons.list_outlined),
label: const Text('Logs'), label: const Text('Logs'),

Loading…
Cancel
Save