Closed DanielQuick closed 3 years ago
Join Sprint and Leave Sprint can be accomplished by adding or subtracting members within the sprint object using Enum Update.addMember, Update.deleteMember when you call the Sprint object, it returns a property labeled members which is a list of strings of members stored as an array in Firebase Firestore.
Examples/use cases: Join/Leave call parameters are Sprint, UpdateSprint enum, String Join button:
_sprint = await _sprintService.update(_sprint, UpdateSprint.addMember, 'member4');
Leave button:
_sprint = await _sprintService.update(_sprint, UpdateSprint.deleteMember, 'member4');
Please remember that the sprint post are stored as List\<SprintPost> within the Sprint object Create team lead post call parameters are Sprint, SprintPost where a SprintPost object is defined like this:
SprintPost _post0 = new SprintPost(
id: \<Define your own and follow it\>
title: 'Sprint Post 0',
content: 'Content 0',
createdAt: DateTime.now().millisecondsSinceEpoch);
Create Post:
_sprint = await _sprintService.updatePost(_sprint, UpdatePost.create, _post0);
The number 1 below is the index of the list that the sprint post is in. Once you delete a post the next post if any moves up into that space.
Delete Post:
_sprint = await _sprintService.updatePost(_sprint, UpdatePost.delete, _sprint.posts[1]);
***Since these posts are members of the Sprint Object as a List