@ -7,7 +7,7 @@ import 'package:fluffychat/components/chat_settings_popup_menu.dart';
import ' package:fluffychat/components/content_banner.dart ' ;
import ' package:fluffychat/components/dialogs/simple_dialogs.dart ' ;
import ' package:fluffychat/components/list_items/participant_list_item.dart ' ;
import ' package:fluffychat/ i18n/i18 n.dart' ;
import ' package:fluffychat/ l10n/l10 n.dart' ;
import ' package:fluffychat/utils/app_route.dart ' ;
import ' package:fluffychat/views/chat_list.dart ' ;
import ' package:fluffychat/views/invitation_selection.dart ' ;
@ -31,24 +31,24 @@ class _ChatDetailsState extends State<ChatDetails> {
List < User > members ;
void setDisplaynameAction ( BuildContext context ) async {
final String displayname = await SimpleDialogs ( context ) . enterText (
titleText: I18 n. of ( context ) . changeTheNameOfTheGroup ,
labelText: I18 n. of ( context ) . changeTheNameOfTheGroup ,
hintText: widget . room . getLocalizedDisplayname ( I18 n. of ( context ) ) ,
titleText: L10 n. of ( context ) . changeTheNameOfTheGroup ,
labelText: L10 n. of ( context ) . changeTheNameOfTheGroup ,
hintText: widget . room . getLocalizedDisplayname ( L10 n. of ( context ) ) ,
) ;
if ( displayname = = null ) return ;
final success = await SimpleDialogs ( context ) . tryRequestWithLoadingDialog (
widget . room . setName ( displayname ) ,
) ;
if ( success ! = false ) {
showToast ( I18 n. of ( context ) . displaynameHasBeenChanged ) ;
showToast ( L10 n. of ( context ) . displaynameHasBeenChanged ) ;
}
}
void setCanonicalAliasAction ( context ) async {
final String s = await SimpleDialogs ( context ) . enterText (
titleText: I18 n. of ( context ) . setInvitationLink ,
labelText: I18 n. of ( context ) . setInvitationLink ,
hintText: I18 n. of ( context ) . alias . toLowerCase ( ) ,
titleText: L10 n. of ( context ) . setInvitationLink ,
labelText: L10 n. of ( context ) . setInvitationLink ,
hintText: L10 n. of ( context ) . alias . toLowerCase ( ) ,
prefixText: " # " ,
suffixText: " : " + widget . room . client . userID . domain ,
) ;
@ -89,11 +89,11 @@ class _ChatDetailsState extends State<ChatDetails> {
void setTopicAction ( BuildContext context ) async {
final String displayname = await SimpleDialogs ( context ) . enterText (
titleText: I18 n. of ( context ) . setGroupDescription ,
labelText: I18 n. of ( context ) . setGroupDescription ,
titleText: L10 n. of ( context ) . setGroupDescription ,
labelText: L10 n. of ( context ) . setGroupDescription ,
hintText: ( widget . room . topic ? . isNotEmpty ? ? false )
? widget . room . topic
: I18 n. of ( context ) . addGroupDescription ,
: L10 n. of ( context ) . addGroupDescription ,
multiLine: true ,
) ;
if ( displayname = = null ) return ;
@ -101,7 +101,7 @@ class _ChatDetailsState extends State<ChatDetails> {
widget . room . setDescription ( displayname ) ,
) ;
if ( success ! = false ) {
showToast ( I18 n. of ( context ) . groupDescriptionHasBeenChanged ) ;
showToast ( L10 n. of ( context ) . groupDescriptionHasBeenChanged ) ;
}
}
@ -121,7 +121,7 @@ class _ChatDetailsState extends State<ChatDetails> {
) ,
) ;
if ( success ! = false ) {
showToast ( I18 n. of ( context ) . avatarHasBeenChanged ) ;
showToast ( L10 n. of ( context ) . avatarHasBeenChanged ) ;
}
}
@ -144,10 +144,10 @@ class _ChatDetailsState extends State<ChatDetails> {
if ( widget . room = = null ) {
return Scaffold (
appBar: AppBar (
title: Text ( I18 n. of ( context ) . oopsSomethingWentWrong ) ,
title: Text ( L10 n. of ( context ) . oopsSomethingWentWrong ) ,
) ,
body: Center (
child: Text ( I18 n. of ( context ) . youAreNoLongerParticipatingInThisChat ) ,
child: Text ( L10 n. of ( context ) . youAreNoLongerParticipatingInThisChat ) ,
) ,
) ;
}
@ -179,12 +179,12 @@ class _ChatDetailsState extends State<ChatDetails> {
Clipboard . setData (
ClipboardData ( text: widget . room . canonicalAlias ) ,
) ;
showToast ( I18 n. of ( context ) . copiedToClipboard ) ;
showToast ( L10 n. of ( context ) . copiedToClipboard ) ;
} ,
) ,
ChatSettingsPopupMenu ( widget . room , false )
] ,
title: Text ( widget . room . getLocalizedDisplayname ( I18 n. of ( context ) ) ,
title: Text ( widget . room . getLocalizedDisplayname ( L10 n. of ( context ) ) ,
style: TextStyle (
color: Theme . of ( context )
. appBarTheme
@ -215,13 +215,13 @@ class _ChatDetailsState extends State<ChatDetails> {
child: Icon ( Icons . edit ) ,
)
: null ,
title: Text ( " ${ I18 n. of ( context ) . groupDescription } : " ,
title: Text ( " ${ L10 n. of ( context ) . groupDescription } : " ,
style: TextStyle (
color: Theme . of ( context ) . primaryColor ,
fontWeight: FontWeight . bold ) ) ,
subtitle: LinkText (
text: widget . room . topic ? . isEmpty ? ? true
? I18 n. of ( context ) . addGroupDescription
? L10 n. of ( context ) . addGroupDescription
: widget . room . topic ,
linkStyle: TextStyle ( color: Colors . blueAccent ) ,
textStyle: TextStyle (
@ -236,7 +236,7 @@ class _ChatDetailsState extends State<ChatDetails> {
Divider ( thickness: 1 ) ,
ListTile (
title: Text (
I18 n. of ( context ) . settings ,
L10 n. of ( context ) . settings ,
style: TextStyle (
color: Theme . of ( context ) . primaryColor ,
fontWeight: FontWeight . bold ,
@ -251,9 +251,9 @@ class _ChatDetailsState extends State<ChatDetails> {
foregroundColor: Colors . grey ,
child: Icon ( Icons . people ) ,
) ,
title: Text ( I18 n. of ( context ) . changeTheNameOfTheGroup ) ,
title: Text ( L10 n. of ( context ) . changeTheNameOfTheGroup ) ,
subtitle: Text ( widget . room
. getLocalizedDisplayname ( I18 n. of ( context ) ) ) ,
. getLocalizedDisplayname ( L10 n. of ( context ) ) ) ,
onTap: ( ) = > setDisplaynameAction ( context ) ,
) ,
if ( widget . room . canSendEvent ( " m.room.canonical_alias " ) & &
@ -266,11 +266,11 @@ class _ChatDetailsState extends State<ChatDetails> {
child: Icon ( Icons . link ) ,
) ,
onTap: ( ) = > setCanonicalAliasAction ( context ) ,
title: Text ( I18 n. of ( context ) . setInvitationLink ) ,
title: Text ( L10 n. of ( context ) . setInvitationLink ) ,
subtitle: Text (
( widget . room . canonicalAlias ? . isNotEmpty ? ? false )
? widget . room . canonicalAlias
: I18 n. of ( context ) . none ) ,
: L10 n. of ( context ) . none ) ,
) ,
PopupMenuButton (
child: ListTile (
@ -280,10 +280,10 @@ class _ChatDetailsState extends State<ChatDetails> {
foregroundColor: Colors . grey ,
child: Icon ( Icons . public ) ) ,
title: Text (
I18 n. of ( context ) . whoIsAllowedToJoinThisGroup ) ,
L10 n. of ( context ) . whoIsAllowedToJoinThisGroup ) ,
subtitle: Text (
widget . room . joinRules
. getLocalizedString ( I18 n. of ( context ) ) ,
. getLocalizedString ( L10 n. of ( context ) ) ,
) ,
) ,
onSelected: ( JoinRules joinRule ) = >
@ -296,13 +296,13 @@ class _ChatDetailsState extends State<ChatDetails> {
PopupMenuItem < JoinRules > (
value: JoinRules . public ,
child: Text ( JoinRules . public
. getLocalizedString ( I18 n. of ( context ) ) ) ,
. getLocalizedString ( L10 n. of ( context ) ) ) ,
) ,
if ( widget . room . canChangeJoinRules )
PopupMenuItem < JoinRules > (
value: JoinRules . invite ,
child: Text ( JoinRules . invite
. getLocalizedString ( I18 n. of ( context ) ) ) ,
. getLocalizedString ( L10 n. of ( context ) ) ) ,
) ,
] ,
) ,
@ -315,10 +315,10 @@ class _ChatDetailsState extends State<ChatDetails> {
child: Icon ( Icons . visibility ) ,
) ,
title:
Text ( I18 n. of ( context ) . visibilityOfTheChatHistory ) ,
Text ( L10 n. of ( context ) . visibilityOfTheChatHistory ) ,
subtitle: Text (
widget . room . historyVisibility
. getLocalizedString ( I18 n. of ( context ) ) ,
. getLocalizedString ( L10 n. of ( context ) ) ,
) ,
) ,
onSelected: ( HistoryVisibility historyVisibility ) = >
@ -331,25 +331,25 @@ class _ChatDetailsState extends State<ChatDetails> {
PopupMenuItem < HistoryVisibility > (
value: HistoryVisibility . invited ,
child: Text ( HistoryVisibility . invited
. getLocalizedString ( I18 n. of ( context ) ) ) ,
. getLocalizedString ( L10 n. of ( context ) ) ) ,
) ,
if ( widget . room . canChangeHistoryVisibility )
PopupMenuItem < HistoryVisibility > (
value: HistoryVisibility . joined ,
child: Text ( HistoryVisibility . joined
. getLocalizedString ( I18 n. of ( context ) ) ) ,
. getLocalizedString ( L10 n. of ( context ) ) ) ,
) ,
if ( widget . room . canChangeHistoryVisibility )
PopupMenuItem < HistoryVisibility > (
value: HistoryVisibility . shared ,
child: Text ( HistoryVisibility . shared
. getLocalizedString ( I18 n. of ( context ) ) ) ,
. getLocalizedString ( L10 n. of ( context ) ) ) ,
) ,
if ( widget . room . canChangeHistoryVisibility )
PopupMenuItem < HistoryVisibility > (
value: HistoryVisibility . world_readable ,
child: Text ( HistoryVisibility . world_readable
. getLocalizedString ( I18 n. of ( context ) ) ) ,
. getLocalizedString ( L10 n. of ( context ) ) ) ,
) ,
] ,
) ,
@ -363,10 +363,10 @@ class _ChatDetailsState extends State<ChatDetails> {
child: Icon ( Icons . info_outline ) ,
) ,
title:
Text ( I18 n. of ( context ) . areGuestsAllowedToJoin ) ,
Text ( L10 n. of ( context ) . areGuestsAllowedToJoin ) ,
subtitle: Text (
widget . room . guestAccess
. getLocalizedString ( I18 n. of ( context ) ) ,
. getLocalizedString ( L10 n. of ( context ) ) ,
) ,
) ,
onSelected: ( GuestAccess guestAccess ) = >
@ -381,7 +381,7 @@ class _ChatDetailsState extends State<ChatDetails> {
value: GuestAccess . can_join ,
child: Text (
GuestAccess . can_join
. getLocalizedString ( I18 n. of ( context ) ) ,
. getLocalizedString ( L10 n. of ( context ) ) ,
) ,
) ,
if ( widget . room . canChangeGuestAccess )
@ -389,7 +389,7 @@ class _ChatDetailsState extends State<ChatDetails> {
value: GuestAccess . forbidden ,
child: Text (
GuestAccess . forbidden
. getLocalizedString ( I18 n. of ( context ) ) ,
. getLocalizedString ( L10 n. of ( context ) ) ,
) ,
) ,
] ,
@ -398,9 +398,9 @@ class _ChatDetailsState extends State<ChatDetails> {
ListTile (
title: Text (
actualMembersCount > 1
? I18 n. of ( context ) . countParticipants (
? L10 n. of ( context ) . countParticipants (
actualMembersCount . toString ( ) )
: I18 n. of ( context ) . emptyChat ,
: L10 n. of ( context ) . emptyChat ,
style: TextStyle (
color: Theme . of ( context ) . primaryColor ,
fontWeight: FontWeight . bold ,
@ -409,7 +409,7 @@ class _ChatDetailsState extends State<ChatDetails> {
) ,
widget . room . canInvite
? ListTile (
title: Text ( I18 n. of ( context ) . inviteContact ) ,
title: Text ( L10 n. of ( context ) . inviteContact ) ,
leading: CircleAvatar (
child: Icon ( Icons . add ) ,
backgroundColor: Theme . of ( context ) . primaryColor ,
@ -428,7 +428,7 @@ class _ChatDetailsState extends State<ChatDetails> {
: i < members . length + 1
? ParticipantListItem ( members [ i - 1 ] )
: ListTile (
title: Text ( I18 n. of ( context ) . loadCountMoreParticipants (
title: Text ( L10 n. of ( context ) . loadCountMoreParticipants (
( actualMembersCount - members . length ) . toString ( ) ) ) ,
leading: CircleAvatar (
backgroundColor: