From 197b8d965c92fa50e21b3c2b3823a8af84a01b71 Mon Sep 17 00:00:00 2001 From: Erdem Yerebasmaz <4012752+erdemyerebasmaz@users.noreply.github.com> Date: Tue, 28 Nov 2023 20:01:16 +0300 Subject: [PATCH] Update Dart docs --- snippets/dart_snippets/.gitignore | 5 +++- snippets/dart_snippets/README.md | 2 +- .../dart_snippets/lib/receive_onchain.dart | 2 +- .../dart_snippets/lib/service_status.dart | 12 ++++---- snippets/dart_snippets/pubspec.lock | 30 +++++++++---------- snippets/dart_snippets/pubspec.yaml | 4 +-- 6 files changed, 30 insertions(+), 25 deletions(-) diff --git a/snippets/dart_snippets/.gitignore b/snippets/dart_snippets/.gitignore index 474c03e..bf02cc3 100644 --- a/snippets/dart_snippets/.gitignore +++ b/snippets/dart_snippets/.gitignore @@ -1,4 +1,7 @@ # https://dart.dev/guides/libraries/private-files # Created by `dart pub` .dart_tool/ -packages/ \ No newline at end of file +packages/ +.flutter-version +.flutter-plugins +.flutter-plugins-dependencies \ No newline at end of file diff --git a/snippets/dart_snippets/README.md b/snippets/dart_snippets/README.md index d1786c4..55f5534 100644 --- a/snippets/dart_snippets/README.md +++ b/snippets/dart_snippets/README.md @@ -3,4 +3,4 @@ - By running the publish-all-platforms CI in the breez-sdk repository (use dummy binaries) - or by cloning https://github.com/breez/breez-sdk-flutter 2. Place the files in the folder `snippets/dart-snippets/packages/breez-sdk-flutter` -3. happy coding \ No newline at end of file +3. Happy coding \ No newline at end of file diff --git a/snippets/dart_snippets/lib/receive_onchain.dart b/snippets/dart_snippets/lib/receive_onchain.dart index 245af23..7511190 100644 --- a/snippets/dart_snippets/lib/receive_onchain.dart +++ b/snippets/dart_snippets/lib/receive_onchain.dart @@ -7,7 +7,7 @@ Future generateReceiveOnchainAddress() async { SwapInfo swapInfo = await BreezSDK().receiveOnchain(req: req); // Send your funds to the below bitcoin address - final address = swapInfo.bitcoinAddress; + String address = swapInfo.bitcoinAddress; print(address); return swapInfo; // ANCHOR_END: generate-receive-onchain-address diff --git a/snippets/dart_snippets/lib/service_status.dart b/snippets/dart_snippets/lib/service_status.dart index e7f2ee8..7c32cf8 100644 --- a/snippets/dart_snippets/lib/service_status.dart +++ b/snippets/dart_snippets/lib/service_status.dart @@ -8,11 +8,13 @@ Future healthCheckStatus() async { // ANCHOR_END: health-check-status } -Future reportPaymentFailure() async { +Future reportPaymentFailure({required String paymentHash}) async { // ANCHOR: report-payment-failure - String paymentHash = "..."; - await BreezSDK().reportIssue( - req: ReportIssueRequest.paymentFailure( - data: ReportPaymentFailureDetails(paymentHash: paymentHash))); + ReportIssueRequest req = ReportIssueRequest.paymentFailure( + data: ReportPaymentFailureDetails( + paymentHash: paymentHash, + ), + ); + await BreezSDK().reportIssue(req: req); // ANCHOR_END: report-payment-failure } diff --git a/snippets/dart_snippets/pubspec.lock b/snippets/dart_snippets/pubspec.lock index 2e91c21..f8deb7a 100644 --- a/snippets/dart_snippets/pubspec.lock +++ b/snippets/dart_snippets/pubspec.lock @@ -21,10 +21,10 @@ packages: dependency: transitive description: name: archive - sha256: "7e0d52067d05f2e0324268097ba723b71cb41ac8a6a2b24d1edf9c536b987b03" + sha256: "7b875fd4a20b165a3084bd2d210439b22ebc653f21cea4842729c0c30c82596b" url: "https://pub.dev" source: hosted - version: "3.4.6" + version: "3.4.9" args: dependency: transitive description: @@ -100,10 +100,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" convert: dependency: transitive description: @@ -132,10 +132,10 @@ packages: dependency: transitive description: name: dart_style - sha256: abd7625e16f51f554ea244d090292945ec4d4be7bfbaf2ec8cccea568919d334 + sha256: "40ae61a5d43feea6d24bd22c0537a6629db858963b99b4bc1c3db80676f32368" url: "https://pub.dev" source: hosted - version: "2.3.3" + version: "2.3.4" ffi: dependency: transitive description: @@ -201,10 +201,10 @@ packages: dependency: transitive description: name: http - sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + sha256: d4872660c46d929f6b8a9ef4e7a7eff7e49bbf0c4ec3f385ee32df5119175139 url: "https://pub.dev" source: hosted - version: "0.13.6" + version: "1.1.2" http_multi_server: dependency: transitive description: @@ -249,10 +249,10 @@ packages: dependency: "direct dev" description: name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "3.0.0" logging: dependency: transitive description: @@ -281,10 +281,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" mime: dependency: transitive description: @@ -550,10 +550,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" web_socket_channel: dependency: transitive description: @@ -579,5 +579,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.1.0 <4.0.0" + dart: ">=3.2.0 <4.0.0" flutter: ">=3.10.0" diff --git a/snippets/dart_snippets/pubspec.yaml b/snippets/dart_snippets/pubspec.yaml index 5ebe8d4..144be5f 100644 --- a/snippets/dart_snippets/pubspec.yaml +++ b/snippets/dart_snippets/pubspec.yaml @@ -11,5 +11,5 @@ dependencies: path: ./packages/breez-sdk-flutter dev_dependencies: - lints: ^2.0.0 - test: ^1.21.0 + lints: ^3.0.0 + test: ^1.24.9