From 936872cb55b57b9ba87397f95d3e3d6b436c91dc Mon Sep 17 00:00:00 2001 From: Ayush Shekhar Date: Thu, 28 Apr 2022 18:44:55 +0530 Subject: [PATCH] Changed customising attachment guide to use controller --- .../docs/Flutter/guides/adding_custom_attachments.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docusaurus/docs/Flutter/guides/adding_custom_attachments.mdx b/docusaurus/docs/Flutter/guides/adding_custom_attachments.mdx index e6b5f686..510e8c22 100644 --- a/docusaurus/docs/Flutter/guides/adding_custom_attachments.mdx +++ b/docusaurus/docs/Flutter/guides/adding_custom_attachments.mdx @@ -184,10 +184,10 @@ To do this, we will: First, we add the attachment when the location button is clicked: ```dart - GlobalKey _messageInputKey = GlobalKey(); + StreamMessageInputController _messageInputController = StreamMessageInputController(); StreamMessageInput( - key: _messageInputKey, + messageInputController: _messageInputController, actions: [ InkWell( child: Icon( @@ -197,7 +197,7 @@ First, we add the attachment when the location button is clicked: ), onTap: () { _determinePosition().then((value) { - _messageInputKey.currentState.addAttachment( + _messageInputController.addAttachment( Attachment( uploadState: UploadState.success(), type: 'location', @@ -220,7 +220,7 @@ After this, we can build the thumbnail: ```dart StreamMessageInput( - key: _messageInputKey, + messageInputController: _messageInputController, actions: [ InkWell( child: Icon( @@ -230,7 +230,7 @@ StreamMessageInput( ), onTap: () { _determinePosition().then((value) { - _messageInputKey.currentState.addAttachment( + _messageInputController.addAttachment( Attachment( uploadState: UploadState.success(), type: 'location',