AMapFlutterFactory.m 1020 Bytes
Newer Older
houziyu's avatar
houziyu committed
1 2 3 4 5 6 7 8
//
//  AMapFlutterFactory.m
//  amap_flutter_map
//
//  Created by lly on 2020/10/29.
//

#import "AMapFlutterFactory.h"
9
#include <AMapNaviKit/MAMapKit.h>
houziyu's avatar
houziyu committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
#import "AMapViewController.h"

@implementation AMapFlutterFactory {
    NSObject<FlutterPluginRegistrar>* _registrar;
}

- (instancetype)initWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
    self = [super init];
    if (self) {
        _registrar = registrar;
    }
    return self;
}

- (NSObject<FlutterMessageCodec>*)createArgsCodec {
    return [FlutterStandardMessageCodec sharedInstance];
}

- (NSObject<FlutterPlatformView>*)createWithFrame:(CGRect)frame
                                   viewIdentifier:(int64_t)viewId
                                        arguments:(id _Nullable)args {
    return [[AMapViewController alloc] initWithFrame:frame
                                      viewIdentifier:viewId
                                           arguments:args
                                           registrar:_registrar];
}
@end