showCometChatCreatePoll function

Future<String?> showCometChatCreatePoll({
  1. required dynamic context,
  2. required CometChatColorPalette colorPalette,
  3. required CometChatSpacing spacing,
  4. String? uid,
  5. String? guid,
  6. String? title,
  7. BaseMessage? quotedMessage,
  8. Group? groupObject,
  9. User? userObject,
})

showCometChatCreatePoll is a function used to show the create poll widget

Implementation

Future<String?> showCometChatCreatePoll({
  required context,
  required CometChatColorPalette colorPalette,
  required CometChatSpacing spacing,
  String? uid,
  String? guid,
  String? title,
  BaseMessage? quotedMessage,
  Group? groupObject,
  User? userObject,
}) {
  return showModalBottomSheet(
    context: context,
    useSafeArea: true,
    isScrollControlled: true,
    isDismissible: true,
    backgroundColor: colorPalette.background1,
    builder: (context) {
      return Theme(
        data: Theme.of(context).copyWith(
          scaffoldBackgroundColor: colorPalette.background1,
          canvasColor: colorPalette.background1,
        ),
        child: Material(
          color: colorPalette.background1,
          borderRadius: BorderRadius.vertical(
            top: Radius.circular(
              spacing.radius6 ?? 0,
            ),
          ),
          child: Padding(
            padding: EdgeInsets.only(
                bottom: MediaQuery.of(context).viewInsets.bottom),
            child: CometChatCreatePoll(
              user: uid,
              group: guid,
              title: title,
              quotedMessage: quotedMessage,
              groupObject: groupObject,
              userObject: userObject,
            ),
          ),
        ),
      );
    },
  );
}