From 6077197bb03e5d2b94b61a8e0a483200e1c12556 Mon Sep 17 00:00:00 2001 From: Victor Date: Thu, 6 Apr 2023 14:52:22 -0300 Subject: [PATCH] messageField.visible param added --- lib/src/chatoptions.dart | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/src/chatoptions.dart b/lib/src/chatoptions.dart index d32636a..ce98f9b 100644 --- a/lib/src/chatoptions.dart +++ b/lib/src/chatoptions.dart @@ -42,9 +42,12 @@ class MessageFieldOptions { /// Defaults to false final bool? spellcheck; - /// TODO: visible + /// This makes the Message Field visible + /// + /// Defaults to true + final bool visible; - const MessageFieldOptions({this.autofocus, this.enterSendsMessage, this.placeholder, this.spellcheck}); + const MessageFieldOptions({this.autofocus, this.enterSendsMessage, this.placeholder, this.spellcheck, this.visible = true}); Map toJson() { final result = {}; @@ -69,6 +72,8 @@ class MessageFieldOptions { result['spellcheck'] = spellcheck; } + result['visible'] = visible; + return result; } @@ -97,10 +102,14 @@ class MessageFieldOptions { return false; } + if (visible != other.visible) { + return false; + } + return true; } - int get hashCode => Object.hash(autofocus, enterSendsMessage, placeholder, spellcheck); + int get hashCode => Object.hash(autofocus, enterSendsMessage, placeholder, spellcheck, visible); } /// The possible values for showTranslationToggle