nostr_widgets 0.0.3 copy "nostr_widgets: ^0.0.3" to clipboard
nostr_widgets: ^0.0.3 copied to clipboard

A Flutter UI package providing ready-to-use widgets.

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

Demo app #

The demo app is available here

Features #

  • Nostr widgets
  • Login persistence

Getting started #

Add dependencies #

flutter pub add ndk
flutter pub add nostr_widgets

Add internationalization #

Follow https://docs.flutter.dev/ui/accessibility-and-internationalization/internationalization

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

localizationsDelegates: [
    nostr_widgets.AppLocalizations.delegate,
],

Usage #

By default, the logged user is used for user widgets, you can overwrite it by providing the pubkey parameter when available.

import 'package:nostr_widgets/nostr_widgets.dart';

// login page with all login methods
final loginPage = ListView(
    children: [
        NLogin(ndk),
    ],
);

// user info
final userPage = ListView(
    children: [
        NUserProfile(ndk),
    ],
);

final userBanner = NBanner(ndk);
final userPicture = NPicture(ndk);
final userName = NName(ndk);

// call this to connect user from local storage
nRestoreAccounts(ndk);

// call this every time the auth state change
nSaveAccountsState(ndk);

TODO #

  • ❌ NPicture letter as big as possible
  • ❌ 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 or ask me on Nostr npub1kg4sdvz3l4fr99n2jdz2vdxe2mpacva87hkdetv76ywacsfq5leqquw5te

0
likes
150
points
10
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter UI package providing ready-to-use widgets.

Repository (GitHub)
View/report issues

Topics

#ndk #nostr #widget

Documentation

API reference

License

MIT (license)

Dependencies

crypto, flutter, flutter_localizations, flutter_secure_storage, get, http, intl, ndk, nip01, nip07_event_signer, nip19, url_launcher

More

Packages that depend on nostr_widgets