fix crash in chat_screen.dart, try to resolve test error.
This commit is contained in:
1 parent
4000c49213
commit
de6632d70e
3 files changed
+43
-37
No files matched your search
@@ -675,7 +675,16 @@ class AppSettingsScreen extends StatelessWidget {
|
||||
onChanged: settingsService.setChannelMinHopsCountRepeaters,
|
||||
),
|
||||
],
|
||||
const Divider(height: 1, indent: 16),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildImageMessagesContent(
|
||||
BuildContext context,
|
||||
AppSettingsService settingsService,
|
||||
) {
|
||||
return Column(
|
||||
children: [
|
||||
ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
@@ -688,16 +697,6 @@ class AppSettingsScreen extends StatelessWidget {
|
||||
onTap: () => _showIpfsImageLinksDialog(context, settingsService),
|
||||
),
|
||||
const Divider(height: 1, indent: 16),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildImageMessagesContent(
|
||||
BuildContext context,
|
||||
AppSettingsService settingsService,
|
||||
) {
|
||||
return Column(
|
||||
children: [
|
||||
_ScrollIntoViewOnce(
|
||||
enabled: focusImageMessages,
|
||||
child: SwitchListTile(
|
||||
|
||||
@@ -507,9 +507,6 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
final useEncoder =
|
||||
connector.isContactSmazEnabled(keyHex) ||
|
||||
connector.isContactCyr2LatEnabled(keyHex);
|
||||
final showIpfsAction = context.select<AppSettingsService, bool>(
|
||||
(s) => s.settings.uploadIpfsEndpoint.trim().isNotEmpty,
|
||||
);
|
||||
return ChatComposer(
|
||||
controller: _textController,
|
||||
focusNode: _textFieldFocusNode,
|
||||
@@ -525,24 +522,32 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
sendTooltip: context.l10n.chat_sendMessageTo(
|
||||
_resolveContact(connector).name,
|
||||
),
|
||||
actionsBuilder: () => [
|
||||
ChatComposerAction(
|
||||
id: 'gif',
|
||||
icon: Icons.gif_box,
|
||||
label: context.l10n.chat_sendGif,
|
||||
),
|
||||
if (showIpfsAction)
|
||||
actionsBuilder: () {
|
||||
final showIpfsAction = context
|
||||
.read<AppSettingsService>()
|
||||
.settings
|
||||
.uploadIpfsEndpoint
|
||||
.trim()
|
||||
.isNotEmpty;
|
||||
return [
|
||||
ChatComposerAction(
|
||||
id: 'ipfs-image',
|
||||
icon: Icons.cloud_upload_outlined,
|
||||
label: context.l10n.chat_sendImageIpfs,
|
||||
id: 'gif',
|
||||
icon: Icons.gif_box,
|
||||
label: context.l10n.chat_sendGif,
|
||||
),
|
||||
ChatComposerAction(
|
||||
id: 'send-my-location',
|
||||
icon: Icons.my_location,
|
||||
label: context.l10n.chat_shareMyLocation,
|
||||
),
|
||||
],
|
||||
if (showIpfsAction)
|
||||
ChatComposerAction(
|
||||
id: 'ipfs-image',
|
||||
icon: Icons.cloud_upload_outlined,
|
||||
label: context.l10n.chat_sendImageIpfs,
|
||||
),
|
||||
ChatComposerAction(
|
||||
id: 'send-my-location',
|
||||
icon: Icons.my_location,
|
||||
label: context.l10n.chat_shareMyLocation,
|
||||
),
|
||||
];
|
||||
},
|
||||
onAction: (action) {
|
||||
if (!mounted) return;
|
||||
switch (action) {
|
||||
|
||||
Reference in new issue
Block a user