Specify same package id for all home widgets in Flutter Home Widget

Viewed 65

I am trying to create widget in Flutter using the Flutter home package. https://pub.dev/packages/home_widget

I could successfully do it in iOS.

But when done for Android, I get the following error because of different build variants.

Unhandled Exception: PlatformException(-3, No Widget found with Name HomeWidgetExampleProvider. Argument 'name' must be the same as your AppWidgetProvider you wish to update, java.lang.ClassNotFoundException: com.myappvariant.HomeWidgetExampleProvider.

How can I make only one class for all the build variants and keep the same id for the Home Widget.

1 Answers
Related