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
By default, the logged user is used for user widgets, you can overwrite it by providing a pubkey as parameter.
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 copyNUserProfile show the letter in the Picture and make it as big as possible
Need more Widgets
Open an Issue
Libraries
- l10n/app_localizations
- l10n/app_localizations_en
- l10n/app_localizations_es
- l10n/app_localizations_fr
- l10n/app_localizations_ja
- l10n/app_localizations_ru
- l10n/app_localizations_zh
- main/config
- main/ndk_flutter
- models/accounts
- models/models
- models/nip_05_result
- ndk_flutter
- verifiers/src/js_interop
- verifiers/src/nostr_verify_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/login/login_controller
- widgets/login/n_login
- widgets/login/nostr_connect_dialog_view
- widgets/name/n_name
- widgets/picture/n_picture
- widgets/switch_account/n_switch_account
- widgets/user_profile/n_user_profile
- widgets/widgets