Switch to extensions

This commit is contained in:
Feodor Fitsner 2025-04-04 14:31:43 -07:00
parent f3bb103111
commit 4ca251aced
1 changed files with 6 additions and 8 deletions

View File

@ -46,12 +46,14 @@ const appBootScreenMessage = '{{ boot_screen_message | default("Preparing the ap
final showAppStartupScreen = bool.tryParse("{{ show_startup_screen }}".toLowerCase()) ?? false;
const appStartupScreenMessage = '{{ startup_screen_message | default("Getting things ready…", true) }}';
List<CreateControlFactory> createControlFactories = [
List<CreateControlFactory> extensions = [
{% for dep in cookiecutter.flutter.dependencies %}
{{ dep }}.createControl,
{{ dep }}.Extension,
{% endfor %}
];
extensions.forEach((ext) => ext.ensureInitialized());
String outLogFilename = "";
// global vars
@ -75,7 +77,7 @@ void main(List<String> args) async {
assetsDir: assetsDir,
showAppStartupScreen: showAppStartupScreen,
appStartupScreenMessage: appStartupScreenMessage,
createControlFactories: createControlFactories)
extensions: extensions)
: FutureBuilder(
future: runPythonApp(args),
builder:
@ -94,7 +96,7 @@ void main(List<String> args) async {
assetsDir: assetsDir,
showAppStartupScreen: showAppStartupScreen,
appStartupScreenMessage: appStartupScreenMessage,
createControlFactories: createControlFactories);
extensions: extensions);
}
});
} else if (snapshot.hasError) {
@ -120,10 +122,6 @@ Future prepareApp() async {
await setupDesktop();
{% for dep in cookiecutter.flutter.dependencies %}
{{ dep }}.ensureInitialized();
{% endfor %}
if (kIsWeb) {
// web mode - connect via HTTP
pageUrl = Uri.base.toString();