This package helps you to easily produce Nostr apps by providing generics Widgets and functions.

Features

  • Nostr widgets
  • Login persistence

Getting started

Add dependencies

flutter pub add ndk
flutter pub add ndk_flutter

Add internationalization

Follow the Official documentation

import 'package:ndk_flutter/l10n/app_localizations.dart' as ndk_flutter;

MaterialApp(
    localizationsDelegates: [
        ndk_flutter.AppLocalizations.delegate, // add this line
    ],
);

Usage

import 'package:ndk/ndk.dart';
import 'package:ndk_flutter/ndk_flutter.dart';

// wrap your Ndk instance
final ndkFlutter = NdkFlutter(ndk: ndk);

// reads saved accounts from secure storage and registers their signers in ndk
// typically called before runApp
await ndkFlutter.restoreAccountsState();

// call this every time the auth state changes
await ndkFlutter.saveAccountsState();

// available widgets (take ndkFlutter, not ndk)
NBanner(ndkFlutter: ndkFlutter);
NPicture(ndkFlutter: ndkFlutter);
NName(ndkFlutter: ndkFlutter);
NUserProfile(ndkFlutter: ndkFlutter);
NLogin(ndkFlutter: ndkFlutter);
NSwitchAccount(ndkFlutter: ndkFlutter);

By default, the logged-in user is used for user widgets; you can override it by passing a pubkey parameter.

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

Libraries

data_layer/data_sources/nip55_signer
data_layer/repositories/signers/nip55_event_signer
l10n/app_localizations
l10n/app_localizations_de
l10n/app_localizations_en
l10n/app_localizations_es
l10n/app_localizations_fi
l10n/app_localizations_fr
l10n/app_localizations_it
l10n/app_localizations_ja
l10n/app_localizations_pl
l10n/app_localizations_pt
l10n/app_localizations_ru
l10n/app_localizations_sk
l10n/app_localizations_zh
main/config
main/ndk_flutter
models/accounts
models/models
models/nip_05_result
ndk_flutter
ndk_method_channel
ndk_platform_interface
repositories/cashu_seed_store
repositories/flutter_secure_storage_wallets_repo
signers/ndk_event_signer
Auto-platform Nostr event signer that uses the best implementation for the current platform.
signers/nip07_event_signer
NIP-07 browser-extension signer for Nostr.
signers/src/event_signer_web
signers/src/ndk_event_signer_native
signers/src/nip07_event_signer_stub
signers/src/nip07_event_signer_web
signers/src/nip07_js_interop
signers/src/nostr_sign_js
signers/src/web_event_signer_stub
signers/web_event_signer
Fast web-based Nostr event signer using native Web Crypto APIs.
utils/nip_avatar
utils/nostr_kinds
utils/string_color
verifiers/ndk_event_verifier
verifiers/ndk_event_verifier_native
verifiers/ndk_event_verifier_stub
verifiers/ndk_event_verifier_web
verifiers/src/js_interop
verifiers/src/nostr_crypto_js
verifiers/src/web_event_verifier_stub
verifiers/src/web_event_verifier_web
verifiers/web_event_verifier
Fast web-based Nostr event verifier using native Web Crypto APIs.
widgets/banner/n_banner
widgets/locale_switcher/n_locale_switcher
widgets/login/login_controller
widgets/login/n_login
widgets/login/nostr_connect_dialog_view
widgets/name/n_name
widgets/pending_requests/n_pending_requests
widgets/picture/n_picture
widgets/switch_account/n_switch_account
widgets/user_profile/n_user_profile
widgets/wallets/n_add_wallet_dialogs
widgets/wallets/n_cashu_seed_backup_warning
widgets/wallets/n_pending_transactions
widgets/wallets/n_recent_transactions
widgets/wallets/n_wallet_actions
widgets/wallets/n_wallet_card
widgets/wallets/n_wallet_card_list
widgets/wallets/n_wallets
widgets/wallets/wallet_action_dialogs
widgets/widgets