Forum Discussion

tscholze's avatar
tscholze
Iron Contributor
Apr 08, 2021
Solved

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

Hi team,

in the DevBlogs article "https://devblogs.microsoft.com/surface-duo/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

    • tscholze's avatar
      tscholze
      Iron Contributor

      Hi Craig_Dunn,

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

      • JWiese's avatar
        JWiese
        Icon for Microsoft rankMicrosoft
        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.

Resources