Need help creating a flashlight for my 2D top-down view game?

You can use light source on your player
Then you have option to set what objects block light
Armed with that knowledge look at the picture below
And imagine you have 2 sprites (red rectangles) on player which rotate with player
And now you will stream light like on picture below

So all you need to do is move these objects to your player and if player changes orientation you change orientation of these 2 objects also
And you have your flashlight