Since gradle android plugins 2.2-alpha4:
Gradle will attempt to download missing SDK packages that a project depends on
Which
As of July 2019, the easiest method is to use: flutter doctor --android-licenses in the command prompt.
It proceeds to display the unaccepted T&C of SDKs one by one and you're given option to choose 'y/n'. Choose y for all.
Alternately, when you run flutter doctor, it will run Android toolchain diagnostics which displays how many licenses are not yet accepted, and suggests you to run it with the --android-licenses flag.