disable message text entry and send button when contact offline
continuous-integration/drone/pr Build is failing
Details
continuous-integration/drone/pr Build is failing
Details
This commit is contained in:
parent
9bb23de090
commit
3fef3153b4
|
@ -164,6 +164,8 @@ class _MessageViewState extends State<MessageView> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildComposeBox() {
|
Widget _buildComposeBox() {
|
||||||
|
bool isOffline = Provider.of<ContactInfoState>(context).isOnline() == false;
|
||||||
|
|
||||||
var composeBox = Container(
|
var composeBox = Container(
|
||||||
color: Provider.of<Settings>(context).theme.backgroundMainColor(),
|
color: Provider.of<Settings>(context).theme.backgroundMainColor(),
|
||||||
padding: EdgeInsets.all(2),
|
padding: EdgeInsets.all(2),
|
||||||
|
@ -187,6 +189,7 @@ class _MessageViewState extends State<MessageView> {
|
||||||
minLines: 1,
|
minLines: 1,
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
onFieldSubmitted: _sendMessage,
|
onFieldSubmitted: _sendMessage,
|
||||||
|
enabled: !isOffline,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
enabledBorder: InputBorder.none,
|
enabledBorder: InputBorder.none,
|
||||||
focusedBorder: InputBorder.none,
|
focusedBorder: InputBorder.none,
|
||||||
|
@ -201,7 +204,7 @@ class _MessageViewState extends State<MessageView> {
|
||||||
suffixIcon: IconButton(
|
suffixIcon: IconButton(
|
||||||
icon: Icon(CwtchIcons.send_24px, size: 24, color: Provider.of<Settings>(context).theme.mainTextColor()),
|
icon: Icon(CwtchIcons.send_24px, size: 24, color: Provider.of<Settings>(context).theme.mainTextColor()),
|
||||||
tooltip: AppLocalizations.of(context)!.sendMessage,
|
tooltip: AppLocalizations.of(context)!.sendMessage,
|
||||||
onPressed: _sendMessage,
|
onPressed: isOffline ? null :_sendMessage,
|
||||||
),
|
),
|
||||||
)))),
|
)))),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in New Issue