createStory method
Future<StoryModel?>
createStory(
{ - dynamic text,
- dynamic user,
- dynamic attachedUrl,
- dynamic type,
})
Implementation
Future<StoryModel?> createStory({text, user, attachedUrl, type}) {
Log(
logName: 'CreateStory',
className: 'Story',
methodName: 'createStory',
type: 'INFO',
text:
'{event: Create Story, user: ${user?.userPayloadId.toString()}, user is ${user?.firstName.toString()} ${user?.lastName.toString()}, story info: attachedUrl- $attachedUrl, text- $text, type- $type',
);
return _httpService
.createStory(
text: text, attachedUrl: attachedUrl, user: user, type: type)
.then((data) async {
if (data.statusCode >= 200 && data.statusCode < 300) {
var res = json.decode(data.body);
StoryModel storyData = StoryModel.fromJson(res[0]);
return storyData;
}
return null;
});
}