SOLVED

Flutter sample maybe shows code that's not existing in a new Flutter project using Android Studio

Iron Contributor

Hi team,

in the DevBlogs article "Get Started with Flutter on Surface Duo"' step 2 containts the following task:

 

This code should go right below the GeneratedPluginRegistrant.registerWith(flutterEngine); line

Nevertheless if I copy and paste your example source MainActivity.kt including the method below, everything works but it was for me a little confusing to work with this step's task.

 

The vanilla activity looked like:

 

package io.github.tscholze.flutter_app3

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}  

 

 

4 Replies
best response confirmed by tscholze (Iron Contributor)
Solution

@tscholze thanks for the feedback, I'll pass on to the author. 

 

Note that when the built-in Flutter support lands you won't need to follow that more manual process ;)

Hi @Craig_Dunn,

Thynky for your help! Wow, I hole the foldable support will ne released soon as possible. :)

ok, finally had a chance to look at this and it appears that the boilerplate code has changed for the default project structure. They have moved the plugin registration back into the Java code and out of the Kotlin activity. Since we are getting closer to checking in the foldable support into the framework itself I don't think it's worth spending time working all the changes to this post. As Craig said, very soon you won't have to do any of this, it will all be part of Flutter itself.
1 best response

Accepted Solutions
best response confirmed by tscholze (Iron Contributor)
Solution

@tscholze thanks for the feedback, I'll pass on to the author. 

 

Note that when the built-in Flutter support lands you won't need to follow that more manual process ;)

View solution in original post