0
votes

"Impossible d'ajouter une image SVG dans NetworkImage in Flutter"

J'essaie d'ajouter NetworkImage Intérieur conteneur mais quand j'ajouter .svg image i Get d'erreur mais cela fonctionne pour les autres formats comme .png , .jpeg , etc xxx

erreur: xxx


0 commentaires

3 Réponses :


1
votes

flutter ne prend pas en charge svg format pourtant (problème) < / a>.

Vous pouvez utiliser flutter_svg 0.13.0 + 2 , une bibliothèque à Charger et afficher svg fichiers


0 commentaires

0
votes

Une autre solution utilisant flutter_svg package: info xxx < / pré>


0 commentaires

0
votes

Pour mon cas, je consommais un point de terminaison avec SVGS:

ListView.builder(
           shrinkWrap: true,
             scrollDirection: Axis.vertical,
             itemCount: countries.length,
             physics: ScrollPhysics(),
             itemBuilder: (context, index){
               final Widget networkSvg = SvgPicture.network(
                   '${countries[index].flag}',
                   fit: BoxFit.fill,
                   semanticsLabel: 'A shark?!',
                   placeholderBuilder: (BuildContext context) => Container(
                       padding: const EdgeInsets.all(30.0),
                       child: const CircularProgressIndicator(
                         backgroundColor: Colors.redAccent,
                       )),);
               return
                 Column(
                   children: [
                     ListTile(
                       title: Text('${countries[index].name}'),
                       leading: CircleAvatar(
                         backgroundColor: Colors.white,
                         child: networkSvg,
                       ),
                     )
                   ],
                 );
             });


0 commentaires