AMapFlutterFactory.m 1000 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // AMapFlutterFactory.m
  3. // amap_flutter_map
  4. //
  5. // Created by lly on 2020/10/29.
  6. //
  7. #import "AMapFlutterFactory.h"
  8. #import <MAMapKit/MAMapKit.h>
  9. #import "AMapViewController.h"
  10. @implementation AMapFlutterFactory {
  11. NSObject<FlutterPluginRegistrar>* _registrar;
  12. }
  13. - (instancetype)initWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
  14. self = [super init];
  15. if (self) {
  16. _registrar = registrar;
  17. }
  18. return self;
  19. }
  20. - (NSObject<FlutterMessageCodec>*)createArgsCodec {
  21. return [FlutterStandardMessageCodec sharedInstance];
  22. }
  23. - (NSObject<FlutterPlatformView>*)createWithFrame:(CGRect)frame
  24. viewIdentifier:(int64_t)viewId
  25. arguments:(id _Nullable)args {
  26. return [[AMapViewController alloc] initWithFrame:frame
  27. viewIdentifier:viewId
  28. arguments:args
  29. registrar:_registrar];
  30. }
  31. @end