Search option in syncfusion_flutter_pdfviewer package flutter does not work - flutter

My goal is to use the search option on pdf, I found this package but I am having trouble using it, Do you have any suggestions for me?
1- TextSearchOption in syncfusion_flutter_pdfviewer package doesn't work (it's not defined).1
2- Another case is when I use this option ( Link ) in pdf but it doesn't work when I enter a text to search

1 - In order to TextSearchOption work, you need to import the syncfusion pdf. Add import "package:syncfusion_flutter_pdf/pdf.dart"; at the top of the file.
https://help.syncfusion.com/flutter/pdf-viewer/text-search
Import ‘package:syncfusion_flutter_pdf/pdf.dart’ in the Dart code if
you use the TextSearchOption parameter.
This will make the text inside the parenthesis to be searched: _pdfViewerController.searchText('the'). It will show all the "the" found in the pdf.
Here's a working example of the code you show on your picture.
2 - The link also gives an example of how to implement a search bar:
https://help.syncfusion.com/flutter/pdf-viewer/text-search#how-to-create-and-display-a-custom-search-toolbar-with-the-search-features

Related

How do I upload Icons from material-ui?

I have run npm install using material-ui icons
npm install #material-ui/icons
and imported the search icon in my code but I have not getting any output.
import SearchIcon from "#material-ui/icons/Search";
when I call the search icon
<SearchIcon />
the program outputs a blank screen but without it the code works fine. Does anyone know why the icon is not showing?
This is my code if it helps
The icons are not exported as default on the Material UI library. Therefore you also shouldn't try to import them as default. Try something like this:
import { Search as SearchIcon } from "#mui/icons-material";

Can not import font family

Hello everyone one i am trying to import a font family in my flutter project. I downloaded the ttf file and import it in the pubs pubspec.yaml like on the picture. I did pub get and get the following error: expected fonts to either be null or a list like on the picture. I also tried to add many assets but getting another error. I searched on Google about the error but found nothing. Please help mepuspec.yaml
You have to add a space between your dash and asset at line 44
YAML is a file format that is layout sensitive (see: https://www.cloudbees.com/blog/yaml-tutorial-everything-you-need-get-started)

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

How do I modify a library in flutter?

I'm using a library that draws barcodes and under them it drows the barcode number, however it draws text just in black color. I found the code that chooses the color during this operations, however when I try to change this code library from Colors.black to Colors.white and I save it, it doesn't save for some reason. So I suppose there is a different way to modify code from library, but I don't know how.
#Gabriel, You can easily copy .dart files from the package/library you're using to your project and modify the code to your liking. For e.g. if you are using https://pub.dev/packages/toggle_switch, then you can access the source code from the GitHub location of the package in pub.dev and download it from GitHub,
You can then copy .dart files from <project>/lib to your <project>/lib and modify them accordingly. Make sure you add reference in the source code to credit the original developers and add their GitHub link.
Good luck!

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