How do I determine the width and height of an image in Flutter?

The other answers seem overly complicated if you just want the width and height of an image in an async function. You can get the image resolution using flutter lib directly like this: import ‘dart:io’; File image = new File(‘image.png’); // Or any other way to get a File instance. var decodedImage = await decodeImageFromList(image.readAsBytesSync()); …

Read more

Setting BOLD font on iOS UILabel

It’s a fishy business to mess with the font names. And supposedly you have an italic font and you wanna make it bold – adding simply @”-Bold” to the name doesn’t work. There’s much more elegant way: – (UIFont *)boldFontWithFont:(UIFont *)font { UIFontDescriptor * fontD = [font.fontDescriptor fontDescriptorWithSymbolicTraits:UIFontDescriptorTraitBold]; return [UIFont fontWithDescriptor:fontD size:0]; } size:0 means …

Read more