@@ -25,7 +25,7 @@ final Stream<MyDataClass> dataClassEvents = const EventChannel('MyTestModule_dat
25
25
26
26
Future <int ?> next (int ? previous) async {
27
27
return await methodChannelToNative.invokeMethod <int >(
28
- 'intState ' ,
28
+ 'MyTestModule_intState ' ,
29
29
[previous]
30
30
);
31
31
}
@@ -60,7 +60,7 @@ final Stream<MyDataClass> dataClassEvents = const EventChannel('MyTestModule_dat
60
60
61
61
Future <String ?> next (String ? previous) async {
62
62
return await methodChannelToNative.invokeMethod <String >(
63
- 'dataClassState ' ,
63
+ 'MyTestModule_dataClassState ' ,
64
64
[previous]
65
65
);
66
66
}
@@ -95,7 +95,7 @@ final Stream<MyDataClass> dataClassEvents = const EventChannel('MyTestModule_dat
95
95
96
96
Future <String ?> next (String ? previous) async {
97
97
return await methodChannelToNative.invokeMethod <String >(
98
- 'parameterizedDataClassState ' ,
98
+ 'MyTestModule_parameterizedDataClassState ' ,
99
99
[previous, dataSerialized]
100
100
);
101
101
}
@@ -130,7 +130,7 @@ final Stream<MyDataClass> dataClassEvents = const EventChannel('MyTestModule_dat
130
130
131
131
Future <String ?> next (String ? previous) async {
132
132
return await methodChannelToNative.invokeMethod <String >(
133
- 'boolState ' ,
133
+ 'MyTestModule_boolState ' ,
134
134
[previous]
135
135
);
136
136
}
@@ -165,7 +165,7 @@ final Stream<MyDataClass> dataClassEvents = const EventChannel('MyTestModule_dat
165
165
166
166
Future <int ?> next (int ? previous) async {
167
167
return await methodChannelToNative.invokeMethod <int >(
168
- 'intStateAdd ' ,
168
+ 'MyTestModule_intStateAdd ' ,
169
169
[previous, num ]
170
170
);
171
171
}
@@ -196,12 +196,12 @@ final Stream<MyDataClass> dataClassEvents = const EventChannel('MyTestModule_dat
196
196
}
197
197
Future <void > unitMethod () async {
198
198
199
- await methodChannelToNative.invokeMethod <void >('unitMethod ' , []);
199
+ await methodChannelToNative.invokeMethod <void >('MyTestModule_unitMethod ' , []);
200
200
}
201
201
Future <String > simpleMethod () async {
202
202
203
203
final invokeResult = await methodChannelToNative.invokeMethod <String >(
204
- 'simpleMethod ' ,
204
+ 'MyTestModule_simpleMethod ' ,
205
205
[],
206
206
);
207
207
@@ -216,7 +216,7 @@ Future<String> simpleMethod() async {
216
216
Future <String > stringMethod (String value) async {
217
217
218
218
final invokeResult = await methodChannelToNative.invokeMethod <String >(
219
- 'stringMethod ' ,
219
+ 'MyTestModule_stringMethod ' ,
220
220
[value],
221
221
);
222
222
@@ -231,7 +231,7 @@ Future<String> stringMethod(String value) async {
231
231
Future <String ?> nullableStringMethod (String ? value) async {
232
232
233
233
final invokeResult = await methodChannelToNative.invokeMethod <String ?>(
234
- 'nullableStringMethod ' ,
234
+ 'MyTestModule_nullableStringMethod ' ,
235
235
[value],
236
236
);
237
237
final result = invokeResult;
@@ -240,7 +240,7 @@ Future<String?> nullableStringMethod(String? value) async {
240
240
Future <int > intMethod (int value) async {
241
241
242
242
final invokeResult = await methodChannelToNative.invokeMethod <int >(
243
- 'intMethod ' ,
243
+ 'MyTestModule_intMethod ' ,
244
244
[value],
245
245
);
246
246
@@ -255,7 +255,7 @@ Future<int> intMethod(int value) async {
255
255
Future <double > doubleMethod (double value) async {
256
256
257
257
final invokeResult = await methodChannelToNative.invokeMethod <double >(
258
- 'doubleMethod ' ,
258
+ 'MyTestModule_doubleMethod ' ,
259
259
[value],
260
260
);
261
261
@@ -270,7 +270,7 @@ Future<double> doubleMethod(double value) async {
270
270
Future <bool > boolMethod (bool value) async {
271
271
final valueSerialized = value.toString ();
272
272
final invokeResult = await methodChannelToNative.invokeMethod <String >(
273
- 'boolMethod ' ,
273
+ 'MyTestModule_boolMethod ' ,
274
274
[valueSerialized],
275
275
);
276
276
@@ -282,15 +282,30 @@ Future<bool> boolMethod(bool value) async {
282
282
283
283
return result;
284
284
}
285
+ Future <String > methodWithSameNameAsInOtherModule (String value) async {
286
+
287
+ final invokeResult = await methodChannelToNative.invokeMethod <String >(
288
+ 'MyTestModule_methodWithSameNameAsInOtherModule' ,
289
+ [value],
290
+ );
291
+
292
+ if (invokeResult == null ) {
293
+ throw PlatformException (code: '1' , message: 'Method methodWithSameNameAsInOtherModule failed' );
294
+ }
295
+
296
+ final result = invokeResult;
297
+
298
+ return result;
299
+ }
285
300
Future <void > parameterizedMethod (String a, int b, bool c, double d) async {
286
301
final cSerialized = c.toString ();
287
- await methodChannelToNative.invokeMethod <void >('parameterizedMethod ' , [a, b, cSerialized, d]);
302
+ await methodChannelToNative.invokeMethod <void >('MyTestModule_parameterizedMethod ' , [a, b, cSerialized, d]);
288
303
}
289
304
Future <DateTime > localDateTimeMethod (DateTime localDateTime) async {
290
305
if (localDateTime.isUtc) throw ArgumentError ('localDateTime must not be in UTC' );
291
306
final localDateTimeSerialized = localDateTime.toIso8601String ();
292
307
final invokeResult = await methodChannelToNative.invokeMethod <String >(
293
- 'localDateTimeMethod ' ,
308
+ 'MyTestModule_localDateTimeMethod ' ,
294
309
[localDateTimeSerialized],
295
310
);
296
311
@@ -305,7 +320,7 @@ final localDateTimeSerialized = localDateTime.toIso8601String();
305
320
Future <TimeOfDay > localTimeMethod (TimeOfDay localTime) async {
306
321
final localTimeSerialized = "${localTime .hour .toString ().padLeft (2 , '0' )}:${localTime .minute .toString ().padLeft (2 , '0' )}" ;
307
322
final invokeResult = await methodChannelToNative.invokeMethod <String >(
308
- 'localTimeMethod ' ,
323
+ 'MyTestModule_localTimeMethod ' ,
309
324
[localTimeSerialized],
310
325
);
311
326
@@ -321,7 +336,7 @@ Future<DateTime> localDateMethod(DateTime localDate) async {
321
336
if (localDate.isUtc) throw ArgumentError ('localDate must not be in UTC' );
322
337
final localDateSerialized = localDate.toIso8601String ().split ('T' ).first;
323
338
final invokeResult = await methodChannelToNative.invokeMethod <String >(
324
- 'localDateMethod ' ,
339
+ 'MyTestModule_localDateMethod ' ,
325
340
[localDateSerialized],
326
341
);
327
342
@@ -336,7 +351,7 @@ final localDateSerialized = localDate.toIso8601String().split('T').first;
336
351
Future <Duration > durationMethod (Duration duration) async {
337
352
final durationSerialized = duration.toIso8601String ();
338
353
final invokeResult = await methodChannelToNative.invokeMethod <String >(
339
- 'durationMethod ' ,
354
+ 'MyTestModule_durationMethod ' ,
340
355
[durationSerialized],
341
356
);
342
357
@@ -352,7 +367,7 @@ Future<DateTime> instantMethod(DateTime instant) async {
352
367
if (! instant.isUtc) throw ArgumentError ('instant must be in UTC' );
353
368
final instantSerialized = instant.toIso8601String ();
354
369
final invokeResult = await methodChannelToNative.invokeMethod <String >(
355
- 'instantMethod ' ,
370
+ 'MyTestModule_instantMethod ' ,
356
371
[instantSerialized],
357
372
);
358
373
@@ -367,7 +382,7 @@ final instantSerialized = instant.toIso8601String();
367
382
Future <List <String >> stringListMethod (List <String > list) async {
368
383
final listSerialized = jsonEncode (list.map ((e) => e).toList ());
369
384
final invokeResult = await methodChannelToNative.invokeMethod <String >(
370
- 'stringListMethod ' ,
385
+ 'MyTestModule_stringListMethod ' ,
371
386
[listSerialized],
372
387
);
373
388
@@ -384,7 +399,7 @@ return element as String;
384
399
Future <List <List <String >>> nestedListMethod (List <List <String >> list) async {
385
400
final listSerialized = jsonEncode (list.map ((e) => e.map ((e) => e).toList ()).toList ());
386
401
final invokeResult = await methodChannelToNative.invokeMethod <String >(
387
- 'nestedListMethod ' ,
402
+ 'MyTestModule_nestedListMethod ' ,
388
403
[listSerialized],
389
404
);
390
405
@@ -403,7 +418,7 @@ return element as String;
403
418
Future <List <MyDataClass >> dataClassListMethod (List <MyDataClass > list) async {
404
419
final listSerialized = jsonEncode (list.map ((e) => e).toList ());
405
420
final invokeResult = await methodChannelToNative.invokeMethod <String >(
406
- 'dataClassListMethod ' ,
421
+ 'MyTestModule_dataClassListMethod ' ,
407
422
[listSerialized],
408
423
);
409
424
@@ -420,7 +435,7 @@ return MyDataClass.fromJson(element);
420
435
Future <List <List <MyDataClass >>> nestedDataClassListMethod (List <List <MyDataClass >> list) async {
421
436
final listSerialized = jsonEncode (list.map ((e) => e.map ((e) => e).toList ()).toList ());
422
437
final invokeResult = await methodChannelToNative.invokeMethod <String >(
423
- 'nestedDataClassListMethod ' ,
438
+ 'MyTestModule_nestedDataClassListMethod ' ,
424
439
[listSerialized],
425
440
);
426
441
@@ -439,7 +454,7 @@ return MyDataClass.fromJson(element);
439
454
Future <Map <String , int >> mapMethod (Map <String , int > map) async {
440
455
final mapSerialized = jsonEncode (map.map ((k, v) => MapEntry (k, v)));
441
456
final invokeResult = await methodChannelToNative.invokeMethod <String >(
442
- 'mapMethod ' ,
457
+ 'MyTestModule_mapMethod ' ,
443
458
[mapSerialized],
444
459
);
445
460
@@ -456,7 +471,7 @@ return MapEntry(key, value as int);
456
471
Future <MyDataObject > objectMethod (MyDataObject obj) async {
457
472
final objSerialized = jsonEncode (obj.toJson ());
458
473
final invokeResult = await methodChannelToNative.invokeMethod <String >(
459
- 'objectMethod ' ,
474
+ 'MyTestModule_objectMethod ' ,
460
475
[objSerialized],
461
476
);
462
477
@@ -471,7 +486,7 @@ Future<MyDataObject> objectMethod(MyDataObject obj) async {
471
486
Future <MySealedData > sealedMethod (MySealedData obj) async {
472
487
final objSerialized = jsonEncode (MySealedData .toJson (obj));
473
488
final invokeResult = await methodChannelToNative.invokeMethod <String >(
474
- 'sealedMethod ' ,
489
+ 'MyTestModule_sealedMethod ' ,
475
490
[objSerialized],
476
491
);
477
492
@@ -486,7 +501,7 @@ Future<MySealedData> sealedMethod(MySealedData obj) async {
486
501
Future <MyDateClass > dateClassMethod (MyDateClass obj) async {
487
502
final objSerialized = jsonEncode (obj.toJson ());
488
503
final invokeResult = await methodChannelToNative.invokeMethod <String >(
489
- 'dateClassMethod ' ,
504
+ 'MyTestModule_dateClassMethod ' ,
490
505
[objSerialized],
491
506
);
492
507
@@ -501,7 +516,7 @@ Future<MyDateClass> dateClassMethod(MyDateClass obj) async {
501
516
Future <MySealedDataWithProps > sealedWithPropsMethod (MySealedDataWithProps obj) async {
502
517
final objSerialized = jsonEncode (MySealedDataWithProps .toJson (obj));
503
518
final invokeResult = await methodChannelToNative.invokeMethod <String >(
504
- 'sealedWithPropsMethod ' ,
519
+ 'MyTestModule_sealedWithPropsMethod ' ,
505
520
[objSerialized],
506
521
);
507
522
@@ -516,7 +531,7 @@ Future<MySealedDataWithProps> sealedWithPropsMethod(MySealedDataWithProps obj) a
516
531
Future <MyDataClassWithSealed > classWithSealedPropMethod (MyDataClassWithSealed obj) async {
517
532
final objSerialized = jsonEncode (obj.toJson ());
518
533
final invokeResult = await methodChannelToNative.invokeMethod <String >(
519
- 'classWithSealedPropMethod ' ,
534
+ 'MyTestModule_classWithSealedPropMethod ' ,
520
535
[objSerialized],
521
536
);
522
537
@@ -531,7 +546,7 @@ Future<MyDataClassWithSealed> classWithSealedPropMethod(MyDataClassWithSealed ob
531
546
Future <MyEnum > enumMethod (MyEnum entry) async {
532
547
final entrySerialized = jsonEncode (entry.name);;
533
548
final invokeResult = await methodChannelToNative.invokeMethod <String >(
534
- 'enumMethod ' ,
549
+ 'MyTestModule_enumMethod ' ,
535
550
[entrySerialized],
536
551
);
537
552
@@ -546,7 +561,7 @@ Future<MyEnum> enumMethod(MyEnum entry) async {
546
561
Future <List <MyEnum >> enumListMethod (List <MyEnum > entries) async {
547
562
final entriesSerialized = jsonEncode (entries.map ((e) => e.name).toList ());
548
563
final invokeResult = await methodChannelToNative.invokeMethod <String >(
549
- 'enumListMethod ' ,
564
+ 'MyTestModule_enumListMethod ' ,
550
565
[entriesSerialized],
551
566
);
552
567
@@ -563,7 +578,7 @@ return MyEnum.values.byName(element);
563
578
Future <Map <String , MyEnum >> enumMapMethod (Map <String , MyEnum > entries) async {
564
579
final entriesSerialized = jsonEncode (entries.map ((k, v) => MapEntry (k, v.name)));
565
580
final invokeResult = await methodChannelToNative.invokeMethod <String >(
566
- 'enumMapMethod ' ,
581
+ 'MyTestModule_enumMapMethod ' ,
567
582
[entriesSerialized],
568
583
);
569
584
@@ -580,7 +595,7 @@ return MapEntry(key, MyEnum.values.byName(value));
580
595
Future <Map <String , List <Map <String , MyDataClass >>>> mixedMethod (Map <String , List <Map <String , MyDataClass >>> map) async {
581
596
final mapSerialized = jsonEncode (map.map ((k, v) => MapEntry (k, v.map ((e) => e.map ((k, v) => MapEntry (k, v))).toList ())));
582
597
final invokeResult = await methodChannelToNative.invokeMethod <String >(
583
- 'mixedMethod ' ,
598
+ 'MyTestModule_mixedMethod ' ,
584
599
[mapSerialized],
585
600
);
586
601
@@ -601,7 +616,7 @@ return MapEntry(key, MyDataClass.fromJson(value));
601
616
Future <MyDataClass > dataClassMethod (MyDataClass data) async {
602
617
final dataSerialized = jsonEncode (data.toJson ());
603
618
final invokeResult = await methodChannelToNative.invokeMethod <String >(
604
- 'dataClassMethod ' ,
619
+ 'MyTestModule_dataClassMethod ' ,
605
620
[dataSerialized],
606
621
);
607
622
@@ -615,12 +630,12 @@ Future<MyDataClass> dataClassMethod(MyDataClass data) async {
615
630
}
616
631
Future <void > suspendUnitMethod () async {
617
632
618
- await methodChannelToNative.invokeMethod <void >('suspendUnitMethod ' , []);
633
+ await methodChannelToNative.invokeMethod <void >('MyTestModule_suspendUnitMethod ' , []);
619
634
}
620
635
Future <String > suspendStringMethod () async {
621
636
622
637
final invokeResult = await methodChannelToNative.invokeMethod <String >(
623
- 'suspendStringMethod ' ,
638
+ 'MyTestModule_suspendStringMethod ' ,
624
639
[],
625
640
);
626
641
0 commit comments