Please check out the below repo. i have implemented the same logic in it:
let me know if you face any issues with it