@ -27,6 +27,7 @@ import '../models/app_settings.dart';
import ' ../models/path_history.dart ' ;
import ' ../models/path_history.dart ' ;
import ' ../models/translation_support.dart ' ;
import ' ../models/translation_support.dart ' ;
import ' ../services/app_settings_service.dart ' ;
import ' ../services/app_settings_service.dart ' ;
import ' ../services/block_service.dart ' ;
import ' ../services/chat_text_scale_service.dart ' ;
import ' ../services/chat_text_scale_service.dart ' ;
import ' ../services/path_history_service.dart ' ;
import ' ../services/path_history_service.dart ' ;
import ' ../services/translation_service.dart ' ;
import ' ../services/translation_service.dart ' ;
@ -353,52 +354,87 @@ class _ChatScreenState extends State<ChatScreen> {
if ( value = = ' clearChat ' ) {
if ( value = = ' clearChat ' ) {
connector . clearMessagesForContact ( widget . contact ) ;
connector . clearMessagesForContact ( widget . contact ) ;
}
}
if ( value = = ' block ' ) {
context . read < BlockService > ( ) . block (
widget . contact . publicKeyHex ,
) ;
}
if ( value = = ' unblock ' ) {
context . read < BlockService > ( ) . unblock (
widget . contact . publicKeyHex ,
) ;
}
} ,
} ,
itemBuilder: ( context ) = > [
itemBuilder: ( context ) {
PopupMenuItem (
final isBlocked = context . read < BlockService > ( ) . isBlocked (
value: ' info ' ,
widget . contact . publicKeyHex ,
child: Row (
) ;
children: [
return [
const Icon ( Icons . info_outline , size: 20 ) ,
PopupMenuItem (
const SizedBox ( width: 12 ) ,
value: ' info ' ,
Text ( context . l10n . contact_info ) ,
child: Row (
] ,
children: [
const Icon ( Icons . info_outline , size: 20 ) ,
const SizedBox ( width: 12 ) ,
Text ( context . l10n . contact_info ) ,
] ,
) ,
) ,
) ,
) ,
PopupMenuItem (
PopupMenuItem (
value: ' telemetry ' ,
value: ' telemetry ' ,
child: Row (
child: Row (
children: [
children: [
const Icon ( Icons . bar_chart , size: 20 ) ,
const Icon ( Icons . bar_chart , size: 20 ) ,
const SizedBox ( width: 12 ) ,
const SizedBox ( width: 12 ) ,
Text ( context . l10n . contact_telemetry ) ,
Text ( context . l10n . contact_telemetry ) ,
] ,
] ,
) ,
) ,
) ,
) ,
PopupMenuItem (
PopupMenuItem (
value: ' settings ' ,
value: ' settings ' ,
child: Row (
child: Row (
children: [
children: [
const Icon ( Icons . settings , size: 20 ) ,
const Icon ( Icons . settings , size: 20 ) ,
const SizedBox ( width: 12 ) ,
const SizedBox ( width: 12 ) ,
Text ( context . l10n . contact_settings ) ,
Text ( context . l10n . contact_settings ) ,
] ,
] ,
) ,
) ,
) ,
) ,
PopupMenuItem (
PopupMenuItem (
value: ' clearChat ' ,
value: ' clearChat ' ,
child: Row (
child: Row (
children: [
children: [
const Icon ( Icons . delete , size: 20 , color: Colors . red ) ,
const Icon ( Icons . delete , size: 20 , color: Colors . red ) ,
const SizedBox ( width: 12 ) ,
const SizedBox ( width: 12 ) ,
Text (
Text (
context . l10n . contact_clearChat ,
context . l10n . contact_clearChat ,
style: const TextStyle ( color: Colors . red ) ,
style: const TextStyle ( color: Colors . red ) ,
) ,
) ,
] ,
] ,
) ,
) ,
) ,
) ,
PopupMenuItem (
] ,
value: isBlocked ? ' unblock ' : ' block ' ,
child: Row (
children: [
Icon (
isBlocked
? Icons . check_circle_outline
: Icons . block ,
size: 20 ,
color: isBlocked ? null : Colors . red . shade700 ,
) ,
const SizedBox ( width: 12 ) ,
Text (
isBlocked
? context . l10n . block_unblock
: context . l10n . block_block ,
) ,
] ,
) ,
) ,
] ;
} ,
) ;
) ;
} ,
} ,
) ,
) ,