From 5a9c6adfda83a50c2566bc0651374c6b3d820292 Mon Sep 17 00:00:00 2001
From: projectuser <projectuser@leon056.com>
Date: 星期五, 26 十一月 2021 14:28:20 +0800
Subject: [PATCH] init

---
 darwin/Classes/FLTPackageInfoPlugin.m |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/darwin/Classes/FLTPackageInfoPlugin.m b/darwin/Classes/FLTPackageInfoPlugin.m
new file mode 100644
index 0000000..046f15f
--- /dev/null
+++ b/darwin/Classes/FLTPackageInfoPlugin.m
@@ -0,0 +1,32 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "FLTPackageInfoPlugin.h"
+
+@implementation FLTPackageInfoPlugin
++ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
+  FlutterMethodChannel* channel =
+      [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/package_info"
+                                  binaryMessenger:[registrar messenger]];
+  FLTPackageInfoPlugin* instance = [[FLTPackageInfoPlugin alloc] init];
+  [registrar addMethodCallDelegate:instance channel:channel];
+}
+
+- (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
+  if ([call.method isEqualToString:@"getAll"]) {
+    result(@{
+      @"appName" : [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]
+          ?: [NSNull null],
+      @"packageName" : [[NSBundle mainBundle] bundleIdentifier] ?: [NSNull null],
+      @"version" : [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]
+          ?: [NSNull null],
+      @"buildNumber" : [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]
+          ?: [NSNull null],
+    });
+  } else {
+    result(FlutterMethodNotImplemented);
+  }
+}
+
+@end

--
Gitblit v1.8.0