How to remove builtin padding from Icon - flutter

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!

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.

Bottom sheet width is half of the screen flutter

Flutter i am developing an app in 8 inch emulator. As you can see in the image my bottom sheet doesnt cover all the width. I tried to change constraints, containers width but nothing has changed.
i will add code in comment
Did you try getting rid of the top Center? You don't include the rest of the modal, so the combo of the Center, and perhaps some width constraint you have further down is limiting the width. Otherwise, include your full modal code in the question section, not the comments.

How can I control the Stoke ( thikness ) of the icons

when we put an Icon Like this
Icon(
Icons.notifications_outlined,
)
we can control the size and color... of that icon, but I want to control the Stroke width of the Icon (not the size of the icon, I want to control the width of the icon's line )
is it possible by any widget or any other way in flutter SDK?
please don't recommend packages of other icons
thanks
I didn't find any way from the flutter SDK to control the icons thinkers, I tried using CustomPainter, BoxShadow()...
alternatively, I used a different icons package which is the Ionicons, which belongs to the Ionic framework, I found out that there is a flutter package for those icons, see Ionicons
you can see a list of all icons here, https://ionic.io/ionicons
and they can be used like this:
Icon(Ionicons.add)
Icon(Ionicons.add_outline)
Icon(Ionicons.add_sharp)

How to prevent widgets from being hidden behind the system status bar

So I am creating a new flutter widget and I am unable to understand how my app looks because of the space on top of the screen in my emulator,
As you can see there is a shaded area on top and my widgets are under it, is there any way to remove it?
Use Safe Area.
SafeArea is basically a glorified Padding widget. If you wrap another widget with SafeArea, it adds any necessary padding needed to keep your widget from being blocked by the system status bar, notches, holes, rounded corners, and other "creative" features by manufacturers.
Check this link for more.
Wrap your code with the SafeArea.
more info about SafeArea class

how to add a button on an jpg image in 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 ?