You can use eFeMail extension so that on login you create a random code and store it in TinyDB or whatever then send it in an email with the extension after providing the destination email and the user enter it in your app and if it’s equal to the one you stored before then validate login, it’s not very hard you can do it.
For SMS i think it would be a bit hard but nothing is impossible and i’ll try to think about a solution for it and tell you.(Try with Firebase)
Mark as solution if it helps