Skip to content

Commit

Permalink
Clang Format
Browse files Browse the repository at this point in the history
  • Loading branch information
runner authored and runner committed Nov 23, 2021
1 parent e9cd912 commit d27fe9e
Show file tree
Hide file tree
Showing 4 changed files with 587 additions and 566 deletions.
4 changes: 2 additions & 2 deletions flutter_local_notifications/ios/Classes/ActionEventSink.h
Expand Up @@ -11,9 +11,9 @@

NS_ASSUME_NONNULL_BEGIN

@interface ActionEventSink : NSObject<FlutterStreamHandler>
@interface ActionEventSink : NSObject <FlutterStreamHandler>

- (void)addItem:(NSDictionary*)item;
- (void)addItem:(NSDictionary *)item;

@end

Expand Down
57 changes: 28 additions & 29 deletions flutter_local_notifications/ios/Classes/ActionEventSink.m
Expand Up @@ -8,48 +8,47 @@
#import "ActionEventSink.h"

@interface ActionEventSink () {
NSMutableArray<NSDictionary*>* cache;
FlutterEventSink eventSink;
NSMutableArray<NSDictionary *> *cache;
FlutterEventSink eventSink;
}

@end

@implementation ActionEventSink

- (instancetype)init
{
self = [super init];
if (self) {
cache = [NSMutableArray array];
}
return self;
- (instancetype)init {
self = [super init];
if (self) {
cache = [NSMutableArray array];
}
return self;
}

- (void)addItem:(NSDictionary *)item {
if (eventSink) {
eventSink(item);
} else {
[cache addObject:item];
}
if (eventSink) {
eventSink(item);
} else {
[cache addObject:item];
}
}

- (FlutterError * _Nullable)onListenWithArguments:(id _Nullable)arguments
eventSink:(nonnull FlutterEventSink)events {
for (NSDictionary* item in cache) {
events(item);
}
[cache removeAllObjects];

eventSink = events;

return nil;
}
- (FlutterError *_Nullable)onListenWithArguments:(id _Nullable)arguments
eventSink:
(nonnull FlutterEventSink)events {
for (NSDictionary *item in cache) {
events(item);
}
[cache removeAllObjects];

eventSink = events;

- (FlutterError * _Nullable)onCancelWithArguments:(id _Nullable)arguments {
eventSink = nil;

return nil;
return nil;
}

- (FlutterError *_Nullable)onCancelWithArguments:(id _Nullable)arguments {
eventSink = nil;

return nil;
}

@end
Expand Up @@ -2,5 +2,5 @@
#import <UserNotifications/UserNotifications.h>

@interface FlutterLocalNotificationsPlugin : NSObject <FlutterPlugin>
+ (void)setRegisterPlugins:(FlutterPluginRegistrantCallback*)callback;
+ (void)setRegisterPlugins:(FlutterPluginRegistrantCallback *)callback;
@end

0 comments on commit d27fe9e

Please sign in to comment.