We will start by opening another generated file called ./android/src/main/java/{organization_name}/TextViewPlugin.java . We can replace the contents of that file with the following:

All we are doing is implementing the registerWith method where we provide the viewType we defined earlier in text_view.dart as well as providing a TextViewFactory which will be creating our native TextView as a PlatformView .

Next, we need to create ./android/src/main/java/{organization_name}/TextViewFactory.java and extend PlatformViewFactory .

Our TextViewFactory implements the create method which returns a PlatformView (in our case it will return a FlutterTextView ).

Next up, we need to create ./android/src/main/java/{organization_name}/FlutterTextView.java and implement PlatformView as well as MethodCallHandler so that we can have our native view painted as a flutter widget and be able to receive data from dart via a MethodChannel .

Our FlutterTextView creates a new TextView and sets up a MethodChannel so that the TextView can receive data from dart code and make updates (in this case update the text).

In order to implement PlatformView , we need to override getView and return our textView as well as override dispose (which in this case does nothing).

In order to implement MethodCallHandler , we need to override onMethodCall and, depending on the method, either call our internal setText method (to update the textView 's text) or return result.notImplemented since we currently don’t support any other methods.