Skip to content

Commit

Permalink
book: complete flutter hello snippet
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
  • Loading branch information
yukibtc committed Dec 23, 2024
1 parent b169a13 commit ea09c14
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
7 changes: 5 additions & 2 deletions book/snippets/flutter/lib/hello.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ Future<void> hello() async {
// ANCHOR_END: connect

// ANCHOR: publish
// TODO
EventBuilder builder = EventBuilder.textNote(content: "Hello, rust-nostr!");
SendEventOutput output = await client.sendEventBuilder(builder: builder);
// ANCHOR_END: publish

// ANCHOR: output
// TODO
print("Event ID: ${output.id}");
print("Sent to: ${output.success}");
print("Not sent to: ${output.failed}");
// ANCHOR_END: output
}
// ANCHOR_END: full
4 changes: 2 additions & 2 deletions book/snippets/flutter/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "1b1af0cdd0cf221e2706430f05242757a9574604"
resolved-ref: "1b1af0cdd0cf221e2706430f05242757a9574604"
ref: b6fe16d3aee91c4cda670c4236ad4b28f12433df
resolved-ref: b6fe16d3aee91c4cda670c4236ad4b28f12433df
url: "https://github.com/rust-nostr/nostr-sdk-flutter.git"
source: git
version: "0.37.0"
Expand Down
2 changes: 1 addition & 1 deletion book/snippets/flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
nostr_sdk:
git:
url: https://github.com/rust-nostr/nostr-sdk-flutter.git
ref: 1b1af0cdd0cf221e2706430f05242757a9574604
ref: b6fe16d3aee91c4cda670c4236ad4b28f12433df

dev_dependencies:
lints: ^3.0.0
Expand Down
2 changes: 1 addition & 1 deletion book/src/sdk/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Add the following code to your package:
nostr_sdk:
git:
url: https://github.com/rust-nostr/nostr-sdk-flutter.git
#ref: v0.37.0
ref: b6fe16d3aee91c4cda670c4236ad4b28f12433df
```
</section>
Expand Down

0 comments on commit ea09c14

Please sign in to comment.