It's actually a part of Anko, an extension for Kotlin. Syntax is as follows:
toast("Hi there!")
toast(R.string.message)
longToast("Wow, such a duration")
In your app-level build.gradle
, add implementation "org.jetbrains.anko:anko-common:0.8.3"
Add import org.jetbrains.anko.toast
to your Activity.