if you try to migrate following this page flutter_migrate_gradle you need to pay attention that you not need to add flutterRoot due to in the file settings.gradle apply this propperty 'flutter.sdk'
flutterRoot