diff --git a/analysis_options.yaml b/analysis_options.yaml index 61b6c4d..80d57c4 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -22,6 +22,7 @@ linter: # `// ignore_for_file: name_of_lint` syntax on the line or in the file # producing the lint. rules: + - public_member_api_docs # avoid_print: false # Uncomment to disable the `avoid_print` rule # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule diff --git a/lib/data_layer/data_sources/isar_db.dart b/lib/data_layer/data_sources/isar_db.dart index b8956e4..c227dde 100644 --- a/lib/data_layer/data_sources/isar_db.dart +++ b/lib/data_layer/data_sources/isar_db.dart @@ -10,6 +10,7 @@ import '../models/db/db_relay_set.dart'; import '../models/db/db_user_relay_list.dart'; class IsarDbDs { + // the isar obj late Isar isar; IsarDbDs(); diff --git a/lib/provider/relay_provider.dart b/lib/provider/relay_provider.dart index ceb2311..07ded9c 100644 --- a/lib/provider/relay_provider.dart +++ b/lib/provider/relay_provider.dart @@ -58,22 +58,6 @@ class RelayProvider extends ChangeNotifier { return ""; } - Future getNip51RelaySet(String name) async { - Nip51Set? r = await ndk.lists.getCachedNip51RelaySet(name, loggedUserSigner!); - if (r == null) { - ndk.lists.getSingleNip51RelaySet(name, loggedUserSigner!); - } - return r; - } - - Future getNip51List(int kind) async { - Nip51List? r = await ndk.lists.getCachedNip51List(kind, loggedUserSigner!); - if (r == null) { - ndk.lists.getSingleNip51List(kind, loggedUserSigner!); - } - return r; - } - void onRelayStatusChange() { notifyListeners(); } diff --git a/lib/ui/badge_component.dart b/lib/ui/badge_component.dart index 916b9d5..81e7a3e 100644 --- a/lib/ui/badge_component.dart +++ b/lib/ui/badge_component.dart @@ -10,7 +10,7 @@ class BedgeComponent extends StatelessWidget { BadgeDefinition badgeDefinition; - BedgeComponent({ + BedgeComponent({super.key, required this.badgeDefinition, }); diff --git a/lib/ui/content/content_mention_user_component.dart b/lib/ui/content/content_mention_user_component.dart index 3cc07fc..0b5758d 100644 --- a/lib/ui/content/content_mention_user_component.dart +++ b/lib/ui/content/content_mention_user_component.dart @@ -9,9 +9,9 @@ import '../simple_name_component.dart'; import 'content_str_link_component.dart'; class ContentMentionUserComponent extends StatefulWidget { - String pubkey; + String _pubkey; - ContentMentionUserComponent({super.key, required this.pubkey}); + ContentMentionUserComponent({super.key, required String pubkey}) : _pubkey = pubkey; @override State createState() { @@ -25,18 +25,18 @@ class _ContentMentionUserComponent extends State { return Selector( builder: (context, metadata, child) { String name = - SimpleNameComponent.getSimpleName(widget.pubkey, metadata); + SimpleNameComponent.getSimpleName(widget._pubkey, metadata); return ContentStrLinkComponent( str: "$name", showUnderline: false, onTap: () { - RouterUtil.router(context, RouterPath.USER, widget.pubkey); + RouterUtil.router(context, RouterPath.USER, widget._pubkey); }, ); }, selector: (context, _provider) { - return _provider.getMetadata(widget.pubkey); + return _provider.getMetadata(widget._pubkey); }, ); } diff --git a/lib/ui/new_notes_updated_component.dart b/lib/ui/new_notes_updated_component.dart index f84f8d6..425377b 100644 --- a/lib/ui/new_notes_updated_component.dart +++ b/lib/ui/new_notes_updated_component.dart @@ -8,11 +8,11 @@ import '../main.dart'; class NewNotesUpdatedComponent extends StatelessWidget { Function? onTap; - String text; + String _text; List newEvents; - NewNotesUpdatedComponent({super.key, required this.newEvents, required this.text, this.onTap}); + NewNotesUpdatedComponent({super.key, required this.newEvents, required String text, this.onTap}) : _text = text; @override Widget build(BuildContext context) { @@ -63,7 +63,7 @@ class NewNotesUpdatedComponent extends StatelessWidget { return UserPicComponent(pubkey: pubKey, width: width + 10); }).toList(), // ), - Text(text,style: TextStyle(color: textColor), + Text(_text,style: TextStyle(color: textColor), ) ])) ); diff --git a/lib/ui/user/metadata_component.dart b/lib/ui/user/metadata_component.dart index 6167041..55efa00 100644 --- a/lib/ui/user/metadata_component.dart +++ b/lib/ui/user/metadata_component.dart @@ -8,26 +8,26 @@ import 'metadata_top_component.dart'; import 'user_badges_component.dart'; class MetadataComponent extends StatefulWidget { - String pubKey; + final String _pubKey; - Metadata? metadata; + final Metadata? _metadata; - bool jumpable; + final bool _jumpable; - bool showBadges; + final bool _showBadges; - bool userPicturePreview; + final bool _userPicturePreview; - bool followsYou; + final bool _followsYou; - MetadataComponent({super.key, - required this.pubKey, - this.metadata, - this.jumpable = false, - this.showBadges = false, - this.userPicturePreview = false, - this.followsYou = false - }); + const MetadataComponent({super.key, + required String pubKey, + Metadata? metadata, + bool jumpable = false, + bool showBadges = false, + bool userPicturePreview = false, + bool followsYou = false + }) : _pubKey = pubKey, _metadata = metadata, _jumpable = jumpable, _showBadges = showBadges, _userPicturePreview = userPicturePreview, _followsYou = followsYou; @override State createState() { @@ -41,22 +41,22 @@ class _MetadataComponent extends State { List mainList = []; mainList.add(MetadataTopComponent( - pubkey: widget.pubKey, - metadata: widget.metadata, - jumpable: widget.jumpable, - userPicturePreview: widget.userPicturePreview, - followsYou: widget.followsYou, + pubkey: widget._pubKey, + metadata: widget._metadata, + jumpable: widget._jumpable, + userPicturePreview: widget._userPicturePreview, + followsYou: widget._followsYou, )); - if (widget.showBadges) { + if (widget._showBadges) { mainList.add(UserBadgesComponent( - pubkey: widget.pubKey, + pubkey: widget._pubKey, )); } var themeData = Theme.of(context); - if (widget.metadata != null && - StringUtil.isNotBlank(widget.metadata!.about)) { + if (widget._metadata != null && + StringUtil.isNotBlank(widget._metadata!.about)) { mainList.add( Container( width: double.maxFinite, @@ -74,7 +74,7 @@ class _MetadataComponent extends State { mainAxisSize: MainAxisSize.min, children: ContentDecoder.decode( context, - widget.metadata!.about!, + widget._metadata!.about!, null, showLinkPreview: false, ), diff --git a/pubspec.lock b/pubspec.lock index 576d9e0..2a3619f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1308,7 +1308,7 @@ packages: path: "../dart_ndk" relative: true source: path - version: "0.1.0-dev93" + version: "0.1.0-dev95" nested: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 2bca750..bd3d48b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -125,13 +125,13 @@ dependencies: lottie: ^3.1.2 bolt11_decoder: ^1.0.2 - ndk: ^0.1.0-dev94 +# ndk: ^0.1.0-dev95 # ndk: # git: # url: https://github.com/relaystr/dart_ndk.git # ref: master -# ndk: -# path: ../dart_ndk + ndk: + path: ../dart_ndk dev_dependencies: flutter_launcher_icons: ^0.13.1