How to tap to copy html text in flutter app - flutter

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

Related

How to enable copy/paste on Flutter TextField widget?

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

Adding button in pdf made using pdf package in flutter

I am using the pdf package in flutter for generating pdf from the app. I need to add a clickable kind of thing(hyperlink, button) in pdf but the package doesn't provide any widget for that purpose. Also, the basic flutter widgets couldn't be used for generating the pdf files(restricted by the package). Is there any way to solve it?
Use the Stack widget to put any widget above the pdf ?
The problem is solved now, the pdf package provides the UrlLink for the purpose of opening a link when tapped on the page.
This is the short documentation for the same.
I did it like this-
pw.UrlLink(destination: imageUrl, child: pw.Text('LINK', style: pw.TextStyle(fontSize: size)))

How to customize file_picker UI in flutter

I find it difficult to customize the UI of the file picker. I want to implement a picker with my own new UI rather than a native picker. What should I do?
waiting for a good answer!
I'm not good at English, so I got help from a translator. thank you for reading.
https://github.com/fluttercandies/flutter_wechat_assets_picker
Is it possible to customize with this plugin?
You can use the photo_manager plugin to get all the photos and make your own file picker, but there is no way to modify the file_picker ui as it calls native file pickers directly.
you can use file_manager plugin it support android and linux by the time this answer was written .

How to hide the the navigationbar that present in pdf viewer plugin flutter

I need to hide the navigation bar that present default in the pdfviewer plugin flutter.I used to change the value of showNavigation value to false but it doesn't work .I use the plugin flutter_plugin_pdf_viewer:any here is my code:
Containe( width:130,
height:130,
margin:EdgeInsets.all(20.0),
child:PDFViewer(document:doc2,
showNavigation : false,/*here is my issue ,when i set like this it shows nothing in the UI*/ ),)
This plugin solves this issue please check the below link
https://github.com/lohanidamodar/pdf_viewer/pull/2
Use this plugin
advance_pdf_viewer: any
I have solved this issue by changing source code of this plugin. for hiding navigation tool bar in the pdf viewer plugin use this plugin for viewing only single page from pdf :)
https://github.com/SmilingDeveloper/newpdf_viewer.git

Is window copyable in Flutter

I need copy data of window and add to clipboard. I searched and I found nothing.
I reiceved data from rest api with html tags and I use html view for render the html tag. that's why I can't selectable text.
How to copy data of window or body of stateful widget? Any idea?
If you want to copy text from your app, you can use the SelectableText widget. There was recently a Widget of the Week video on it here:
https://www.youtube.com/watch?v=ZSU3ZXOs6hc&vl=en
There isn't a way to copy images or other data except for text, as far as I know.
You can use the following package to capture a screenshot.
Add the following to install
dependencies:
screenshot: ^0.1.1
Then import it
import 'package:screenshot/screenshot.dart';
Example can be found here Screenshot Example
References
screenshot package