diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2f2fcc..3e8c249 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,10 +6,6 @@ name: CI # gitignored, and MainActivity.kt imports com.zcs.sdk unconditionally, so a # Kotlin compile cannot succeed on a clean clone. See "The proprietary bits" # in README.md. Android builds stay local, on a machine that has the SDK. -# -# `dart format --set-exit-if-changed` is also absent on purpose: the tree does -# not currently satisfy it (lib/domain/ticket/gift.dart). Reformat first, then -# add the step. on: pull_request: @@ -29,7 +25,7 @@ env: jobs: dart: - name: analyze + test + name: format + analyze + test runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 @@ -44,6 +40,12 @@ jobs: - run: flutter pub get + # Note: the formatter and `curly_braces_in_flow_control_structures` + # disagree about a single-statement `if` whose body is wrapped onto its + # own line — the formatter wants the wrap, the lint wants braces. Write + # the braces and both are satisfied. + - run: dart format --output=none --set-exit-if-changed . + - run: flutter analyze - run: flutter test diff --git a/README.md b/README.md index 046b856..5bc4c58 100644 --- a/README.md +++ b/README.md @@ -304,8 +304,8 @@ stale check-in screen for an entrada that has already been claimed. `analyzer ^13`, which cannot co-resolve with the analyzer `flutter_riverpod` drags in through `test`. - `sqlite3_flutter_libs` is EOL; `package:sqlite3` v3 bundles the natives. -- **CI runs the Dart checks only** — `flutter analyze` and `flutter test` on - every PR and every push to `main`, pinned to Flutter 3.44.4 +- **CI runs the Dart checks only** — `dart format`, `flutter analyze` and + `flutter test` on every PR and every push to `main`, pinned to Flutter 3.44.4 ([`.github/workflows/ci.yml`](.github/workflows/ci.yml)). There is no APK job: the ZCS jars the Android build needs are not redistributable, so that build stays on a machine that has them. See diff --git a/lib/domain/ticket/gift.dart b/lib/domain/ticket/gift.dart index 3d3c753..242a428 100644 --- a/lib/domain/ticket/gift.dart +++ b/lib/domain/ticket/gift.dart @@ -50,9 +50,11 @@ class Gift { return Gift( id: explicitId != null && explicitId.isNotEmpty ? explicitId - : (kind == 'sats_treasure' && claimCode != null && claimCode.isNotEmpty - ? claimCode - : key), + : (kind == 'sats_treasure' && + claimCode != null && + claimCode.isNotEmpty + ? claimCode + : key), label: (name == null || name.isEmpty) ? key : name, imageUrl: json['image_url']?.toString(), lnurl: json['lnurl']?.toString(), @@ -127,7 +129,9 @@ class Gift { String get detail { if (!isTreasure) return ''; - if (quantityLabel != null && quantityLabel!.isNotEmpty) return quantityLabel!; + if (quantityLabel != null && quantityLabel!.isNotEmpty) { + return quantityLabel!; + } if (satsAmount != null && satsAmount! > 0) return '$satsAmount sats'; return ''; }