mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-27 14:59:29 +01:00
fix: Minor desktop fixes
This commit is contained in:
parent
bb537141d7
commit
c224993548
@ -12,19 +12,21 @@ class Avatar extends StatelessWidget {
|
||||
final double size;
|
||||
final Function onTap;
|
||||
static const double defaultSize = 44;
|
||||
final Client client;
|
||||
|
||||
const Avatar(
|
||||
this.mxContent,
|
||||
this.name, {
|
||||
this.size = defaultSize,
|
||||
this.onTap,
|
||||
this.client,
|
||||
Key key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var thumbnail = mxContent?.getThumbnail(
|
||||
Matrix.of(context).client,
|
||||
client ?? Matrix.of(context).client,
|
||||
width: size * MediaQuery.of(context).devicePixelRatio,
|
||||
height: size * MediaQuery.of(context).devicePixelRatio,
|
||||
);
|
||||
|
@ -11,12 +11,14 @@ class ContentBanner extends StatelessWidget {
|
||||
final IconData defaultIcon;
|
||||
final bool loading;
|
||||
final Function onEdit;
|
||||
final Client client;
|
||||
|
||||
const ContentBanner(this.mxContent,
|
||||
{this.height = 400,
|
||||
this.defaultIcon = Icons.people_outline,
|
||||
this.loading = false,
|
||||
this.onEdit,
|
||||
this.client,
|
||||
Key key})
|
||||
: super(key: key);
|
||||
|
||||
@ -26,7 +28,7 @@ class ContentBanner extends StatelessWidget {
|
||||
final bannerSize =
|
||||
(mediaQuery.size.width * mediaQuery.devicePixelRatio).toInt();
|
||||
final src = mxContent?.getThumbnail(
|
||||
Matrix.of(context).client,
|
||||
client ?? Matrix.of(context).client,
|
||||
width: bannerSize,
|
||||
height: bannerSize,
|
||||
method: ThumbnailMethod.scale,
|
||||
|
@ -4,6 +4,7 @@ import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:flutter_typeahead/flutter_typeahead.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'avatar.dart';
|
||||
import 'matrix.dart';
|
||||
|
||||
class InputBar extends StatelessWidget {
|
||||
final Room room;
|
||||
@ -138,7 +139,11 @@ class InputBar extends StatelessWidget {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Widget buildSuggestion(BuildContext context, Map<String, String> suggestion) {
|
||||
Widget buildSuggestion(
|
||||
BuildContext context,
|
||||
Map<String, String> suggestion,
|
||||
Client client,
|
||||
) {
|
||||
if (suggestion['type'] == 'emote') {
|
||||
final size = 30.0;
|
||||
final ratio = MediaQuery.of(context).devicePixelRatio;
|
||||
@ -182,8 +187,12 @@ class InputBar extends StatelessWidget {
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Avatar(url, suggestion['displayname'] ?? suggestion['mxid'],
|
||||
size: size),
|
||||
Avatar(
|
||||
url,
|
||||
suggestion['displayname'] ?? suggestion['mxid'],
|
||||
size: size,
|
||||
client: client,
|
||||
),
|
||||
SizedBox(width: 6),
|
||||
Text(suggestion['displayname'] ?? suggestion['mxid']),
|
||||
],
|
||||
@ -283,7 +292,7 @@ class InputBar extends StatelessWidget {
|
||||
textCapitalization: TextCapitalization.sentences,
|
||||
),
|
||||
suggestionsCallback: getSuggestions,
|
||||
itemBuilder: buildSuggestion,
|
||||
itemBuilder: (c, s) => buildSuggestion(c, s, Matrix.of(context).client),
|
||||
onSuggestionSelected: (Map<String, String> suggestion) =>
|
||||
insertSuggestion(context, suggestion),
|
||||
errorBuilder: (BuildContext context, Object error) => Container(),
|
||||
|
@ -310,7 +310,7 @@ class MatrixState extends State<Matrix> {
|
||||
final Set verificationMethods = <KeyVerificationMethod>{
|
||||
KeyVerificationMethod.numbers
|
||||
};
|
||||
if (PlatformInfos.isMobile) {
|
||||
if (PlatformInfos.isMobile || (!kIsWeb && Platform.isLinux)) {
|
||||
// emojis don't show in web somehow
|
||||
verificationMethods.add(KeyVerificationMethod.emoji);
|
||||
}
|
||||
|
@ -208,6 +208,7 @@ class UserBottomSheet extends StatelessWidget {
|
||||
child: ContentBanner(
|
||||
user.avatarUrl,
|
||||
defaultIcon: Icons.person_outline,
|
||||
client: user.room.client,
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
|
Loading…
Reference in New Issue
Block a user