From 5249b79fc97a503dcfc65f90bf17eeee561bf155 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 8 Apr 2024 09:44:32 +1200 Subject: [PATCH] Fix analysis --- .github/workflows/ffigen.yml | 12 +++++++----- .github/workflows/ffigen_weekly.yml | 8 ++++++-- pkgs/objective_c/lib/objective_c.dart | 12 +++++++++--- pkgs/objective_c/lib/src/core.dart | 17 ++++++----------- 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ffigen.yml b/.github/workflows/ffigen.yml index 33281b9d7..b34375850 100644 --- a/.github/workflows/ffigen.yml +++ b/.github/workflows/ffigen.yml @@ -30,23 +30,25 @@ jobs: working-directory: pkgs/ffigen/ strategy: fail-fast: false - matrix: - sdk: [3.3.0] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 with: - sdk: ${{ matrix.sdk }} + sdk: 3.3.0 + - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 + with: + flutter-version: 3.19.0 + channel: 'stable' - id: install name: Install dependencies - run: dart pub get && dart pub get --directory="example/shared_bindings" + run: flutter pub get && flutter pub get --directory="example/shared_bindings" - name: Check formatting run: dart format --output=none --set-exit-if-changed . if: always() && steps.install.outcome == 'success' - name: Build test dylib and bindings run: dart test/setup.dart - name: Analyze code - run: dart analyze --fatal-infos + run: flutter analyze --fatal-infos if: always() && steps.install.outcome == 'success' test-linux: diff --git a/.github/workflows/ffigen_weekly.yml b/.github/workflows/ffigen_weekly.yml index 5dfa4bd74..eb2435f84 100644 --- a/.github/workflows/ffigen_weekly.yml +++ b/.github/workflows/ffigen_weekly.yml @@ -22,9 +22,13 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 with: - sdk: dev #3.3.0 + sdk: 3.3.0 + - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 + with: + flutter-version: 3.19.0 + channel: 'stable' - name: Install dependencies - run: dart pub get + run: flutter pub get - name: Build test dylib and bindings run: dart test/setup.dart - name: Run VM tests diff --git a/pkgs/objective_c/lib/objective_c.dart b/pkgs/objective_c/lib/objective_c.dart index 7688f22ee..754a061a7 100644 --- a/pkgs/objective_c/lib/objective_c.dart +++ b/pkgs/objective_c/lib/objective_c.dart @@ -3,6 +3,12 @@ // BSD-style license that can be found in the LICENSE file. export 'src/core.dart'; -export 'src/objective_c_bindings_generated.dart' show - ObjCSelector, ObjCObject, ObjCBlock, - objectRetain, objectRelease, blockCopy, blockRelease; +export 'src/objective_c_bindings_generated.dart' + show + ObjCSelector, + ObjCObject, + ObjCBlock, + objectRetain, + objectRelease, + blockCopy, + blockRelease; diff --git a/pkgs/objective_c/lib/src/core.dart b/pkgs/objective_c/lib/src/core.dart index 5756458c8..9a9fb9380 100644 --- a/pkgs/objective_c/lib/src/core.dart +++ b/pkgs/objective_c/lib/src/core.dart @@ -2,10 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:async'; import 'dart:ffi'; -import 'dart:io'; -import 'dart:isolate'; import 'package:ffi/ffi.dart'; @@ -79,14 +76,13 @@ class _ObjCFinalizable implements Finalizable { } NativeFinalizer get _finalizer => throw UnimplementedError(); - void _retain(Pointer pointer) => throw UnimplementedError(); - void _release(Pointer pointer) => throw UnimplementedError(); + void _retain(Pointer ptr) => throw UnimplementedError(); + void _release(Pointer ptr) => throw UnimplementedError(); } class ObjCObjectBase extends _ObjCFinalizable { - ObjCObjectBase(Pointer ptr, - {required bool retain, required bool release}) - : super(ptr, retain: retain, release: release); + ObjCObjectBase(super.ptr, + {required super.retain, required super.release}); static final _objectFinalizer = NativeFinalizer( Native.addressOf)>>( @@ -104,9 +100,8 @@ class ObjCObjectBase extends _ObjCFinalizable { } class ObjCBlockBase extends _ObjCFinalizable { - ObjCBlockBase(Pointer ptr, - {required bool retain, required bool release}) - : super(ptr, retain: retain, release: release); + ObjCBlockBase(super.ptr, + {required super.retain, required super.release}); static final _blockFinalizer = NativeFinalizer( Native.addressOf)>>(