getRadio method

dynamic getRadio(
  1. int index,
  2. String id,
  3. String value,
  4. String chosenId,
  5. String pollId,
  6. CometChatTheme theme,
)

Implementation

getRadio(int index, String id, String value, String chosenId, String pollId,
    CometChatTheme theme) {
  return GestureDetector(
    onTap: () async {
      if (loggedInUser != null &&
          senderUid != null &&
          senderUid == loggedInUser) {
        return;
      }
      await choosePoll(id, pollId);
    },
    child: Padding(
      padding: const EdgeInsets.fromLTRB(4, 0, 4, 6),
      child: SizedBox(
        // decoration: BoxDecoration(
        //     color: style?.pollOptionsBackgroundColor ??
        //         theme.palette.getBackground(),
        //     borderRadius: const BorderRadius.all(Radius.circular(6.0))),
        height: 42,
        child: Row(
          mainAxisAlignment: MainAxisAlignment.start,
          children: [
            Container(
                height: 20,
                width: 20,
                margin: const EdgeInsets.only(left: 11, right: 9),
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(11),
                  color:
                      style?.radioButtonColor ?? AppTheme.accent,
                )),
            Flexible(
              child: Text(
                value,
                maxLines: 2,
                style:
                    TextStyle(color: theme.palette.getAccent(), fontSize: 13)
                        .merge(style?.pollOptionsTextStyle),
              ),
            )
          ],
        ),
      ),
    ),
  );
}