💄 Serval changes to optimize UX
This commit is contained in:
@@ -455,10 +455,13 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
|
|
||||||
final currentMessages = state.value ?? [];
|
final currentMessages = state.value ?? [];
|
||||||
if (editingTo != null) {
|
if (editingTo != null) {
|
||||||
final newMessages = currentMessages
|
final newMessages =
|
||||||
.where((m) => m.id != localMessage.id) // remove pending message
|
currentMessages
|
||||||
.map((m) => m.id == editingTo.id ? updatedMessage : m) // update original message
|
.where((m) => m.id != localMessage.id) // remove pending message
|
||||||
.toList();
|
.map(
|
||||||
|
(m) => m.id == editingTo.id ? updatedMessage : m,
|
||||||
|
) // update original message
|
||||||
|
.toList();
|
||||||
state = AsyncValue.data(newMessages);
|
state = AsyncValue.data(newMessages);
|
||||||
} else {
|
} else {
|
||||||
final newMessages =
|
final newMessages =
|
||||||
@@ -1549,7 +1552,7 @@ class _ChatInput extends HookConsumerWidget {
|
|||||||
children: [
|
children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
tooltip: 'stickers'.tr(),
|
tooltip: 'stickers'.tr(),
|
||||||
icon: const Icon(Symbols.emoji_symbols),
|
icon: const Icon(Symbols.add_reaction),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
final size = MediaQuery.of(context).size;
|
final size = MediaQuery.of(context).size;
|
||||||
showStickerPickerPopover(
|
showStickerPickerPopover(
|
||||||
@@ -1659,8 +1662,13 @@ class _ChatInput extends HookConsumerWidget {
|
|||||||
horizontal: 12,
|
horizontal: 12,
|
||||||
vertical: 4,
|
vertical: 4,
|
||||||
),
|
),
|
||||||
|
counterText:
|
||||||
|
messageController.text.length > 1024
|
||||||
|
? '${messageController.text.length}/4096'
|
||||||
|
: null,
|
||||||
),
|
),
|
||||||
maxLines: null,
|
maxLines: 3,
|
||||||
|
minLines: 1,
|
||||||
onTapOutside:
|
onTapOutside:
|
||||||
(_) => FocusManager.instance.primaryFocus?.unfocus(),
|
(_) => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
),
|
),
|
||||||
|
@@ -9,6 +9,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|||||||
import 'package:island/models/chat.dart';
|
import 'package:island/models/chat.dart';
|
||||||
import 'package:island/pods/network.dart';
|
import 'package:island/pods/network.dart';
|
||||||
import 'package:island/screens/chat/chat.dart';
|
import 'package:island/screens/chat/chat.dart';
|
||||||
|
import 'package:island/widgets/account/account_pfc.dart';
|
||||||
import 'package:island/widgets/account/account_picker.dart';
|
import 'package:island/widgets/account/account_picker.dart';
|
||||||
import 'package:island/widgets/account/status.dart';
|
import 'package:island/widgets/account/status.dart';
|
||||||
import 'package:island/widgets/alert.dart';
|
import 'package:island/widgets/alert.dart';
|
||||||
@@ -666,8 +667,11 @@ class _ChatMemberListSheet extends HookConsumerWidget {
|
|||||||
final member = data.items[index];
|
final member = data.items[index];
|
||||||
return ListTile(
|
return ListTile(
|
||||||
contentPadding: EdgeInsets.only(left: 16, right: 12),
|
contentPadding: EdgeInsets.only(left: 16, right: 12),
|
||||||
leading: ProfilePictureWidget(
|
leading: AccountPfcGestureDetector(
|
||||||
fileId: member.account.profile.picture?.id,
|
uname: member.account.name,
|
||||||
|
child: ProfilePictureWidget(
|
||||||
|
fileId: member.account.profile.picture?.id,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
title: Row(
|
title: Row(
|
||||||
spacing: 6,
|
spacing: 6,
|
||||||
|
@@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:island/models/chat.dart';
|
import 'package:island/models/chat.dart';
|
||||||
import 'package:island/services/color.dart';
|
import 'package:island/services/color.dart';
|
||||||
import 'package:island/services/responsive.dart';
|
import 'package:island/services/responsive.dart';
|
||||||
|
import 'package:island/widgets/account/account_pfc.dart';
|
||||||
import 'package:island/widgets/account/status.dart';
|
import 'package:island/widgets/account/status.dart';
|
||||||
import 'package:island/widgets/post/post_list.dart';
|
import 'package:island/widgets/post/post_list.dart';
|
||||||
import 'package:palette_generator/palette_generator.dart';
|
import 'package:palette_generator/palette_generator.dart';
|
||||||
@@ -658,8 +659,11 @@ class _RealmMemberListSheet extends HookConsumerWidget {
|
|||||||
final member = data.items[index];
|
final member = data.items[index];
|
||||||
return ListTile(
|
return ListTile(
|
||||||
contentPadding: EdgeInsets.only(left: 16, right: 12),
|
contentPadding: EdgeInsets.only(left: 16, right: 12),
|
||||||
leading: ProfilePictureWidget(
|
leading: AccountPfcGestureDetector(
|
||||||
fileId: member.account!.profile.picture?.id,
|
uname: member.account!.name,
|
||||||
|
child: ProfilePictureWidget(
|
||||||
|
fileId: member.account!.profile.picture?.id,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
title: Row(
|
title: Row(
|
||||||
spacing: 6,
|
spacing: 6,
|
||||||
|
Reference in New Issue
Block a user