Skip to content

Commit 0a69259

Browse files
authored
[local_auth]: Renamed local_auth_ios to local_auth_darwin (flutter#5809)
Renames `local_auth_ios` to `local_auth_darwin` resolves flutter#141020 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
1 parent b58b33c commit 0a69259

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+95
-190
lines changed

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ packages/google_sign_in/google_sign_in_ios/** @vashworth
8888
packages/image_picker/image_picker_ios/** @vashworth
8989
packages/in_app_purchase/in_app_purchase_storekit/** @louisehsu
9090
packages/ios_platform_images/** @jmagman
91-
packages/local_auth/local_auth_ios/** @louisehsu
91+
packages/local_auth/local_auth_darwin/** @louisehsu
9292
packages/path_provider/path_provider_foundation/** @jmagman
9393
packages/pointer_interceptor/pointer_interceptor_ios/** @ditman
9494
packages/quick_actions/quick_actions_ios/** @hellohuanlin

packages/local_auth/local_auth_ios/AUTHORS renamed to packages/local_auth/local_auth_darwin/AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,4 @@ Anton Borries <[email protected]>
6565
6666
Rahul Raj <[email protected]>
6767
Bodhi Mulders <[email protected]>
68+
Om Phatak <[email protected]>
Lines changed: 3 additions & 0 deletions

packages/local_auth/local_auth_ios/README.md renamed to packages/local_auth/local_auth_darwin/README.md

Lines changed: 1 addition & 1 deletion

packages/local_auth/local_auth_ios/ios/Classes/messages.g.h renamed to packages/local_auth/local_auth_darwin/darwin/Classes/messages.g.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2013 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
4-
// Autogenerated from Pigeon (v13.0.0), do not edit directly.
4+
// Autogenerated from Pigeon (v13.1.2), do not edit directly.
55
// See also: https://pub.dev/packages/pigeon
66

77
#import <Foundation/Foundation.h>

packages/local_auth/local_auth_ios/ios/Classes/messages.g.m renamed to packages/local_auth/local_auth_darwin/darwin/Classes/messages.g.m

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2013 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
4-
// Autogenerated from Pigeon (v13.0.0), do not edit directly.
4+
// Autogenerated from Pigeon (v13.1.2), do not edit directly.
55
// See also: https://pub.dev/packages/pigeon
66

77
#import "messages.g.h"
@@ -16,6 +16,20 @@
1616
#error File requires ARC to be enabled.
1717
#endif
1818

19+
static NSArray *wrapResult(id result, FlutterError *error) {
20+
if (error) {
21+
return @[
22+
error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null]
23+
];
24+
}
25+
return @[ result ?: [NSNull null] ];
26+
}
27+
28+
static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) {
29+
id result = array[key];
30+
return (result == [NSNull null]) ? nil : result;
31+
}
32+
1933
/// Possible outcomes of an authentication attempt.
2034
@implementation FLAAuthResultBox
2135
- (instancetype)initWithValue:(FLAAuthResult)value {
@@ -38,19 +52,6 @@ - (instancetype)initWithValue:(FLAAuthBiometric)value {
3852
}
3953
@end
4054

41-
static NSArray *wrapResult(id result, FlutterError *error) {
42-
if (error) {
43-
return @[
44-
error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null]
45-
];
46-
}
47-
return @[ result ?: [NSNull null] ];
48-
}
49-
static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) {
50-
id result = array[key];
51-
return (result == [NSNull null]) ? nil : result;
52-
}
53-
5455
@interface FLAAuthStrings ()
5556
+ (FLAAuthStrings *)fromList:(NSArray *)list;
5657
+ (nullable FLAAuthStrings *)nullableFromList:(NSArray *)list;
@@ -263,7 +264,7 @@ void SetUpFLALocalAuthApi(id<FlutterBinaryMessenger> binaryMessenger,
263264
/// Returns true if this device supports authentication.
264265
{
265266
FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc]
266-
initWithName:@"dev.flutter.pigeon.local_auth_ios.LocalAuthApi.isDeviceSupported"
267+
initWithName:@"dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.isDeviceSupported"
267268
binaryMessenger:binaryMessenger
268269
codec:FLALocalAuthApiGetCodec()];
269270
if (api) {
@@ -284,7 +285,8 @@ void SetUpFLALocalAuthApi(id<FlutterBinaryMessenger> binaryMessenger,
284285
/// any biometrics are enrolled or not.
285286
{
286287
FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc]
287-
initWithName:@"dev.flutter.pigeon.local_auth_ios.LocalAuthApi.deviceCanSupportBiometrics"
288+
initWithName:
289+
@"dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.deviceCanSupportBiometrics"
288290
binaryMessenger:binaryMessenger
289291
codec:FLALocalAuthApiGetCodec()];
290292
if (api) {
@@ -305,7 +307,7 @@ void SetUpFLALocalAuthApi(id<FlutterBinaryMessenger> binaryMessenger,
305307
/// without additional setup.
306308
{
307309
FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc]
308-
initWithName:@"dev.flutter.pigeon.local_auth_ios.LocalAuthApi.getEnrolledBiometrics"
310+
initWithName:@"dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.getEnrolledBiometrics"
309311
binaryMessenger:binaryMessenger
310312
codec:FLALocalAuthApiGetCodec()];
311313
if (api) {
@@ -326,7 +328,7 @@ void SetUpFLALocalAuthApi(id<FlutterBinaryMessenger> binaryMessenger,
326328
/// [strings] for any UI.
327329
{
328330
FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc]
329-
initWithName:@"dev.flutter.pigeon.local_auth_ios.LocalAuthApi.authenticate"
331+
initWithName:@"dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.authenticate"
330332
binaryMessenger:binaryMessenger
331333
codec:FLALocalAuthApiGetCodec()];
332334
if (api) {

packages/local_auth/local_auth_ios/example/ios/RunnerTests/FLTLocalAuthPluginTests.m renamed to packages/local_auth/local_auth_darwin/darwin/Tests/FLTLocalAuthPluginTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
@import LocalAuthentication;
66
@import XCTest;
7-
@import local_auth_ios;
7+
@import local_auth_darwin;
88

99
#import <OCMock/OCMock.h>
1010

packages/local_auth/local_auth_ios/ios/local_auth_ios.podspec renamed to packages/local_auth/local_auth_darwin/darwin/local_auth_darwin.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
33
#
44
Pod::Spec.new do |s|
5-
s.name = 'local_auth_ios'
5+
s.name = 'local_auth_darwin'
66
s.version = '0.0.1'
77
s.summary = 'Flutter Local Auth'
88
s.description = <<-DESC
@@ -13,12 +13,12 @@ Downloaded by pub (not CocoaPods).
1313
s.license = { :type => 'BSD', :file => '../LICENSE' }
1414
s.author = { 'Flutter Dev Team' => '[email protected]' }
1515
s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/local_auth' }
16-
s.documentation_url = 'https://pub.dev/packages/local_auth_ios'
16+
s.documentation_url = 'https://pub.dev/packages/local_auth_darwin'
1717
s.source_files = 'Classes/**/*'
1818
s.public_header_files = 'Classes/**/*.h'
1919
s.dependency 'Flutter'
2020
s.platform = :ios, '12.0'
2121
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
22-
s.resource_bundles = {'local_auth_ios_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
22+
s.resource_bundles = {'local_auth_darwin_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
2323
end
2424

packages/local_auth/local_auth_ios/example/integration_test/local_auth_test.dart renamed to packages/local_auth/local_auth_darwin/example/integration_test/local_auth_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
import 'package:flutter_test/flutter_test.dart';
66
import 'package:integration_test/integration_test.dart';
77

8-
import 'package:local_auth_ios/local_auth_ios.dart';
8+
import 'package:local_auth_darwin/local_auth_darwin.dart';
99

1010
void main() {
1111
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
1212

1313
testWidgets('canCheckBiometrics', (WidgetTester tester) async {
1414
expect(
15-
LocalAuthIOS().getEnrolledBiometrics(),
15+
LocalAuthDarwin().getEnrolledBiometrics(),
1616
completion(isList),
1717
);
1818
});

packages/local_auth/local_auth_ios/example/ios/Runner.xcodeproj/project.pbxproj renamed to packages/local_auth/local_auth_darwin/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
3398D2D126163948005A052F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
5050
3398D2DC261649CD005A052F /* liblocal_auth.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = liblocal_auth.a; sourceTree = BUILT_PRODUCTS_DIR; };
5151
3398D2DF26164A03005A052F /* liblocal_auth.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = liblocal_auth.a; sourceTree = BUILT_PRODUCTS_DIR; };
52-
3398D2E326164AD8005A052F /* FLTLocalAuthPluginTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FLTLocalAuthPluginTests.m; sourceTree = "<group>"; };
52+
3398D2E326164AD8005A052F /* FLTLocalAuthPluginTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FLTLocalAuthPluginTests.m; path = ../../darwin/Tests/FLTLocalAuthPluginTests.m; sourceTree = SOURCE_ROOT; };
5353
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
5454
658CDD04B21E4EA92F8EF229 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
5555
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
@@ -359,11 +359,11 @@
359359
);
360360
inputPaths = (
361361
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh",
362-
"${PODS_CONFIGURATION_BUILD_DIR}/local_auth_ios/local_auth_ios_privacy.bundle",
362+
"${PODS_CONFIGURATION_BUILD_DIR}/local_auth_darwin/local_auth_darwin_privacy.bundle",
363363
);
364364
name = "[CP] Copy Pods Resources";
365365
outputPaths = (
366-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/local_auth_ios_privacy.bundle",
366+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/local_auth_darwin_privacy.bundle",
367367
);
368368
runOnlyForDeploymentPostprocessing = 0;
369369
shellPath = /bin/sh;

packages/local_auth/local_auth_ios/example/lib/main.dart renamed to packages/local_auth/local_auth_darwin/example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'dart:async';
88

99
import 'package:flutter/material.dart';
1010
import 'package:flutter/services.dart';
11-
import 'package:local_auth_ios/local_auth_ios.dart';
11+
import 'package:local_auth_darwin/local_auth_darwin.dart';
1212
import 'package:local_auth_platform_interface/local_auth_platform_interface.dart';
1313

1414
void main() {

packages/local_auth/local_auth_ios/example/pubspec.yaml renamed to packages/local_auth/local_auth_darwin/example/pubspec.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: local_auth_ios_example
2-
description: Demonstrates how to use the local_auth_ios plugin.
1+
name: local_auth_darwin_example
2+
description: Demonstrates how to use the local_auth_darwin plugin.
33
publish_to: none
44

55
environment:
@@ -9,9 +9,9 @@ environment:
99
dependencies:
1010
flutter:
1111
sdk: flutter
12-
local_auth_ios:
12+
local_auth_darwin:
1313
# When depending on this package from a real application you should use:
14-
# local_auth: ^x.y.z
14+
# local_auth_darwin: ^x.y.z
1515
# See https://dart.dev/tools/pub/dependencies#version-constraints
1616
# The example app is bundled with the plugin so we use a path dependency on
1717
# the parent directory to use the current plugin's version.

packages/local_auth/local_auth_ios/lib/local_auth_ios.dart renamed to packages/local_auth/local_auth_darwin/lib/local_auth_darwin.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ import 'package:local_auth_platform_interface/local_auth_platform_interface.dart
99
import 'src/messages.g.dart';
1010
import 'types/auth_messages_ios.dart';
1111

12-
export 'package:local_auth_ios/types/auth_messages_ios.dart';
12+
export 'package:local_auth_darwin/types/auth_messages_ios.dart';
1313
export 'package:local_auth_platform_interface/types/auth_messages.dart';
1414
export 'package:local_auth_platform_interface/types/auth_options.dart';
1515
export 'package:local_auth_platform_interface/types/biometric_type.dart';
1616

1717
/// The implementation of [LocalAuthPlatform] for iOS.
18-
class LocalAuthIOS extends LocalAuthPlatform {
18+
class LocalAuthDarwin extends LocalAuthPlatform {
1919
/// Creates a new plugin implementation instance.
20-
LocalAuthIOS({
20+
LocalAuthDarwin({
2121
@visibleForTesting LocalAuthApi? api,
2222
}) : _api = api ?? LocalAuthApi();
2323

2424
/// Registers this class as the default instance of [LocalAuthPlatform].
2525
static void registerWith() {
26-
LocalAuthPlatform.instance = LocalAuthIOS();
26+
LocalAuthPlatform.instance = LocalAuthDarwin();
2727
}
2828

2929
final LocalAuthApi _api;

packages/local_auth/local_auth_ios/lib/src/messages.g.dart renamed to packages/local_auth/local_auth_darwin/lib/src/messages.g.dart

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2013 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
4-
// Autogenerated from Pigeon (v13.0.0), do not edit directly.
4+
// Autogenerated from Pigeon (v13.1.2), do not edit directly.
55
// See also: https://pub.dev/packages/pigeon
66
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import
77

@@ -11,15 +11,11 @@ import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List;
1111
import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer;
1212
import 'package:flutter/services.dart';
1313

14-
List<Object?> wrapResponse(
15-
{Object? result, PlatformException? error, bool empty = false}) {
16-
if (empty) {
17-
return <Object?>[];
18-
}
19-
if (error == null) {
20-
return <Object?>[result];
21-
}
22-
return <Object?>[error.code, error.message, error.details];
14+
PlatformException _createConnectionError(String channelName) {
15+
return PlatformException(
16+
code: 'channel-error',
17+
message: 'Unable to establish connection on channel: "$channelName".',
18+
);
2319
}
2420

2521
/// Possible outcomes of an authentication attempt.
@@ -231,16 +227,16 @@ class LocalAuthApi {
231227

232228
/// Returns true if this device supports authentication.
233229
Future<bool> isDeviceSupported() async {
230+
const String channelName =
231+
'dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.isDeviceSupported';
234232
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
235-
'dev.flutter.pigeon.local_auth_ios.LocalAuthApi.isDeviceSupported',
236-
codec,
237-
binaryMessenger: _binaryMessenger);
233+
channelName,
234+
codec,
235+
binaryMessenger: _binaryMessenger,
236+
);
238237
final List<Object?>? replyList = await channel.send(null) as List<Object?>?;
239238
if (replyList == null) {
240-
throw PlatformException(
241-
code: 'channel-error',
242-
message: 'Unable to establish connection on channel.',
243-
);
239+
throw _createConnectionError(channelName);
244240
} else if (replyList.length > 1) {
245241
throw PlatformException(
246242
code: replyList[0]! as String,
@@ -260,16 +256,16 @@ class LocalAuthApi {
260256
/// Returns true if this device can support biometric authentication, whether
261257
/// any biometrics are enrolled or not.
262258
Future<bool> deviceCanSupportBiometrics() async {
259+
const String channelName =
260+
'dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.deviceCanSupportBiometrics';
263261
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
264-
'dev.flutter.pigeon.local_auth_ios.LocalAuthApi.deviceCanSupportBiometrics',
265-
codec,
266-
binaryMessenger: _binaryMessenger);
262+
channelName,
263+
codec,
264+
binaryMessenger: _binaryMessenger,
265+
);
267266
final List<Object?>? replyList = await channel.send(null) as List<Object?>?;
268267
if (replyList == null) {
269-
throw PlatformException(
270-
code: 'channel-error',
271-
message: 'Unable to establish connection on channel.',
272-
);
268+
throw _createConnectionError(channelName);
273269
} else if (replyList.length > 1) {
274270
throw PlatformException(
275271
code: replyList[0]! as String,
@@ -289,16 +285,16 @@ class LocalAuthApi {
289285
/// Returns the biometric types that are enrolled, and can thus be used
290286
/// without additional setup.
291287
Future<List<AuthBiometricWrapper?>> getEnrolledBiometrics() async {
288+
const String channelName =
289+
'dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.getEnrolledBiometrics';
292290
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
293-
'dev.flutter.pigeon.local_auth_ios.LocalAuthApi.getEnrolledBiometrics',
294-
codec,
295-
binaryMessenger: _binaryMessenger);
291+
channelName,
292+
codec,
293+
binaryMessenger: _binaryMessenger,
294+
);
296295
final List<Object?>? replyList = await channel.send(null) as List<Object?>?;
297296
if (replyList == null) {
298-
throw PlatformException(
299-
code: 'channel-error',
300-
message: 'Unable to establish connection on channel.',
301-
);
297+
throw _createConnectionError(channelName);
302298
} else if (replyList.length > 1) {
303299
throw PlatformException(
304300
code: replyList[0]! as String,
@@ -319,16 +315,17 @@ class LocalAuthApi {
319315
/// [strings] for any UI.
320316
Future<AuthResultDetails> authenticate(
321317
AuthOptions arg_options, AuthStrings arg_strings) async {
318+
const String channelName =
319+
'dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.authenticate';
322320
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
323-
'dev.flutter.pigeon.local_auth_ios.LocalAuthApi.authenticate', codec,
324-
binaryMessenger: _binaryMessenger);
321+
channelName,
322+
codec,
323+
binaryMessenger: _binaryMessenger,
324+
);
325325
final List<Object?>? replyList = await channel
326326
.send(<Object?>[arg_options, arg_strings]) as List<Object?>?;
327327
if (replyList == null) {
328-
throw PlatformException(
329-
code: 'channel-error',
330-
message: 'Unable to establish connection on channel.',
331-
);
328+
throw _createConnectionError(channelName);
332329
} else if (replyList.length > 1) {
333330
throw PlatformException(
334331
code: replyList[0]! as String,

packages/local_auth/local_auth_ios/pigeons/messages.dart renamed to packages/local_auth/local_auth_darwin/pigeons/messages.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import 'package:pigeon/pigeon.dart';
66

77
@ConfigurePigeon(PigeonOptions(
88
dartOut: 'lib/src/messages.g.dart',
9-
objcHeaderOut: 'ios/Classes/messages.g.h',
10-
objcSourceOut: 'ios/Classes/messages.g.m',
9+
objcHeaderOut: 'darwin/Classes/messages.g.h',
10+
objcSourceOut: 'darwin/Classes/messages.g.m',
1111
objcOptions: ObjcOptions(
1212
prefix: 'FLA',
1313
),

0 commit comments

Comments
 (0)