login and keys manage

This commit is contained in:
DASHU
2024-08-31 02:53:49 +08:00
parent 7c109f15c4
commit 47f02c72b0
8 changed files with 298 additions and 63 deletions

View File

@@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import 'package:nostr_sdk/nip19/nip19.dart';
class UserNameComponent extends StatefulWidget {
String pubkey;
bool fullNpubName;
UserNameComponent(this.pubkey, {this.fullNpubName = false});
@override
State<StatefulWidget> createState() {
return _UserNameComponent();
}
}
class _UserNameComponent extends State<UserNameComponent> {
@override
Widget build(BuildContext context) {
var npub = Nip19.encodePubKey(widget.pubkey);
if (!widget.fullNpubName) {
npub = Nip19.encodeSimplePubKey(widget.pubkey);
}
return Text(
npub,
maxLines: 1,
overflow: TextOverflow.ellipsis,
);
}
}