flutter_micro_app
flutter_micro_app copied to clipboard
How to update or add new module in supper app
I want update code in AOT or from API
If I understand correctly, you want to add new modules/packages to the main app (host), right?
The main app doesn't care if it's accessing a module or components from its own project, all it depends on are the classes that inherit from the MicroApp. This way, you just need to expose the classes based on the MicroApp and add them to the host's list of microapps.
// Create the MicroApp in your module or in the same project
class MyMicroApplication1 extends MicroApp {
// your code here
}
class MyApp extends MicroHostStatelessWidget {
// Register all [MicroApp]s here]
@override
List<MicroApp> get initialMicroApps => [MyMicroApplication1()];
}
export 'src/microapps/my_micro_application_1.dart';
If you want update code in JIT you can use Code Push Strategy, check this out: https://shorebird.dev/