How to enable copy/paste on Flutter TextField widget? - flutter

Trying to find the answer using Google search was a problem for me. This is really surprising. I want to be able to copy and paste TextField contents between different TextField's.

you can use :
SelectableText("hello over there")

use Clipboard
Clipboard.setData(ClipboardData(text: name_cont.text))
This answer may help you:
https://stackoverflow.com/a/46260376/1136999

Related

How to tap to copy html text in flutter app

My developer is building an educational app for me and we kind of have a problem. I want to know how to tap a word or phrase on the screen to show copy, highlight, web search like the image below. The app was built with flutter and the code is in dart. This feature is really needed. Will appreciate if someone can help with a plugin or just a way to do this.
If you are using webview package you have a gestureRecognizers property in webview widget, just add this line:
WebViewPlus(
gestureRecognizers: {}..add(Factory<LongPressGestureRecognizer>(() =>
LongPressGestureRecognizer())),...)
Flutter has selectable text for that
If he is using webview, maybe this could help?
How to enable text selection modal(copy/paste/select) in flutter webview?
They is a package for copy and paste text in the flutter.
FlutterClipboard.copy(item.code).then((value) {})
package link
Well I got your problem.
There is a possible solution. Here you are doing is sending data from server in html format and displayed it using html_viwer. But there is no functionality I found to select and copy so far.
The possible solution is send string data from server and use SelectableText() to show the text and you will be able to select and copy your text.
There's a solution for this, just use SelectableHtml widget instead of only Html

Style parameter can't be identified

I'm actually new to flutter and dart and I'm facing a problem for a couple of hours. I am using VS code and the code is from a tutorial (The code is working for the Tutor just fine...).
The Problem is that the style Parameter as seen in the following picture can't be identified.
Picture of code
Picture of Problem
I've already read a view other posts of stackoverflow, but I dont get it. My Path variables should be all right and I've checked all extensions and everything works right.
Also my Dart Sdk path in VScode is set to the right location:
C:\Users\Steffen Hain\flutter\bin\cache\dart-sdk
Appreciate your help!
your problem is that you closed the text widget before the style just remove the comma and the bracket shown in the image and put it where the blue arrow is:
hope it helped

UILabel with Link with more than one line

i want to use UILabel with link.
for that i am using IFTweetLabel which is finding any link and showing a line under it and it is clickable.
but if a string is big then only first line is getting hyperlink instead of complete URL.
as an issue with https://github.com/clawoo/IFTweetLabel/issues/3.
so is there any other option for it , or other library ?
First you have to import RegexKitLite framework. Go through this link. Surely this will help you. It gives same thing as you want.
http://furbo.org/stuff/FancyLabel_1.0.zip
First thing I would like to suggest is
Use UITextView with editing property as NO and it will automatically detect all the links separately similar like the one you need.
textview.editable = NO;
textview.dataDetectorTypes = UIDataDetectorTypeAll;
If you still want to go with UILabel then
You can achieve this by using NSArrtibutedStrings — but I would recommend to use some wrapper around this C-functions. I like OHAttributedLabel.
The demo included shows exactly, how hyperlinks can be handled.
You should give a try to three20 project.
what is the reason for not using UITextView..there is link detection property for UITextView.Your app is not going to get rejected

Add an icon to a Perl/GTK application

I've written a little app in perl/Gtk, now I want to add an icon to it. I"ve got a jpg file.
The app is very basic, and of course use a Gtk2::Window object.
I was thought to use Image::Base::Gtk2::Gdk::Pixbuf but Gtk2::Window->set_default_icon only want a Gtk2::Gdk::Pixbuf object, and I have not managed to create one (if someone can show me). I'm on a debian with perl-5.14.2.
Thanks guys!
Oh, got it!
use Image::Base::Gtk2::Gdk::Pixbuf;
my $navIco = Gtk2::Gdk::Pixbuf->new_from_file("./mltwb.png"); `
$window->set_default_icon($navIco);`
Just had to read doc. Thanks folks!

IOS 4.0 is it a way to add hipperlink kind of interaction to some range of NSMutableAttributetString?

hi i'm building app with some rich text content on it and text content i have with NSMutableAttributedString. I cought links in my text with regex and made it blue but don't see the way to add some interaction to string ranges of NSAttributedString. is it any way? is there a way to do so?
thank you
here is answer for my own question. I'm new to apple development so this project might be really dirty but it works for me, if anybody wants to improve it or has any suggestions please let me know, lets make this text project better ;) textViewProject