how to add a button on an jpg image in flutter - flutter

I have a jpg and a PNG image file, on which I want to add a button, the image is huge, so when we zoom in the image, the image expands, the button should also expand and contract, I've tried everything, but nothing seems to work. any solutions ?

You probably need to use a Stack widget to have your button on top of your image.
You may also need an AnimatedContainer to change the width and height of your button.
If you already tried this solution, can you share with us your code ?

Related

Add margins in a png file

I have a generated png file with a barcode, I need to save the file on the device, can I add margins on the sides to the picture so that the barcode is read correctly
One way to achieve this can be using the screenshot package (that takes a screenshot of the child widget and saves it as a .png file) to take a screenshot of the image widget inside a padding widget. Give the padding the value you want to see as a margin in the image.
Another approach can be generating that barcode in .svg format and modifying its code before saving.
Or give RepaintBoundary a try.

Unable to scroll until bottom

I tried to follow this link to create a scrollable UI: https://www.youtube.com/watch?v=ArH0S2Cdptk&t=21s&ab_channel=AlexanderZotov
If I use Text, it is working as expected. But if I use TextMeshPro, it won't scroll until bottom.
When Loaded it look like this
When I scroll down normally, it only reaches up to this point.
If I try to force the scroll, it would reach here but if I release my scroll, it will return to the 2nd image.
Here's my objects:
My text container is connected to TMP rect.
Why is it that it won't go to the bottom normally when I scroll?
Note: The height of the TMP has the whole text included without any truncation.
I don't know why, if I just use the exact height of my text, it won't work. But if I just doubled the height, it is working as my expectation.

Make a Flutter textfield background as a notebook style (lined textfield)

I want to make a notebook page in my app like the one in the image below, I do not want a customPaint or SVG or any kind of photos I want when I scroll the page the lines still under the text, is there any custom textField with a lined background to use?

How to remove builtin padding from Icon

It seems the Icon widget has a built-in padding, but I would like to remove the padding in order to properly align the icon with other widgets on the left side.
As you can see from the screenshot below, the widget itself is perfectly aligned to the left (I wrapped the Icon in a Container with background color just for testing purposes), but the icon has some padding and it looks missaligned.
Is there a possibility to remove this padding?
I just checked the Icon implementation (you can take a look as well) and could not find anything about added padding. I am not 100% certain but I assume the whitespace is from the icon itself.
I have an alternative solution though:
Get the icon in SVG format (you can download Google Icons from Google Fonts
Remove the padding using a SVG editor (you can use Figma Free version)
Add the icon as an asset in your pubspec.yaml
Good luck!

Is there a way to add shadow behind the app bar action buttons in Flutter?

I am using SliverAppBar widget with some background image behind it. Since the image I will load will be dynamic, sometimes it can have light colors and can cause the back button (or any other action button) to be hardly visible.
As you can see in the screenshot below, I gave a little shadow to the app bar title using TextStyle & Shadow widgets, so it is much more visible than the back button.
You can try use "elevation" here is the Flutter link for more clarification: https://www.google.com/url?sa=t&source=web&rct=j&url=https://api.flutter.dev/flutter/material/SliverAppBar/elevation.html&ved=2ahUKEwiEpfiIn4TwAhWUH7cAHY9ECIwQFjACegQIBRAC&usg=AOvVaw0wCdyaVv3EA8ulVXXvaVMu