Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -29,7 +25,7 @@ env:

jobs:
dart:
name: analyze + test
name: format + analyze + test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
Expand All @@ -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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions lib/domain/ticket/gift.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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 '';
}
Expand Down
Loading