flutter_micro_app icon indicating copy to clipboard operation
flutter_micro_app copied to clipboard

How to update or add new module in supper app

Open NguyenSen opened this issue 1 year ago • 1 comments

NguyenSen avatar May 14 '24 04:05 NguyenSen

I want update code in AOT or from API

NguyenSen avatar May 14 '24 04:05 NguyenSen

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/

emanuel-braz avatar Sep 16 '24 16:09 emanuel-braz