File tree 1 file changed +18
-3
lines changed
1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -190,12 +190,27 @@ Future<String> _createEntrypoint(
190
190
//
191
191
// @dart=${languageVersion .major }.${languageVersion .minor }
192
192
193
+ // ignore_for_file: unused_element
194
+
193
195
import '$mainImport ' as entrypoint;
194
196
import 'generated_plugin_registrant.dart';
195
197
196
- Future<void> main() async {
197
- registerPlugins();
198
- entrypoint.main();
198
+ @pragma('vm:entry-point')
199
+ class _PluginRegistrant {
200
+ @pragma('vm:entry-point')
201
+ static void register() {
202
+ registerPlugins();
203
+ }
204
+ }
205
+
206
+ typedef _UnaryFunction = dynamic Function(List<String> args);
207
+
208
+ void main(List<String> args) {
209
+ if (entrypoint.main is _UnaryFunction) {
210
+ (entrypoint.main as _UnaryFunction)(args);
211
+ } else {
212
+ entrypoint.main();
213
+ }
199
214
}
200
215
''' );
201
216
return entrypoint.path;
You can’t perform that action at this time.
0 commit comments