Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
b125dfa
start of overrides generation
bparrishMines Jun 25, 2025
733fabc
move constructor creation to method
bparrishMines Jun 26, 2025
3b957d1
create method create function types
bparrishMines Jun 26, 2025
2a98678
create method for getting constructor params
bparrishMines Jun 26, 2025
fbe6bd2
add support for static fields
bparrishMines Jun 26, 2025
370f2ce
overrides for static methods
bparrishMines Jun 26, 2025
893abd8
generating the constructor override
bparrishMines Jun 26, 2025
b5f1c82
fix constructor overrides
bparrishMines Jun 26, 2025
350aaa3
fix wrong api names
bparrishMines Jun 27, 2025
eaf9f15
use null checker
bparrishMines Jun 27, 2025
89fab8c
override static attached fields
bparrishMines Jun 27, 2025
35cc467
override static methods
bparrishMines Jun 27, 2025
69363f9
add reset method
bparrishMines Jun 27, 2025
04be6d8
formatter
bparrishMines Jun 27, 2025
6393d86
visible for testing
bparrishMines Jun 27, 2025
1a6ad6c
documentation of overrides classes
bparrishMines Jun 27, 2025
334e1b7
improve docs
bparrishMines Jul 1, 2025
c1cad06
Merge branch 'main' of github.com:flutter/packages into pigeon_overrides
bparrishMines Jul 1, 2025
da55dfe
fix proxy api tests
bparrishMines Jul 1, 2025
3f98efe
fix generator tests and add overrides test
bparrishMines Jul 1, 2025
eced2c6
add overrides tests
bparrishMines Jul 1, 2025
e01b9f9
remove messenger and manager from overrides
bparrishMines Jul 1, 2025
fa6f30e
change to pigeon_ as value
bparrishMines Jul 1, 2025
e81fe9d
Merge branch 'main' of github.com:flutter/packages into pigeon_overrides
bparrishMines Jul 1, 2025
9fa4634
version bump
bparrishMines Jul 1, 2025
69e1576
fix changelog
bparrishMines Jul 1, 2025
75afb7e
dont add comma
bparrishMines Jul 1, 2025
1b35033
Merge branch 'main' of github.com:flutter/packages into pigeon_overrides
bparrishMines Jul 7, 2025
ae97278
use default constructor name
bparrishMines Jul 7, 2025
1fd2c0f
change to a singular class
bparrishMines Jul 8, 2025
2d66e33
move reset method
bparrishMines Jul 8, 2025
fb10295
fix tests
bparrishMines Jul 8, 2025
50cbf09
use new keyword
bparrishMines Jul 8, 2025
0808c11
fix tests
bparrishMines Jul 8, 2025
84da64e
Fix unit tests
bparrishMines Jul 8, 2025
4611198
Merge branch 'main' of github.com:flutter/packages into pigeon_overrides
bparrishMines Jul 8, 2025
d9222c2
change to define type
bparrishMines Jul 9, 2025
e427c9b
docs and formatting
bparrishMines Jul 9, 2025
6581526
Merge branch 'main' of github.com:flutter/packages into pigeon_overrides
bparrishMines Jul 9, 2025
bda0ab6
improve docs
bparrishMines Jul 9, 2025
e9df002
update detached constructor
bparrishMines Jul 9, 2025
83068ed
update copy method
bparrishMines Jul 9, 2025
009da2d
fix test name
bparrishMines Jul 9, 2025
78658c2
unneeded comments
bparrishMines Jul 9, 2025
06402b9
move method to helper file
bparrishMines Jul 16, 2025
6931701
forgot to add helper file
bparrishMines Jul 16, 2025
bc7e32f
move last missing method
bparrishMines Jul 16, 2025
a6428b9
change directive name
bparrishMines Jul 16, 2025
c2326bc
some code improvements
bparrishMines Jul 16, 2025
cd418e7
improve docs and move methods
bparrishMines Jul 17, 2025
8080891
remove empty check
bparrishMines Jul 17, 2025
f17b54d
Merge branch 'main' of github.com:flutter/packages into pigeon_overrides
bparrishMines Jul 17, 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
6 changes: 6 additions & 0 deletions packages/pigeon/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 26.0.0

* **Breaking Change** [dart] Changes name of constructors used to create subclasses of ProxyApis to
`pigeon_**original_name**`.
* [dart] Adds ProxyApi overrides classes to be used in Flutter unit tests.

## 25.5.0

* [dart] Changes the default InstanceManager and its initialization to no longer make a message call
Expand Down
41 changes: 30 additions & 11 deletions packages/pigeon/lib/src/ast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -240,34 +240,53 @@ class AstProxyApi extends Api {
/// `implements`.
Iterable<AstProxyApi> apisOfInterfaces() => _recursiveFindAllInterfaceApis();

/// All methods inherited from interfaces and the interfaces of interfaces.
Iterable<Method> flutterMethodsFromInterfaces() sync* {
/// Returns a record for each method inherited from an interface and its
/// corresponding ProxyApi.
Iterable<(Method, AstProxyApi)> flutterMethodsFromInterfacesWithApis() sync* {
for (final AstProxyApi proxyApi in apisOfInterfaces()) {
yield* proxyApi.methods;
yield* proxyApi.methods.map((Method method) => (method, proxyApi));
}
}

/// A list of Flutter methods inherited from the ProxyApi that this ProxyApi
/// `extends`.
///
/// This also recursively checks the ProxyApi that the super class `extends`
/// and so on.
/// Returns a record for each Flutter method inherited from [superClass].
///
/// This also includes methods that super classes inherited from interfaces
/// with `implements`.
Iterable<Method> flutterMethodsFromSuperClasses() sync* {
Iterable<(Method, AstProxyApi)>
flutterMethodsFromSuperClassesWithApis() sync* {
for (final AstProxyApi proxyApi in allSuperClasses().toList().reversed) {
yield* proxyApi.flutterMethods;
yield* proxyApi.flutterMethods.map((Method method) => (method, proxyApi));
}
if (superClass != null) {
final Set<AstProxyApi> interfaceApisFromSuperClasses =
superClass!.associatedProxyApi!._recursiveFindAllInterfaceApis();
for (final AstProxyApi proxyApi in interfaceApisFromSuperClasses) {
yield* proxyApi.methods;
yield* proxyApi.methods.map((Method method) => (method, proxyApi));
}
}
}

/// All methods inherited from interfaces and the interfaces of interfaces.
Iterable<Method> flutterMethodsFromInterfaces() sync* {
yield* flutterMethodsFromInterfacesWithApis().map(
((Method, AstProxyApi) method) => method.$1,
);
}

/// A list of Flutter methods inherited from the ProxyApi that this ProxyApi
/// `extends`.
///
/// This also recursively checks the ProxyApi that the super class `extends`
/// and so on.
///
/// This also includes methods that super classes inherited from interfaces
/// with `implements`.
Iterable<Method> flutterMethodsFromSuperClasses() sync* {
yield* flutterMethodsFromSuperClassesWithApis().map(
((Method, AstProxyApi) method) => method.$1,
);
}

/// Whether the API has a method that callbacks to Dart to add a new instance
/// to the InstanceManager.
///
Expand Down
Loading