refactor: Remove unnecessary setState in ChatPage for better performance
This commit is contained in:
parent
a615de889e
commit
63d7bef515
3 changed files with 221 additions and 214 deletions
|
|
@ -105,7 +105,7 @@ class ChatInputRow extends StatelessWidget {
|
|||
duration: FluffyThemes.animationDuration,
|
||||
curve: FluffyThemes.animationCurve,
|
||||
height: 56,
|
||||
width: controller.inputText.isEmpty ? 56 : 0,
|
||||
width: controller.sendController.text.isEmpty ? 56 : 0,
|
||||
alignment: Alignment.center,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: const BoxDecoration(),
|
||||
|
|
@ -268,7 +268,7 @@ class ChatInputRow extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
if (PlatformInfos.platformCanRecord &&
|
||||
controller.inputText.isEmpty)
|
||||
controller.sendController.text.isEmpty)
|
||||
Container(
|
||||
height: 56,
|
||||
alignment: Alignment.center,
|
||||
|
|
@ -278,7 +278,8 @@ class ChatInputRow extends StatelessWidget {
|
|||
onPressed: controller.voiceMessageAction,
|
||||
),
|
||||
),
|
||||
if (!PlatformInfos.isMobile || controller.inputText.isNotEmpty)
|
||||
if (!PlatformInfos.isMobile ||
|
||||
controller.sendController.text.isNotEmpty)
|
||||
Container(
|
||||
height: 56,
|
||||
alignment: Alignment.center,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue