I am trying to put Flutter app as a module in Android app, I have followed this tutorial.
I am new with Flutter, and beginner with Android so probably missing some basics here.
I am stuck at these lines of code
flutterButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
startActivity(
FlutterActivity
.withNewEngine()
.initialRoute("/AppPages.INITIAL")
.build(currentActivity)
);
}
});
The bolded part of the code is showing errors.
- I see others have put (this) or some other variable instead of currentActivity but it doesn’t help.
- The “OnClickListener” problem can be solved by adding import, it changes then to “View.OnClickListener”. Since 1 is still red I cant determine if this is good or bad.
My route in the Flutter module is initialRoute: AppPages.INITIAL
Thanks