Skip to content
Closed

ignore #10232

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
eb7cac6
methods, basic types, sync, nullable-sync, async, and classes
tarrinneal Apr 15, 2025
9fa695d
broken nullable async methods
tarrinneal Apr 15, 2025
0aff0fd
refactor type logic, add codec
tarrinneal Apr 17, 2025
1ed8a8b
objects and enums
tarrinneal Apr 22, 2025
ee50607
full codec
tarrinneal May 9, 2025
4c6eb1a
error handling and more tests
tarrinneal May 29, 2025
f87efd4
fix codec
tarrinneal May 29, 2025
3e9d9f0
flutter api and plumbing through legacy apis and tests
tarrinneal Jun 27, 2025
6ad2e37
jnigen.yaml
tarrinneal Jun 27, 2025
9b55d44
ffi just getting started
tarrinneal Jul 7, 2025
25e8c30
gen fluff
tarrinneal Jul 11, 2025
df40332
not working
tarrinneal Jul 16, 2025
d90ecca
missing files
tarrinneal Jul 17, 2025
92933f8
gitignore
tarrinneal Jul 17, 2025
cb1c0fe
ios ffigen settings
tarrinneal Jul 17, 2025
a7cc7ce
remove macos min version from ffigen config
tarrinneal Jul 17, 2025
8fb8dca
no dylibs
tarrinneal Jul 17, 2025
ab64302
more basic, still can't see class
tarrinneal Jul 17, 2025
c7d00c6
upload macos
tarrinneal Jul 17, 2025
33f8fa1
fix ffigen files
tarrinneal Jul 17, 2025
4977cc2
test
tarrinneal Jul 29, 2025
586edf2
wip
tarrinneal Jul 29, 2025
74b1cb1
Merge branch 'Frillback' of github.com:tarrinneal/packages into Frill…
tarrinneal Jul 29, 2025
3736528
ns
tarrinneal Jul 29, 2025
31d182f
dunno
tarrinneal Jul 30, 2025
c63e598
something
tarrinneal Jul 30, 2025
6dc23e7
working again
tarrinneal Jul 30, 2025
982dfe6
Merge branch 'Frillback' of https://github.com/tarrinneal/packages in…
tarrinneal Jul 30, 2025
ecc088a
enums
tarrinneal Aug 12, 2025
927fd8d
and this one
tarrinneal Aug 12, 2025
877d60d
ffi support for classes, enums, and objects (partial testing)
tarrinneal Aug 26, 2025
910ac95
tests
tarrinneal Aug 26, 2025
b522d6c
fix enums, still need to resolve Any?
tarrinneal Sep 4, 2025
bd47b34
actually fix enums
tarrinneal Sep 5, 2025
4192a89
starting nullables, gonna be a mess
tarrinneal Sep 5, 2025
86e6907
nullable base types in classes
tarrinneal Sep 17, 2025
87f4f8a
add nullable enums (no tests for null things though.....)
tarrinneal Sep 18, 2025
ed3eb93
update to latest version
tarrinneal Sep 19, 2025
457edef
Not even I understand
tarrinneal Sep 24, 2025
9214479
fix null object?
tarrinneal Sep 25, 2025
aadd859
multi-arity and nullable enums in classes
tarrinneal Sep 26, 2025
8cb24b6
nested classes
tarrinneal Sep 27, 2025
d29e86a
typed lists and maps except int keys
tarrinneal Oct 14, 2025
b32d506
Merge branch 'main' of https://github.com/flutter/packages into Frill…
tarrinneal Oct 15, 2025
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: 2 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ analyzer:
# Ignore generated files
- '**/*.pb.dart'
- '**/*.g.dart'
- '**/*.gen.jni.dart'
- '**/*.gen.ffi.dart'
- '**/*.mocks.dart' # Mockito @GenerateMocks

linter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ enum class Code(val raw: Int) {

companion object {
fun ofRaw(raw: Int): Code? {
return values().firstOrNull { it.raw == raw }
return entries.firstOrNull { it.raw == raw }
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// found in the LICENSE file.
// Autogenerated from Pigeon, do not edit directly.
// See also: https://pub.dev/packages/pigeon
// swift-format-ignore-file: AlwaysUseLowerCamelCase

import Foundation

Expand All @@ -15,7 +16,15 @@ import Foundation
#endif

private func isNullish(_ value: Any?) -> Bool {
return value is NSNull || value == nil
guard let innerValue = value else {
return true
}

if case Optional<Any>.some(Optional<Any>.none) = value {
return true
}

return innerValue is NSNull
}

private func nilOrValue<T>(_ value: Any?) -> T? {
Expand Down Expand Up @@ -95,7 +104,6 @@ protocol PlatformEvent {
struct IntEvent: PlatformEvent {
var data: Int64

// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> IntEvent? {
let data = pigeonVar_list[0] as! Int64

Expand All @@ -120,7 +128,6 @@ struct IntEvent: PlatformEvent {
struct StringEvent: PlatformEvent {
var data: String

// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> StringEvent? {
let data = pigeonVar_list[0] as! String

Expand Down
12 changes: 10 additions & 2 deletions packages/pigeon/example/app/ios/Runner/Messages.g.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// found in the LICENSE file.
// Autogenerated from Pigeon, do not edit directly.
// See also: https://pub.dev/packages/pigeon
// swift-format-ignore-file: AlwaysUseLowerCamelCase

import Foundation

Expand Down Expand Up @@ -65,7 +66,15 @@ private func createConnectionError(withChannelName channelName: String) -> Pigeo
}

private func isNullish(_ value: Any?) -> Bool {
return value is NSNull || value == nil
guard let innerValue = value else {
return true
}

if case Optional<Any>.some(Optional<Any>.none) = value {
return true
}

return innerValue is NSNull
}

private func nilOrValue<T>(_ value: Any?) -> T? {
Expand Down Expand Up @@ -147,7 +156,6 @@ struct MessageData: Hashable {
var code: Code
var data: [String: String]

// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> MessageData? {
let name: String? = nilOrValue(pigeonVar_list[0])
let description: String? = nilOrValue(pigeonVar_list[1])
Expand Down
18 changes: 8 additions & 10 deletions packages/pigeon/example/app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,14 @@ class _MyHomePageState extends State<MyHomePage> {
if (Platform.isAndroid || Platform.isIOS)
StreamBuilder<String>(
stream: getEventStream(),
builder: (
BuildContext context,
AsyncSnapshot<String> snapshot,
) {
if (snapshot.hasData) {
return Text(snapshot.data ?? '');
} else {
return const CircularProgressIndicator();
}
},
builder:
(BuildContext context, AsyncSnapshot<String> snapshot) {
if (snapshot.hasData) {
return Text(snapshot.data ?? '');
} else {
return const CircularProgressIndicator();
}
},
)
else
const Text('event channels are not supported on this platform'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,6 @@ import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List;
import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer;
import 'package:flutter/services.dart';

bool _deepEquals(Object? a, Object? b) {
if (a is List && b is List) {
return a.length == b.length &&
a.indexed.every(
((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]),
);
}
if (a is Map && b is Map) {
return a.length == b.length &&
a.entries.every(
(MapEntry<Object?, Object?> entry) =>
(b as Map<Object?, Object?>).containsKey(entry.key) &&
_deepEquals(entry.value, b[entry.key]),
);
}
return a == b;
}

sealed class PlatformEvent {}

class IntEvent extends PlatformEvent {
Expand Down
16 changes: 9 additions & 7 deletions packages/pigeon/example/app/lib/src/messages.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,18 @@ class _PigeonCodec extends StandardMessageCodec {
}

class ExampleHostApi {
/// Constructor for [ExampleHostApi]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default
/// Constructor for [ExampleHostApi]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default
/// BinaryMessenger will be used which routes to the host platform.
ExampleHostApi({
BinaryMessenger? binaryMessenger,
String messageChannelSuffix = '',
}) : pigeonVar_binaryMessenger = binaryMessenger,
pigeonVar_messageChannelSuffix =
messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
final BinaryMessenger? pigeonVar_binaryMessenger;
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty
? '.$messageChannelSuffix'
: '';

final BinaryMessenger? pigeonVar_binaryMessenger;
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();

final String pigeonVar_messageChannelSuffix;
Expand Down Expand Up @@ -256,8 +257,9 @@ abstract class MessageFlutterApi {
BinaryMessenger? binaryMessenger,
String messageChannelSuffix = '',
}) {
messageChannelSuffix =
messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
messageChannelSuffix = messageChannelSuffix.isNotEmpty
? '.$messageChannelSuffix'
: '';
{
final BasicMessageChannel<Object?>
pigeonVar_channel = BasicMessageChannel<Object?>(
Expand Down
Loading