If a user has entered any URL while typing the description in the textfield and I want that url to be detected and want a preview of that URL displayed as well.
Does anyone have some ideas on how that can be achieved?
If a user has entered any URL while typing the description in the textfield and I want that url to be detected and want a preview of that URL displayed as well.
Does anyone have some ideas on how that can be achieved?
2
Answers
You can listen to the
TextEditingController
to detect it when it’s printed, in my example, I will recognize the URL that contains "http" text :in
StatefulWidget
:The
TextField
widget:after a hot restart, when your type in the
TextField
, if some text starts with the "http" ( which is the URL) the listener will print it.you can use it to achieve your goal.
you can use anylink package :