Skip to content

Commit 3d44e47

Browse files
committed
chore: Update code
1 parent 41e2731 commit 3d44e47

15 files changed

Lines changed: 35 additions & 40 deletions

File tree

packages/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@
341341
"$(inherited)",
342342
"@executable_path/Frameworks",
343343
);
344-
PRODUCT_BUNDLE_IDENTIFIER = com.example.googleMlKitExample;
344+
PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)";
345345
PRODUCT_NAME = "$(TARGET_NAME)";
346346
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
347347
SWIFT_VERSION = 5.0;
@@ -482,7 +482,7 @@
482482
"$(inherited)",
483483
"@executable_path/Frameworks",
484484
);
485-
PRODUCT_BUNDLE_IDENTIFIER = com.example.googleMlKitExample;
485+
PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)";
486486
PRODUCT_NAME = "$(TARGET_NAME)";
487487
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
488488
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -505,7 +505,7 @@
505505
"$(inherited)",
506506
"@executable_path/Frameworks",
507507
);
508-
PRODUCT_BUNDLE_IDENTIFIER = com.example.googleMlKitExample;
508+
PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)";
509509
PRODUCT_NAME = "$(TARGET_NAME)";
510510
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
511511
SWIFT_VERSION = 5.0;

packages/google_mlkit_barcode_scanning/ios/google_mlkit_barcode_scanning/Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let package = Package(
1717
.package(
1818
url: "https://github.com/d-date/google-mlkit-swiftpm",
1919
from: "9.0.0"
20-
),
20+
)
2121
],
2222
targets: [
2323
.target(
@@ -27,7 +27,7 @@ let package = Package(
2727
// Note: The `package` value uses the DIRECTORY name ("google_mlkit_commons"), not the
2828
// Package.swift `name` field ("google-mlkit-commons"). For local path dependencies, SPM
2929
// derives the package identity from the directory name, not the `name` field.
30-
.product(name: "google-mlkit-commons", package: "google_mlkit_commons"),
30+
.product(name: "google-mlkit-commons", package: "google_mlkit_commons")
3131
],
3232
path: "Sources/google_mlkit_barcode_scanning"
3333
)

packages/google_mlkit_digital_ink_recognition/ios/google_mlkit_digital_ink_recognition/Sources/google_mlkit_digital_ink_recognition/GoogleMlKitDigitalInkRecognitionPlugin.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ public class GoogleMlKitDigitalInkRecognitionPlugin: NSObject, FlutterPlugin {
121121
var writingArea: WritingArea?
122122
if let writingAreaMap = ctx["writingArea"] as? [String: Any],
123123
let width = writingAreaMap["width"] as? NSNumber,
124-
let height = writingAreaMap["height"] as? NSNumber
125-
{
124+
let height = writingAreaMap["height"] as? NSNumber {
126125
writingArea = WritingArea(width: width.floatValue, height: height.floatValue)
127126
}
128127
context = DigitalInkRecognitionContext(
@@ -147,7 +146,7 @@ public class GoogleMlKitDigitalInkRecognitionPlugin: NSObject, FlutterPlugin {
147146
let candidates = recognitionResult.candidates.map { candidate in
148147
[
149148
"text": candidate.text,
150-
"score": candidate.score?.doubleValue ?? 0,
149+
"score": candidate.score?.doubleValue ?? 0
151150
] as [String: Any]
152151
}
153152
result(candidates)

packages/google_mlkit_entity_extraction/ios/google_mlkit_entity_extraction/Sources/google_mlkit_entity_extraction/GoogleMlKitEntityExtractionPlugin.swift

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ public class GoogleMlKitEntityExtractionPlugin: NSObject, FlutterPlugin {
9292
if let locale = valueAsString(parameters["locale"]), !locale.isEmpty {
9393
params.preferredLocale = Locale(identifier: locale)
9494
}
95-
if let filtersValues = valueAsNumberArray(parameters["filters"]), !filtersValues.isEmpty
96-
{
95+
if let filtersValues = valueAsNumberArray(parameters["filters"]), !filtersValues.isEmpty {
9796
let filters: Set<EntityType> = Set(
9897
filtersValues.compactMap { numberToEntityType($0.intValue) })
9998
params.typesFilter = filters
@@ -129,7 +128,7 @@ public class GoogleMlKitEntityExtractionPlugin: NSObject, FlutterPlugin {
129128
"text": substring,
130129
"start": range.location,
131130
"end": range.location + range.length,
132-
"entities": entities,
131+
"entities": entities
133132
]
134133
}
135134
result(allAnnotations)
@@ -157,14 +156,13 @@ public class GoogleMlKitEntityExtractionPlugin: NSObject, FlutterPlugin {
157156
private func entityToDictionary(text: String, entity: Entity) -> [String: Any] {
158157
var entityData: [String: Any] = [
159158
"type": entityTypeToNumber(entity.entityType),
160-
"raw": String(describing: entity),
159+
"raw": String(describing: entity)
161160
]
162161
if entity.entityType == .dateTime, let dateTimeEntity = entity.dateTimeEntity {
163162
entityData["dateTimeGranularity"] = dateTimeEntity.dateTimeGranularity.rawValue
164163
entityData["timestamp"] = dateTimeEntity.dateTime.timeIntervalSince1970 * 1000
165164
} else if entity.entityType == .flightNumber,
166-
let flightEntity = entity.flightNumberEntity
167-
{
165+
let flightEntity = entity.flightNumberEntity {
168166
entityData["code"] = flightEntity.airlineCode
169167
entityData["number"] = flightEntity.flightNumber
170168
} else if entity.entityType == .IBAN, let ibanEntity = entity.ibanEntity {
@@ -176,8 +174,7 @@ public class GoogleMlKitEntityExtractionPlugin: NSObject, FlutterPlugin {
176174
entityData["network"] = cardEntity.paymentCardNetwork.rawValue
177175
entityData["number"] = cardEntity.paymentCardNumber
178176
} else if entity.entityType == .trackingNumber,
179-
let trackingEntity = entity.trackingNumberEntity
180-
{
177+
let trackingEntity = entity.trackingNumberEntity {
181178
entityData["carrier"] = trackingEntity.parcelCarrier.rawValue
182179
entityData["number"] = trackingEntity.parcelTrackingNumber
183180
} else if entity.entityType == .money, let moneyEntity = entity.moneyEntity {

packages/google_mlkit_face_detection/ios/google_mlkit_face_detection/Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let package = Package(
1717
.package(
1818
url: "https://github.com/d-date/google-mlkit-swiftpm",
1919
from: "9.0.0"
20-
),
20+
)
2121
],
2222
targets: [
2323
.target(
@@ -27,7 +27,7 @@ let package = Package(
2727
// Note: The `package` value uses the DIRECTORY name ("google_mlkit_commons"), not the
2828
// Package.swift `name` field ("google-mlkit-commons"). For local path dependencies, SPM
2929
// derives the package identity from the directory name, not the `name` field.
30-
.product(name: "google-mlkit-commons", package: "google_mlkit_commons"),
30+
.product(name: "google-mlkit-commons", package: "google_mlkit_commons")
3131
],
3232
path: "Sources/google_mlkit_face_detection"
3333
)

packages/google_mlkit_image_labeling/ios/google_mlkit_image_labeling/Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let package = Package(
1717
.package(
1818
url: "https://github.com/d-date/google-mlkit-swiftpm",
1919
from: "9.0.0"
20-
),
20+
)
2121
],
2222
targets: [
2323
.target(
@@ -28,7 +28,7 @@ let package = Package(
2828
// Note: The `package` value uses the DIRECTORY name ("google_mlkit_commons"), not the
2929
// Package.swift `name` field ("google-mlkit-commons"). For local path dependencies, SPM
3030
// derives the package identity from the directory name, not the `name` field.
31-
.product(name: "google-mlkit-commons", package: "google_mlkit_commons"),
31+
.product(name: "google-mlkit-commons", package: "google_mlkit_commons")
3232
],
3333
path: "Sources/google_mlkit_image_labeling"
3434
)

packages/google_mlkit_image_labeling/ios/google_mlkit_image_labeling/Sources/google_mlkit_image_labeling/GoogleMlKitImageLabelingPlugin.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public class GoogleMlKitImageLabelingPlugin: NSObject, FlutterPlugin {
149149
[
150150
"confidence": label.confidence,
151151
"index": label.index,
152-
"text": label.text,
152+
"text": label.text
153153
] as [String: Any]
154154
}
155155
result(labelData)

packages/google_mlkit_language_id/ios/google_mlkit_language_id/Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let package = Package(
1717
.package(
1818
url: "https://github.com/d-date/google-mlkit-swiftpm",
1919
from: "9.0.0"
20-
),
20+
)
2121
],
2222
targets: [
2323
.target(
@@ -27,7 +27,7 @@ let package = Package(
2727
// Note: The `package` value uses the DIRECTORY name ("google_mlkit_commons"), not the
2828
// Package.swift `name` field ("google-mlkit-commons"). For local path dependencies, SPM
2929
// derives the package identity from the directory name, not the `name` field.
30-
.product(name: "google-mlkit-commons", package: "google_mlkit_commons"),
30+
.product(name: "google-mlkit-commons", package: "google_mlkit_commons")
3131
],
3232
path: "Sources/google_mlkit_language_id"
3333
)

packages/google_mlkit_object_detection/ios/google_mlkit_object_detection/Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let package = Package(
1717
.package(
1818
url: "https://github.com/d-date/google-mlkit-swiftpm",
1919
from: "9.0.0"
20-
),
20+
)
2121
],
2222
targets: [
2323
.target(
@@ -28,7 +28,7 @@ let package = Package(
2828
// Note: The `package` value uses the DIRECTORY name ("google_mlkit_commons"), not the
2929
// Package.swift `name` field ("google-mlkit-commons"). For local path dependencies, SPM
3030
// derives the package identity from the directory name, not the `name` field.
31-
.product(name: "google-mlkit-commons", package: "google_mlkit_commons"),
31+
.product(name: "google-mlkit-commons", package: "google_mlkit_commons")
3232
],
3333
path: "Sources/google_mlkit_object_detection"
3434
)

packages/google_mlkit_object_detection/ios/google_mlkit_object_detection/Sources/google_mlkit_object_detection/GoogleMlKitObjectDetectionPlugin.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,17 @@ public class GoogleMlKitObjectDetectionPlugin: NSObject, FlutterPlugin {
9797
[
9898
"index": label.index,
9999
"text": label.text,
100-
"confidence": label.confidence,
100+
"confidence": label.confidence
101101
] as [String: Any]
102102
}
103103
var data: [String: Any] = [
104104
"rect": [
105105
"left": Double(object.frame.origin.x),
106106
"top": Double(object.frame.origin.y),
107107
"right": Double(object.frame.origin.x + object.frame.size.width),
108-
"bottom": Double(object.frame.origin.y + object.frame.size.height),
108+
"bottom": Double(object.frame.origin.y + object.frame.size.height)
109109
] as [String: Double],
110-
"labels": labels,
110+
"labels": labels
111111
]
112112
if let trackingID = object.trackingID {
113113
data["trackingId"] = trackingID
@@ -119,8 +119,7 @@ public class GoogleMlKitObjectDetectionPlugin: NSObject, FlutterPlugin {
119119
}
120120

121121
private func createDetector(from dictionary: [String: Any], result: @escaping FlutterResult)
122-
-> ObjectDetector?
123-
{
122+
-> ObjectDetector? {
124123
let type = dictionary["type"] as? String ?? "base"
125124
switch type {
126125
case "base":

0 commit comments

Comments
 (0)