This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -17,11 +17,18 @@ @interface MockFLTThreadSafeFlutterResult : FLTThreadSafeFlutterResult
17
17
@end
18
18
19
19
@implementation MockFLTThreadSafeFlutterResult
20
+ /* *
21
+ Initialize with a notification center.
22
+ */
20
23
- (id )initWithNotificationCenter : (NSNotificationCenter *)notificationCenter {
21
24
self = [super init ];
22
25
_notificationCenter = notificationCenter;
23
26
return self;
24
27
}
28
+
29
+ /* *
30
+ Called when result is successful. Sends "successWithData" to the notification center.
31
+ */
25
32
- (void )successWithData : (id )data {
26
33
_receivedResult = data;
27
34
[self ->_notificationCenter postNotificationName: @" successWithData" object: nil ];
Original file line number Diff line number Diff line change 4
4
5
5
#import < Flutter/Flutter.h>
6
6
7
+ /* *
8
+ Wrapper object that always delivers the result on the main thread.
9
+ */
7
10
@interface FLTThreadSafeFlutterResult : NSObject
11
+
12
+ /* *
13
+ Initialize with a FlutterResult object.
14
+ @param result The FlutterResult object that the result will be given to.
15
+ */
8
16
- (id _Nonnull)initWithResult : (FlutterResult _Nonnull)result ;
17
+
18
+ /* *
19
+ Send a successful result without any data.
20
+ */
9
21
- (void )success ;
22
+
23
+ /* *
24
+ Send a successful result with data.
25
+ @param data Result data that is send to the Flutter Dart side.
26
+ */
10
27
- (void )successWithData : (id _Nonnull)data ;
28
+
29
+ /* *
30
+ Send an error as result
31
+ @param error Error that will be send as FlutterError.
32
+ */
11
33
- (void )error : (NSError * _Nonnull)error ;
12
- - (void )notImplemented ;
34
+
35
+ /* *
36
+ Send a FlutterError as result.
37
+ */
13
38
- (void )errorWithCode : (NSString * _Nonnull)code
14
39
message : (NSString * _Nullable)message
15
40
details : (id _Nullable)details ;
41
+
42
+ /* *
43
+ Send FlutterMethodNotImplemented as result.
44
+ */
45
+ - (void )notImplemented ;
16
46
@end
You can’t perform that action at this time.
0 commit comments