@@ -10,40 +10,36 @@ class EventsInternal implements Events {
1010 final CountlyState _countlyState;
1111
1212 @override
13- Future <String ? > recordEvent (String key, [Map <String , Object >? segmentation, int ? count, double ? sum, int ? duration]) async {
14- return _internalEventMethodCall (key, 'recordEvent' , segmentation, count ?? 1 , sum ?? 0 , duration ?? 0 );
13+ Future <void > recordEvent (String key, [Map <String , Object >? segmentation, int ? count, double ? sum, int ? duration]) async {
14+ await _internalEventMethodCall (key, 'recordEvent' , segmentation, count ?? 1 , sum ?? 0 , duration ?? 0 );
1515 }
1616
1717 @override
18- Future <String ? > startEvent (String key) async {
19- return _internalEventMethodCall (key, 'startEvent' );
18+ Future <void > startEvent (String key) async {
19+ await _internalEventMethodCall (key, 'startEvent' );
2020 }
2121
2222 @override
23- Future <String ? > endEvent (String key, [Map <String , Object >? segmentation, int ? count, double ? sum]) async {
24- return _internalEventMethodCall (key, 'endEvent' , segmentation, count ?? 1 , sum ?? 0 );
23+ Future <void > endEvent (String key, [Map <String , Object >? segmentation, int ? count, double ? sum]) async {
24+ await _internalEventMethodCall (key, 'endEvent' , segmentation, count ?? 1 , sum ?? 0 );
2525 }
2626
2727 @override
28- Future <String ? > cancelEvent (String key) async {
29- return _internalEventMethodCall (key, 'cancelEvent' );
28+ Future <void > cancelEvent (String key) async {
29+ await _internalEventMethodCall (key, 'cancelEvent' );
3030 }
3131
32- Future <String ? > _internalEventMethodCall (String key, String method, [Map <String , Object >? segmentation, int ? count, double ? sum, int ? duration]) async {
32+ Future <void > _internalEventMethodCall (String key, String method, [Map <String , Object >? segmentation, int ? count, double ? sum, int ? duration]) async {
3333 List <Object ?> args = [];
3434
3535 if (! _countlyState.isInitialized) {
36- String message = '"initWithConfig" must be called before "$method "' ;
37- Countly .log ('[EventsInternal] $method , $message ' , logLevel: LogLevel .ERROR );
38- return message;
36+ Countly .log ('[EventsInternal] $method , "initWithConfig" must be called' , logLevel: LogLevel .ERROR );
3937 }
4038
4139 Countly .log ('[EventsInternal] $method , key:[$key ] segmentation:[$segmentation ] count:[$count ] sum:[$sum ] duration:[$duration ]' );
4240
4341 if (key.isEmpty) {
44- String error = '$method , key name is required' ;
45- Countly .log ('[EventsInternal] $method , $error ' );
46- return 'Error : $error ' ;
42+ Countly .log ('[EventsInternal] $method , key name is required' );
4743 }
4844
4945 args.add (key);
@@ -53,7 +49,6 @@ class EventsInternal implements Events {
5349 args.add (segmentation);
5450
5551 final String ? result = await _countlyState.channel.invokeMethod (method, < String , dynamic > {'data' : json.encode (args.where ((item) => item != null ).toList ())});
56-
57- return result;
52+ Countly .log ('[EventsInternal] $method , result:[$result ]' );
5853 }
5954}
0 commit comments