If you have ever searched for open source keyboards, you might have come across OpenBoard. But that project hasn’t seen development in more than an year. Thankfully, there is a fork of it that is being worked upon quite actively. It already supports autocorrect, glide typing, user-defined dictionaries, multilingual typing and now material you themeing as well.
I think it is, it is the same thing with MIUI, I wasn’t aware Samsung allowed that.