Solved; see below.
I'm trying to export a logo from XD and set it up as my app icon with flutter_launcher_icons (https://pub.dev/packages/flutter_launcher_icons), but it doesn't look like intended. I'm not even sure, if he issue is flutter related or if I'm making mistakes when exporting from XD. So I'm a bit lost.
Here is what it looks like, what I tried and what it should look like:
In the screen where I can flip betwen apps, the icon doesn't fill the circle for the app icon, but is put there as a rectangle:
Same in the drawer with all the apps:
I tried using a square with nothing but the background color and set it as icon background in pubspec.yaml:
adaptive_icon_background: '.\assets\icons\logo_icon_background.png'
But that then looks like this:
EDIT: It stays the same, if I also specify the adaptive icon foregroud ( adaptive_icon_foreground: '.\assets\icons\logo_launch_dummy.png')
For reference, this is the look I'm after (wihtout context like the shadow etc.):
Thanks for any help!
For Posterity: It worked out when I created a new image file with the logo path and the background color all in one png, size 512x512. Then just doing this in pubspec.yaml was enough:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: "^0.9.2"
flutter_icons:
android: true
ios: true
image_path: '.\assets\icons\logo_launch_dummy.png'
So the issue was with me exporting things from XD without enough care for the dimensions.
Related
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)
I am building a Flutter web app. I use a handful of material icons, but it brings the whole MaterialIcons-Regular.otf file with it. It is of 1.6 MB and takes time to load.
Is there a way to only bring the icons I need?
I can only think of using the icons as SVGs and bringing them separately with flutter_svg package.
when I type Icons.??? the suggestions don't show up the spinner keeps spinning but never finishes but regular suggestion for regular code show up with no problems. It was working before but I don't know why it stopped working
when I scroll through icons. it loads out very slowly and the ones that are loaded show up in the suggestions
I have tried invalidate caches/restart but didn't work
Do Flutter Clean (Tools>Flutter>Flutter Clean) then Flutter Pub get
and make sure that cupertino_icons is installed in pubspec.yaml file
cupertino_icons: ^1.0.2
My app displays wrong icons.
In my material\icons.dart shows a totally diferent name for the icon.
Problem with flutter version. Nedded to the correct flutter version/update.
Hey so I have this problem, I want to use some icons that are listed here but in my flutter it says the name isn't defined. I already tried to do flutter clean and the problem still exists (I need to use Icons.password and Icons.person_off). Do you have any idea how to fix it? Thanks in advance
Go on to the pubspec.yaml file and enable the material dependecies like
uses-material-design: true also if you still not found your icon then go to https://fonts.google.com/icons this page and search for your icon and after clicking on your icon it will show you the code for implementing that icon on web, android, flutter and IOS.