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