-
Notifications
You must be signed in to change notification settings - Fork 5
Ndk flutter #244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nogringo
wants to merge
12
commits into
master
Choose a base branch
from
ndk-flutter
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Ndk flutter #244
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
54dc13a
skeleton package
nogringo e8ea5d6
transfer done
nogringo 5f0edfa
fix picture letter size
nogringo 0f5864a
add pub.dev page
nogringo 9110576
NUserProfile use the NPicture widget
nogringo b81c27d
fix metadata in user widgets
nogringo bd75f8d
fix remove assertion
nogringo b081a88
add ndk_flutter to melos
1-leo 3f153b1
fix change requests
nogringo 94f8fdd
put accountsKey in the config
nogringo 0d9e242
Merge branch 'ndk-flutter' of https://github.com/relaystr/ndk into nd…
nogringo d4b7d3f
chore: version range
1-leo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Miscellaneous | ||
| *.class | ||
| *.log | ||
| *.pyc | ||
| *.swp | ||
| .DS_Store | ||
| .atom/ | ||
| .buildlog/ | ||
| .history | ||
| .svn/ | ||
| migrate_working_dir/ | ||
|
|
||
| # IntelliJ related | ||
| *.iml | ||
| *.ipr | ||
| *.iws | ||
| .idea/ | ||
|
|
||
| # The .vscode folder contains launch configuration and tasks you configure in | ||
| # VS Code which you may wish to be included in version control, so this line | ||
| # is commented out by default. | ||
| #.vscode/ | ||
|
|
||
| # Flutter/Dart/Pub related | ||
| # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. | ||
| /pubspec.lock | ||
| **/doc/api/ | ||
| .dart_tool/ | ||
| .flutter-plugins-dependencies | ||
| /build/ | ||
| /coverage/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # This file tracks properties of this Flutter project. | ||
| # Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
| # | ||
| # This file should be version controlled and should not be manually edited. | ||
|
|
||
| version: | ||
| revision: "20f82749394e68bcfbbeee96bad384abaae09c13" | ||
| channel: "stable" | ||
|
|
||
| project_type: package |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ## 0.0.1 | ||
|
|
||
| - basic widgets and methods |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| Copyright 2025 | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| This package helps you to easily produce Nostr apps by providing generics Widgets and functions. | ||
|
|
||
| ## Features | ||
|
|
||
| - Nostr widgets | ||
| - Login persistence | ||
|
|
||
| ## Getting started | ||
|
|
||
| ### Add dependencies | ||
|
|
||
| ```bash | ||
| flutter pub add ndk | ||
| flutter pub add ndk_flutter | ||
| ``` | ||
|
|
||
| ### Add internationalization | ||
|
|
||
| Follow the [Official documentation](https://docs.flutter.dev/ui/accessibility-and-internationalization/internationalization) | ||
|
|
||
| ```dart | ||
| import 'package:ndk_flutter/l10n/app_localizations.dart' as ndk_flutter; | ||
|
|
||
| MaterialApp( | ||
| localizationsDelegates: [ | ||
| ndk_flutter.AppLocalizations.delegate, // add this line | ||
| ], | ||
| ); | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| By default, the logged user is used for user widgets, you can overwrite it by providing a pubkey as parameter. | ||
|
|
||
| ```dart | ||
| import 'package:nostr_widgets/nostr_widgets.dart'; | ||
|
|
||
| // available widgets | ||
| NBanner(ndk); | ||
| NPicture(ndk); | ||
| NName(ndk); | ||
| NUserProfile(ndk); | ||
| NLogin(ndk); | ||
| NSwitchAccount(ndk); | ||
|
|
||
| final ndkFlutter = NdkFlutter(ndk: ndk) | ||
|
|
||
| // this method read the saved state from secure storage and add the signers in ndk | ||
| // typicaly called before runApp | ||
| ndkFlutter.restoreAccountsState(); | ||
|
|
||
| // call this every time the auth state change | ||
| ndkFlutter.saveAccountsState(); | ||
| ``` | ||
|
|
||
| ## TODO | ||
|
|
||
| - [ ] NUserProfile optionnal show nsec and copy | ||
| - [ ] NUserProfile show the letter in the Picture and make it as big as possible | ||
|
|
||
| ## Need more Widgets | ||
|
|
||
| Open an Issue | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| include: package:flutter_lints/flutter.yaml | ||
|
|
||
| # Additional information about this file can be found at | ||
| # https://dart.dev/guides/language/analysis-options |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| { | ||
| "@@locale": "en", | ||
| "createAccount": "Create your account", | ||
| "@createAccount": { | ||
| "description": "Button text for creating a new account" | ||
| }, | ||
| "newHere": "Are you new here?", | ||
| "@newHere": { | ||
| "description": "Question asking if the user is new to the platform" | ||
| }, | ||
| "nostrAddress": "Nostr Address", | ||
| "@nostrAddress": { | ||
| "description": "Label for nostr address input field" | ||
| }, | ||
| "publicKey": "Public Key", | ||
| "@publicKey": { | ||
| "description": "Label for public key input field" | ||
| }, | ||
| "privateKey": "Private Key (insecure)", | ||
| "@privateKey": { | ||
| "description": "Label for private key input field" | ||
| }, | ||
| "browserExtension": "Browser extension", | ||
| "@browserExtension": { | ||
| "description": "Label for browser extension login section" | ||
| }, | ||
| "connect": "Connect", | ||
| "@connect": { | ||
| "description": "Button text to connect with browser extension" | ||
| }, | ||
| "install": "Install", | ||
| "@install": { | ||
| "description": "Button text to install browser extension" | ||
| }, | ||
| "logout": "Logout", | ||
| "@logout": { | ||
| "description": "Button text to logout from the application" | ||
| }, | ||
| "nostrAddressHint": "[email protected]", | ||
| "@nostrAddressHint": { | ||
| "description": "Placeholder text for nostr address input field" | ||
| }, | ||
| "invalidAddress": "Invalid Address", | ||
| "@invalidAddress": { | ||
| "description": "Error message for invalid nostr address" | ||
| }, | ||
| "unableToConnect": "Unable to connect", | ||
| "@unableToConnect": { | ||
| "description": "Error message when unable to connect to nostr address" | ||
| }, | ||
| "publicKeyHint": "npub1...", | ||
| "@publicKeyHint": { | ||
| "description": "Placeholder text for public key input field" | ||
| }, | ||
| "privateKeyHint": "nsec1...", | ||
| "@privateKeyHint": { | ||
| "description": "Placeholder text for private key input field" | ||
| }, | ||
| "newToNostr": "New to Nostr?", | ||
| "@newToNostr": { | ||
| "description": "Question asking if the user is new to Nostr" | ||
| }, | ||
| "getStarted": "Get Started", | ||
| "@getStarted": { | ||
| "description": "Button text to get started with Nostr" | ||
| }, | ||
| "bunker": "Bunker", | ||
| "@bunker": { | ||
| "description": "Label for bunker login section" | ||
| }, | ||
| "bunkerAuthentication": "Bunker Authentication", | ||
| "@bunkerAuthentication": { | ||
| "description": "Title for bunker authentication toast" | ||
| }, | ||
| "tapToOpen": "Tap to open: {url}", | ||
| "@tapToOpen": { | ||
| "description": "Description for bunker authentication toast", | ||
| "placeholders": { | ||
| "url": { | ||
| "type": "String", | ||
| "example": "https://example.com/auth" | ||
| } | ||
| } | ||
| }, | ||
| "showNostrConnectQrcode": "Show nostr connect qrcode", | ||
| "@showNostrConnectQrcode": { | ||
| "description": "Button text to show nostr connect QR code" | ||
| }, | ||
| "loginWithAmber": "Login with amber", | ||
| "@loginWithAmber": { | ||
| "description": "Button text to login with Amber" | ||
| }, | ||
| "nostrConnectUrl": "Nostr connect URL", | ||
| "@nostrConnectUrl": { | ||
| "description": "Title for nostr connect URL dialog" | ||
| }, | ||
| "copy": "Copy", | ||
| "@copy": { | ||
| "description": "Button text to copy to clipboard" | ||
| }, | ||
| "addAccount": "Add account", | ||
| "@addAccount": { | ||
| "description": "Button text to add a new account" | ||
| }, | ||
| "readOnly": "Read-only", | ||
| "@readOnly": { | ||
| "description": "Label for read-only account type" | ||
| }, | ||
| "nsec": "Nsec", | ||
| "@nsec": { | ||
| "description": "Label for nsec (private key) account type" | ||
| }, | ||
| "extension": "Extension", | ||
| "@extension": { | ||
| "description": "Label for browser extension account type" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| { | ||
| "@@locale": "es", | ||
| "createAccount": "Crear tu cuenta", | ||
| "newHere": "¿Eres nuevo aquí?", | ||
| "nostrAddress": "Dirección Nostr", | ||
| "publicKey": "Clave pública", | ||
| "privateKey": "Clave privada (inseguro)", | ||
| "browserExtension": "Extensión del navegador", | ||
| "connect": "Conectar", | ||
| "install": "Instalar", | ||
| "logout": "Cerrar sesión", | ||
| "nostrAddressHint": "[email protected]", | ||
| "invalidAddress": "Dirección inválida", | ||
| "unableToConnect": "No se puede conectar", | ||
| "publicKeyHint": "npub1...", | ||
| "privateKeyHint": "nsec1...", | ||
| "newToNostr": "¿Nuevo en Nostr?", | ||
| "getStarted": "Comenzar", | ||
| "bunker": "Bunker", | ||
| "bunkerAuthentication": "Autenticación Bunker", | ||
| "tapToOpen": "Toca para abrir: {url}", | ||
| "showNostrConnectQrcode": "Mostrar código QR de nostr connect", | ||
| "loginWithAmber": "Iniciar sesión con Amber", | ||
| "nostrConnectUrl": "URL de conexión Nostr", | ||
| "copy": "Copiar", | ||
| "addAccount": "Añadir cuenta", | ||
| "readOnly": "Solo lectura", | ||
| "nsec": "Nsec", | ||
| "extension": "Extensión" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| { | ||
| "@@locale": "fr", | ||
| "createAccount": "Créer votre compte", | ||
| "newHere": "Êtes-vous nouveau ici?", | ||
| "nostrAddress": "Adresse Nostr", | ||
| "publicKey": "Clé publique", | ||
| "privateKey": "Clé privée (non sécurisé)", | ||
| "browserExtension": "Extension de navigateur", | ||
| "connect": "Se connecter", | ||
| "install": "Installer", | ||
| "logout": "Se déconnecter", | ||
| "nostrAddressHint": "[email protected]", | ||
| "invalidAddress": "Adresse invalide", | ||
| "unableToConnect": "Impossible de se connecter", | ||
| "publicKeyHint": "npub1...", | ||
| "privateKeyHint": "nsec1...", | ||
| "newToNostr": "Nouveau sur Nostr?", | ||
| "getStarted": "Commencer", | ||
| "bunker": "Bunker", | ||
| "bunkerAuthentication": "Authentification Bunker", | ||
| "tapToOpen": "Appuyez pour ouvrir: {url}", | ||
| "showNostrConnectQrcode": "Afficher le code QR nostr connect", | ||
| "loginWithAmber": "Se connecter avec Amber", | ||
| "nostrConnectUrl": "URL de connexion Nostr", | ||
| "copy": "Copier", | ||
| "addAccount": "Ajouter un compte", | ||
| "readOnly": "Lecture seule", | ||
| "nsec": "Nsec", | ||
| "extension": "Extension" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| { | ||
| "@@locale": "ja", | ||
| "createAccount": "アカウントを作成", | ||
| "newHere": "初めてですか?", | ||
| "nostrAddress": "Nostrアドレス", | ||
| "publicKey": "公開鍵", | ||
| "privateKey": "秘密鍵(安全ではありません)", | ||
| "browserExtension": "ブラウザ拡張機能", | ||
| "connect": "接続", | ||
| "install": "インストール", | ||
| "logout": "ログアウト", | ||
| "nostrAddressHint": "[email protected]", | ||
| "invalidAddress": "無効なアドレス", | ||
| "unableToConnect": "接続できません", | ||
| "publicKeyHint": "npub1...", | ||
| "privateKeyHint": "nsec1...", | ||
| "newToNostr": "Nostrは初めてですか?", | ||
| "getStarted": "始める", | ||
| "bunker": "バンカー", | ||
| "bunkerAuthentication": "バンカー認証", | ||
| "tapToOpen": "タップして開く:{url}", | ||
| "showNostrConnectQrcode": "nostr connect QRコードを表示", | ||
| "loginWithAmber": "Amberでログイン", | ||
| "nostrConnectUrl": "Nostr接続URL", | ||
| "copy": "コピー", | ||
| "addAccount": "アカウントを追加", | ||
| "readOnly": "読み取り専用", | ||
| "nsec": "Nsec", | ||
| "extension": "拡張機能" | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.