inputButton method

Widget inputButton()

Implementation

Widget inputButton() {
  return (!controller.isResponseLoading.value &&
          controller.showSendIcon.value)
      ? GestureDetector(
          onTap: () {
            FocusManager.instance.primaryFocus?.unfocus();
            controller.sendMessage();
          },
          child: CircleAvatar(
              radius: 20,
              backgroundColor: Get.theme.colorScheme.inversePrimary,
              child: const Icon(Icons.send)))
      : GestureDetector(
          onTap: () {
            HapticFeedback.heavyImpact();
            controller.listenToSpeech();
          },
          child: CircleAvatar(
            radius: 20,
            backgroundColor: Get.theme.colorScheme.inversePrimary,
            child: const Icon(
              Icons.mic,
            ),
          ),
        );
}