File tree Expand file tree Collapse file tree 11 files changed +35
-40
lines changed Expand file tree Collapse file tree 11 files changed +35
-40
lines changed Original file line number Diff line number Diff line change @@ -9,14 +9,3 @@ analyzer:
9
9
strict-casts : true
10
10
strict-inference : true
11
11
strict-raw-types : true
12
-
13
- linter :
14
- rules :
15
- avoid_dynamic_calls : false # TODO(https://github.com/dart-lang/native/issues/1280): Fix
16
- combinators_ordering : false # TODO(https://github.com/dart-lang/native/issues/1280): Fix.
17
- comment_references : false # TODO(https://github.com/dart-lang/native/issues/1280): Fix
18
- directives_ordering : false # TODO(https://github.com/dart-lang/native/issues/1280): Fix
19
- library_annotations : false # TODO(https://github.com/dart-lang/native/issues/1280): Fix
20
- omit_local_variable_types : false # TODO(https://github.com/dart-lang/native/issues/1280): Fix
21
- prefer_single_quotes : false # TODO(https://github.com/dart-lang/native/issues/1280): Fix
22
- sort_pub_dependencies : false # TODO(https://github.com/dart-lang/native/issues/1280): Fix
Original file line number Diff line number Diff line change @@ -219,10 +219,10 @@ packages:
219
219
dependency: transitive
220
220
description:
221
221
name: vm_service
222
- sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
222
+ sha256: "360c4271613beb44db559547d02f8b0dc044741d0eeb9aa6ccdb47e8ec54c63a"
223
223
url: "https://pub.dev"
224
224
source: hosted
225
- version: "14.2.4 "
225
+ version: "14.2.3 "
226
226
yaml:
227
227
dependency: transitive
228
228
description:
Original file line number Diff line number Diff line change 2
2
// for details. All rights reserved. Use of this source code is governed by a
3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
- export 'src/internal.dart' hide blockHasRegisteredClosure;
6
- export 'src/ns_data.dart' ;
7
- export 'src/ns_mutable_data.dart' ;
8
- export 'src/ns_string.dart' ;
9
- export 'src/protocol_builder.dart' ;
10
5
export 'src/c_bindings_generated.dart'
11
6
show
12
- ObjCSelector,
13
- ObjCObject,
14
7
ObjCBlock,
15
- objectRetain ,
16
- objectRelease ,
8
+ ObjCObject ,
9
+ ObjCSelector ,
17
10
blockCopy,
18
- blockRelease;
19
-
11
+ blockRelease,
12
+ objectRelease,
13
+ objectRetain;
14
+ export 'src/internal.dart' hide blockHasRegisteredClosure;
15
+ export 'src/ns_data.dart' ;
16
+ export 'src/ns_mutable_data.dart' ;
17
+ export 'src/ns_string.dart' ;
20
18
// Keep in sync with pkgs/objective_c/ffigen_objc.yaml.
21
19
export 'src/objective_c_bindings_generated.dart'
22
20
show
@@ -72,3 +70,4 @@ export 'src/objective_c_bindings_generated.dart'
72
70
NSURLHandleStatus,
73
71
NSValue,
74
72
Protocol;
73
+ export 'src/protocol_builder.dart' ;
Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ bool _isValidClass(Pointer<c.ObjCObject> clazz) {
176
176
final count = countPtr.value;
177
177
calloc.free (countPtr);
178
178
_allClasses.clear ();
179
- for (int i = 0 ; i < count; ++ i) {
179
+ for (var i = 0 ; i < count; ++ i) {
180
180
_allClasses.add (classList[i]);
181
181
}
182
182
calloc.free (classList);
@@ -267,7 +267,7 @@ final _blockClosureDisposer = () {
267
267
final id = msg as int ;
268
268
assert (_blockClosureRegistry.containsKey (id));
269
269
_blockClosureRegistry.remove (id);
270
- }, " ObjCBlockClosureDisposer" )
270
+ }, ' ObjCBlockClosureDisposer' )
271
271
..keepIsolateAlive = false ;
272
272
}();
273
273
@@ -280,7 +280,7 @@ Pointer<Void> _registerBlockClosure(Function closure) {
280
280
281
281
/// Only for use by ffigen bindings.
282
282
Function getBlockClosure (Pointer <c.ObjCBlock > block) {
283
- int id = block.ref.target.address;
283
+ var id = block.ref.target.address;
284
284
assert (_blockClosureRegistry.containsKey (id));
285
285
return _blockClosureRegistry[id]! ;
286
286
}
Original file line number Diff line number Diff line change 5
5
import 'dart:ffi' ;
6
6
7
7
import 'c_bindings_generated.dart' as c;
8
- import 'objective_c_bindings_generated.dart' as objc;
9
8
import 'internal.dart' show ObjCBlockBase;
9
+ import 'objective_c_bindings_generated.dart' as objc;
10
10
11
11
/// Helper class for building Objective C objects that implement protocols.
12
12
class ObjCProtocolBuilder {
@@ -45,8 +45,8 @@ class ObjCProtocolMethod<T extends Function> {
45
45
/// Implement this method on the protocol [builder] using a Dart [function] .
46
46
///
47
47
/// The implemented method must be invoked by ObjC code running on the same
48
- /// thread as the isolate that called [ implementMethod] . Invoking the method
49
- /// on the wrong thread will result in a crash.
48
+ /// thread as the isolate that called implementMethod. Invoking the method on
49
+ /// the wrong thread will result in a crash.
50
50
void implement (ObjCProtocolBuilder builder, T ? function) {
51
51
if (function != null ) {
52
52
builder.implementMethod (_sel, _signature, _createBlock (function));
Original file line number Diff line number Diff line change @@ -18,19 +18,19 @@ environment:
18
18
flutter : ' >=3.3.0'
19
19
20
20
dependencies :
21
+ ffi : ^2.1.0
21
22
flutter :
22
23
sdk : flutter
23
- ffi : ^2.1.0
24
24
plugin_platform_interface : ^2.0.2
25
25
yaml : ^3.1.0
26
26
27
27
dev_dependencies :
28
28
coverage : ^1.8.0
29
29
dart_flutter_team_lints : ^2.0.0
30
30
ffigen : ^12.0.0
31
+ flutter_lints : ^3.0.0
31
32
flutter_test :
32
33
sdk : flutter
33
- flutter_lints : ^3.0.0
34
34
test : ^1.21.1
35
35
36
36
dependency_overrides :
Original file line number Diff line number Diff line change 4
4
5
5
// Objective C support is only available on mac.
6
6
@TestOn ('mac-os' )
7
+ library ;
7
8
8
9
import 'dart:io' ;
9
10
Original file line number Diff line number Diff line change 4
4
5
5
// Objective C support is only available on mac.
6
6
@TestOn ('mac-os' )
7
+ library ;
7
8
8
9
import 'dart:io' ;
9
10
@@ -18,20 +19,22 @@ void main() {
18
19
late List <String > yamlEnums;
19
20
20
21
setUpAll (() {
21
- final yaml = loadYaml (File ('ffigen_objc.yaml' ).readAsStringSync ());
22
- yamlInterfaces = yaml['objc-interfaces' ]['include' ]
22
+ final yaml =
23
+ loadYaml (File ('ffigen_objc.yaml' ).readAsStringSync ()) as YamlMap ;
24
+ yamlInterfaces = ((yaml['objc-interfaces' ] as YamlMap )['include' ]
25
+ as YamlList )
23
26
.map <String >((dynamic i) => i as String )
24
- .toList () as List < String >
27
+ .toList ()
25
28
..sort ();
26
- final structRenames = yaml['structs' ]['rename' ];
27
- yamlStructs = yaml['structs' ]['include' ]
29
+ final structRenames = ( yaml['structs' ] as YamlMap ) ['rename' ] as YamlMap ;
30
+ yamlStructs = (( yaml['structs' ] as YamlMap ) ['include' ] as YamlList )
28
31
.map <String >(
29
32
(dynamic name) => (structRenames[name] ?? name) as String )
30
- .toList () as List < String >
33
+ .toList ()
31
34
..sort ();
32
- yamlEnums = yaml['enums' ]['include' ]
35
+ yamlEnums = (( yaml['enums' ] as YamlMap ) ['include' ] as YamlList )
33
36
.map <String >((dynamic i) => i as String )
34
- .toList () as List < String >
37
+ .toList ()
35
38
..sort ();
36
39
});
37
40
Original file line number Diff line number Diff line change 4
4
5
5
// Objective C support is only available on mac.
6
6
@TestOn ('mac-os' )
7
+ library ;
7
8
8
9
import 'dart:ffi' ;
9
10
Original file line number Diff line number Diff line change 4
4
5
5
// Objective C support is only available on mac.
6
6
@TestOn ('mac-os' )
7
+ library ;
7
8
8
9
import 'dart:ffi' ;
9
10
You can’t perform that action at this time.
0 commit comments