Icons in Leaflet tooltips - leaflet

Trying to add an icon to Leaflet tooltip, but unsuccessfully - does anyone have an example?
For example, adding
layer.bindTooltip(msg+"<i class=\"fas fa-headphones\"></i>")
doesn't work
Thanks

The string you add to a tooltip can be a html string:
layer.bindTooltip("<div><span style='display:block'><strong>Custom Html with an Icon<strong></span><img src='https://pbs.twimg.com/profile_images/780792637481689088/8y-GChEY.jpg' width='30' /></div>");
But I think your problem is that your Font-Awesome style is not working. Have you added the library to your project?

Related

How does the coloring work the latest Flutter SVG package (flutter_svg 2.0.0+1)

After upgrading the flutter_svg package to the latest version as of this date (2.0.0+1).
The linting says that the color member is depreciated, but there's this parameter called "colorFilter", but it has different enum properties that somehow render differently. Can someone explain how to just add normal color properties to an SVG or how the colorFilter properly works thanks.
Link to the package on pub dev
Please to you SVG package down grade to version and resolve this problem
In my case, I used ColorFilter.mode with BlendMode.scrIn and it works fine, other modes didn't seem to be working visiually properly. So if you want to set color to svg, it should work if you used it with right BlendMode.
P.S
I had bottom navigation where I had to change colors of active svg icons.
code example

How to display SVG Templates in SwiftUI

I am trying to display an SVG Template in my SwiftUI app.
So, I have a var svgTemplate: String variable in my SwiftUI App that contains an SVG Template string, an example is displayed below
"<svg width=\"1024\" height=\"440\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:
<!-- more data -->
xml:space=\"preserve\" text-anchor=\"start\" font-family=\"
Helvetica, Arial, sans-serif\" font-size=\"24\" id=\"svg_1\" y=\"151.52317\"
x=\"93.43789\" stroke-width=\"0\" fill=\"#000000\">This is sample svg template
</text>\n </g>\n</svg>"
Now, I want to render this SVG Template in my SwiftUI app, but I cannot figure out a way to do so.
I tried to convert my svgTemplate to a base64StringImage so that I can display a base64StringImage by extending the Image View, but I cannot find a way to convert my svgTemplate to a base64StringImage.
The other way I tried was just to display the svgTemplate but that was unsuccessful as well.
Any kind of solution would be helpful.
Thank you in advance! :)

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 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

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