Official Website: www.tech101.co... Connect with us Facebook: / tech101nepal Instagram: / tech101nepal Twitter: / tech101nepal Pinterest: / tech101nepal
Пікірлер: 8
@Mfbzai Жыл бұрын
Amazing. what is the difference between svg image and any image extension over flutter? Is there any advantage?
@Masda.X6 ай бұрын
yes there is advantage by using svg image since it does not lose quality after resizing app
@Mfbzai6 ай бұрын
@@Masda.X However in flutter, the size of svg cannot be adaptive right?
@Masda.X6 ай бұрын
@@Mfbzai I am not sure, I will test and tell u
@Mfbzai6 ай бұрын
@@Masda.X thanks brother
@Masda.X6 ай бұрын
@@Mfbzai i tested and seems it can be adaptive, in my particular case of usage, I added github icon which is svg asset on app bar and it scales well. me myself is beginner so may be there is other ways to achieve this as well, here is my code: `class Overlay extends StatelessWidget { final String githubSvgAssetName = 'assets/images/github.svg'; const Overlay({super.key}); @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: Scaffold( appBar: AppBar( title: const Text(''), actions: [ InkWell( onTap: () { // Handle Github SVG press }, onHover: (hovering) { // Handle hover effect }, child: Padding( padding: const EdgeInsets.all(0), child: Transform.scale( scale: 3, // Adjust the scale factor as needed child: SvgPicture.asset( githubSvgAssetName, semanticsLabel: 'Github Logo', ), ), ), ),`