createPost method
Implementation
Future<void> createPost(BuildContext context, {String? communityId}) async {
HapticFeedback.heavyImpact();
bool isCommunity = (communityId != null) ? true : false;
if (isCommunity) {
if (isNotSelectVideoYet() && isNotSelectedImageYet()) {
log("isNotSelectVideoYet() & isNotSelectVideoYet()");
///create text post
await createTextpost(context, communityId: communityId);
} else if (isNotSelectedImageYet()) {
log("isNotSelectedImageYet");
///create video post
await creatVideoPost(context, communityId: communityId);
} else if (isNotSelectVideoYet()) {
log("isNotSelectVideoYet");
///create image post
await creatImagePost(context, communityId: communityId);
}
} else {
if (isNotSelectVideoYet() && isNotSelectedImageYet()) {
log("isNotSelectVideoYet() & isNotSelectVideoYet()");
///create text post
await createTextpost(context);
} else if (isNotSelectedImageYet()) {
log("isNotSelectedImageYet");
///create video post
await creatVideoPost(context);
} else if (isNotSelectVideoYet()) {
log("isNotSelectVideoYet");
///create image post
await creatImagePost(context);
}
}
}