Browse Source

neon: Paste from clipboard when adding news feed if it contains a URL

pull/46/head
jld3103 2 years ago
parent
commit
7d730b2433
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 14
      packages/neon/lib/src/apps/news/dialogs/add_feed.dart

14
packages/neon/lib/src/apps/news/dialogs/add_feed.dart

@ -26,6 +26,20 @@ class _NewsAddFeedDialogState extends State<NewsAddFeedDialog> {
} }
} }
@override
void initState() {
super.initState();
Clipboard.getData(Clipboard.kTextPlain).then((final clipboardContent) {
if (clipboardContent != null && clipboardContent.text != null) {
final uri = Uri.tryParse(clipboardContent.text!);
if (uri != null && (uri.scheme == 'http' || uri.scheme == 'https')) {
controller.text = clipboardContent.text!;
}
}
});
}
@override @override
Widget build(final BuildContext context) => StandardRxResultBuilder<NewsBloc, List<NewsFolder>>( Widget build(final BuildContext context) => StandardRxResultBuilder<NewsBloc, List<NewsFolder>>(
bloc: widget.bloc, bloc: widget.bloc,

Loading…
Cancel
Save