Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion flutter_custom_tabs/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^4.0.0
flutter_lints: ^5.0.0

flutter:
uses-material-design: true
2 changes: 1 addition & 1 deletion flutter_custom_tabs/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dev_dependencies:
flutter_test:
sdk: flutter
mockito: ^5.4.4
flutter_lints: ^4.0.0
flutter_lints: ^5.0.0
plugin_platform_interface: ^2.1.8

flutter:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Autogenerated from Pigeon (v22.7.0), do not edit directly.
// Autogenerated from Pigeon (v26.0.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")

Expand All @@ -13,24 +13,26 @@ import io.flutter.plugin.common.StandardMethodCodec
import io.flutter.plugin.common.StandardMessageCodec
import java.io.ByteArrayOutputStream
import java.nio.ByteBuffer
private object MessagesPigeonUtils {

private fun wrapResult(result: Any?): List<Any?> {
return listOf(result)
}
fun wrapResult(result: Any?): List<Any?> {
return listOf(result)
}

private fun wrapError(exception: Throwable): List<Any?> {
return if (exception is FlutterError) {
listOf(
exception.code,
exception.message,
exception.details
)
} else {
listOf(
exception.javaClass.simpleName,
exception.toString(),
"Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)
)
fun wrapError(exception: Throwable): List<Any?> {
return if (exception is FlutterError) {
listOf(
exception.code,
exception.message,
exception.details
)
} else {
listOf(
exception.javaClass.simpleName,
exception.toString(),
"Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)
)
}
}
}

Expand Down Expand Up @@ -83,7 +85,7 @@ interface CustomTabsApi {
api.launch(urlStringArg, prefersDeepLinkArg, optionsArg)
listOf(null)
} catch (exception: Throwable) {
wrapError(exception)
MessagesPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
Expand All @@ -99,7 +101,7 @@ interface CustomTabsApi {
api.closeAllIfPossible()
listOf(null)
} catch (exception: Throwable) {
wrapError(exception)
MessagesPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
Expand All @@ -116,7 +118,7 @@ interface CustomTabsApi {
val wrapped: List<Any?> = try {
listOf(api.warmup(optionsArg))
} catch (exception: Throwable) {
wrapError(exception)
MessagesPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
Expand All @@ -135,7 +137,7 @@ interface CustomTabsApi {
api.mayLaunch(urlsArg, sessionPackageNameArg)
listOf(null)
} catch (exception: Throwable) {
wrapError(exception)
MessagesPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
Expand All @@ -153,7 +155,7 @@ interface CustomTabsApi {
api.invalidate(sessionPackageNameArg)
listOf(null)
} catch (exception: Throwable) {
wrapError(exception)
MessagesPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
Expand Down
2 changes: 1 addition & 1 deletion flutter_custom_tabs_android/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^4.0.0
flutter_lints: ^5.0.0

flutter:
uses-material-design: true
Expand Down
17 changes: 11 additions & 6 deletions flutter_custom_tabs_android/lib/src/messages/messages.g.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Autogenerated from Pigeon (v22.7.0), do not edit directly.
// Autogenerated from Pigeon (v26.0.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// 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, no_leading_underscores_for_local_identifiers

Expand Down Expand Up @@ -57,8 +57,9 @@ class CustomTabsApi {
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[urlString, prefersDeepLink, options]);
final List<Object?>? pigeonVar_replyList =
await pigeonVar_channel.send(<Object?>[urlString, prefersDeepLink, options]) as List<Object?>?;
await pigeonVar_sendFuture as List<Object?>?;
if (pigeonVar_replyList == null) {
throw _createConnectionError(pigeonVar_channelName);
} else if (pigeonVar_replyList.length > 1) {
Expand All @@ -79,8 +80,9 @@ class CustomTabsApi {
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(null);
final List<Object?>? pigeonVar_replyList =
await pigeonVar_channel.send(null) as List<Object?>?;
await pigeonVar_sendFuture as List<Object?>?;
if (pigeonVar_replyList == null) {
throw _createConnectionError(pigeonVar_channelName);
} else if (pigeonVar_replyList.length > 1) {
Expand All @@ -101,8 +103,9 @@ class CustomTabsApi {
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[options]);
final List<Object?>? pigeonVar_replyList =
await pigeonVar_channel.send(<Object?>[options]) as List<Object?>?;
await pigeonVar_sendFuture as List<Object?>?;
if (pigeonVar_replyList == null) {
throw _createConnectionError(pigeonVar_channelName);
} else if (pigeonVar_replyList.length > 1) {
Expand All @@ -123,8 +126,9 @@ class CustomTabsApi {
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[urls, sessionPackageName]);
final List<Object?>? pigeonVar_replyList =
await pigeonVar_channel.send(<Object?>[urls, sessionPackageName]) as List<Object?>?;
await pigeonVar_sendFuture as List<Object?>?;
if (pigeonVar_replyList == null) {
throw _createConnectionError(pigeonVar_channelName);
} else if (pigeonVar_replyList.length > 1) {
Expand All @@ -145,8 +149,9 @@ class CustomTabsApi {
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[sessionPackageName]);
final List<Object?>? pigeonVar_replyList =
await pigeonVar_channel.send(<Object?>[sessionPackageName]) as List<Object?>?;
await pigeonVar_sendFuture as List<Object?>?;
if (pigeonVar_replyList == null) {
throw _createConnectionError(pigeonVar_channelName);
} else if (pigeonVar_replyList.length > 1) {
Expand Down
4 changes: 2 additions & 2 deletions flutter_custom_tabs_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^4.0.0
pigeon: ^22.7.0
flutter_lints: ^5.0.0
pigeon: ^26.0.0
2 changes: 1 addition & 1 deletion flutter_custom_tabs_ios/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^4.0.0
flutter_lints: ^5.0.0

flutter:
uses-material-design: true
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Autogenerated from Pigeon (v22.7.0), do not edit directly.
// Autogenerated from Pigeon (v26.0.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon

import Foundation
Expand All @@ -15,9 +15,9 @@ import Foundation
final class PigeonError: Error {
let code: String
let message: String?
let details: Any?
let details: Sendable?

init(code: String, message: String?, details: Any?) {
init(code: String, message: String?, details: Sendable?) {
self.code = code
self.message = message
self.details = details
Expand All @@ -26,7 +26,7 @@ final class PigeonError: Error {
var localizedDescription: String {
return
"PigeonError(code: \(code), message: \(message ?? "<nil>"), details: \(details ?? "<nil>")"
}
}
}

private func wrapResult(_ result: Any?) -> [Any?] {
Expand Down Expand Up @@ -64,8 +64,72 @@ private func nilOrValue<T>(_ value: Any?) -> T? {
return value as! T?
}

func deepEqualsmessages(_ lhs: Any?, _ rhs: Any?) -> Bool {
let cleanLhs = nilOrValue(lhs) as Any?
let cleanRhs = nilOrValue(rhs) as Any?
switch (cleanLhs, cleanRhs) {
case (nil, nil):
return true

case (nil, _), (_, nil):
return false

case is (Void, Void):
return true

case let (cleanLhsHashable, cleanRhsHashable) as (AnyHashable, AnyHashable):
return cleanLhsHashable == cleanRhsHashable

case let (cleanLhsArray, cleanRhsArray) as ([Any?], [Any?]):
guard cleanLhsArray.count == cleanRhsArray.count else { return false }
for (index, element) in cleanLhsArray.enumerated() {
if !deepEqualsmessages(element, cleanRhsArray[index]) {
return false
}
}
return true

case let (cleanLhsDictionary, cleanRhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]):
guard cleanLhsDictionary.count == cleanRhsDictionary.count else { return false }
for (key, cleanLhsValue) in cleanLhsDictionary {
guard cleanRhsDictionary.index(forKey: key) != nil else { return false }
if !deepEqualsmessages(cleanLhsValue, cleanRhsDictionary[key]!) {
return false
}
}
return true

default:
// Any other type shouldn't be able to be used with pigeon. File an issue if you find this to be untrue.
return false
}
}

func deepHashmessages(value: Any?, hasher: inout Hasher) {
if let valueList = value as? [AnyHashable] {
for item in valueList { deepHashmessages(value: item, hasher: &hasher) }
return
}

if let valueDict = value as? [AnyHashable: AnyHashable] {
for key in valueDict.keys {
hasher.combine(key)
deepHashmessages(value: valueDict[key]!, hasher: &hasher)
}
return
}

if let hashableValue = value as? AnyHashable {
hasher.combine(hashableValue.hashValue)
}

return hasher.combine(String(describing: value))
}



/// Generated class from Pigeon that represents data sent in messages.
struct SFSafariViewControllerOptions {
struct SFSafariViewControllerOptions: Hashable {
var preferredBarTintColor: Int64? = nil
var preferredControlTintColor: Int64? = nil
var barCollapsingEnabled: Bool? = nil
Expand Down Expand Up @@ -106,10 +170,15 @@ struct SFSafariViewControllerOptions {
pageSheet,
]
}
static func == (lhs: SFSafariViewControllerOptions, rhs: SFSafariViewControllerOptions) -> Bool {
return deepEqualsmessages(lhs.toList(), rhs.toList()) }
func hash(into hasher: inout Hasher) {
deepHashmessages(value: toList(), hasher: &hasher)
}
}

/// Generated class from Pigeon that represents data sent in messages.
struct UISheetPresentationControllerConfiguration {
struct UISheetPresentationControllerConfiguration: Hashable {
var detents: [String]
var largestUndimmedDetentIdentifier: String? = nil
var prefersScrollingExpandsWhenScrolledToEdge: Bool? = nil
Expand Down Expand Up @@ -146,6 +215,11 @@ struct UISheetPresentationControllerConfiguration {
preferredCornerRadius,
]
}
static func == (lhs: UISheetPresentationControllerConfiguration, rhs: UISheetPresentationControllerConfiguration) -> Bool {
return deepEqualsmessages(lhs.toList(), rhs.toList()) }
func hash(into hasher: inout Hasher) {
deepHashmessages(value: toList(), hasher: &hasher)
}
}

private class MessagesPigeonCodecReader: FlutterStandardReader {
Expand Down
Loading