File tree Expand file tree Collapse file tree
ffigen/lib/src/code_generator Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,12 +9,15 @@ import 'writer.dart';
99class LibraryImport {
1010 final String name;
1111 final String _importPath;
12- final String ? importPathWhenImportedByPackageObjC;
12+ final String ? _importPathWhenImportedByPackageObjC;
13+
1314 String prefix;
1415
1516 LibraryImport (this .name, this ._importPath,
16- {this .importPathWhenImportedByPackageObjC})
17- : prefix = name;
17+ {String ? importPathWhenImportedByPackageObjC})
18+ : _importPathWhenImportedByPackageObjC =
19+ importPathWhenImportedByPackageObjC,
20+ prefix = name;
1821
1922 @override
2023 bool operator == (other) {
@@ -24,9 +27,11 @@ class LibraryImport {
2427 @override
2528 int get hashCode => name.hashCode;
2629
30+ // The import path, which may be different if this library is being imported
31+ // into package:objective_c's generated code.
2732 String importPath (bool generateForPackageObjectiveC) {
2833 if (! generateForPackageObjectiveC) return _importPath;
29- return importPathWhenImportedByPackageObjC ?? _importPath;
34+ return _importPathWhenImportedByPackageObjC ?? _importPath;
3035 }
3136}
3237
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ include: package:flutter_lints/flutter.yaml
22
33analyzer :
44 exclude :
5- - tool/extra_methods.dart
5+ - tool/data/ extra_methods.dart
66 language :
77 strict-casts : true
88 strict-inference : true
Original file line number Diff line number Diff line change 1- // Copyright (c) 2022 , the Dart project authors. Please see the AUTHORS file
1+ // Copyright (c) 2024 , the Dart project authors. Please see the AUTHORS file
22// for details. All rights reserved. Use of this source code is governed by a
33// BSD-style license that can be found in the LICENSE file.
44
5- // Extra methods inserted into NSString by generate_code.dart.
5+ // Extra methods inserted into NSString by tool/ generate_code.dart.
66class NSString extends NSObject {
77 factory NSString (String str) {
88 final cstr = str.toNativeUtf16 ();
Original file line number Diff line number Diff line change 22// for details. All rights reserved. Use of this source code is governed by a
33// BSD-style license that can be found in the LICENSE file.
44
5- // Runs the ffigen configs, then merges extra_methods.dart into the Objective C
6- // bindings.
5+ // Runs the ffigen configs, then merges tool/data/ extra_methods.dart into the
6+ // Objective C bindings.
77
88// ignore_for_file: avoid_print
99
@@ -15,7 +15,7 @@ const cConfig = 'ffigen_c.yaml';
1515const objcConfig = 'ffigen_objc.yaml' ;
1616const cBindings = 'lib/src/c_bindings_generated.dart' ;
1717const objcBindings = 'lib/src/objective_c_bindings_generated.dart' ;
18- const extraMethodsFile = 'tool/extra_methods.dart' ;
18+ const extraMethodsFile = 'tool/data/ extra_methods.dart' ;
1919
2020void dartCmd (List <String > args) {
2121 final exec = Platform .resolvedExecutable;
You can’t perform that action at this time.
0 commit comments