0
I have a card represented by showing the user photo + its name, when I search for a local image it loads the image normally, but when I need to load this image through a link of my api it does not load.
Code:
return ListView(
children: <Widget>[
_qrCodeWidget(this.bytes, context),
Container(
child: Column(
children: <Widget>[
SlimyCard(
color: Color(0xffccffcc),
topCardWidget: topCardWidget((snapshot.data)
? 'imagens/${gv.foto}'
: ''),
),
],
),
),
],
);
The correct location you’d like to place is inside topCardWidget: topCardWidget((snapshot.data)
? 'imagens/${gv.foto}'
: ''),
There is another way to put this image, but did not answer me for example. In this code above it calls the method topCardWidget within it we have the following code:
Widget topCardWidget(String imagePath) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
child: Image.network('https://www.google.com/imgres?imgurl=https%3A%2F%2Fstorage.googleapis.com%2Fgweb-uniblog-publish-prod%2Fimages%2FAndroid_symbol_green_2.max-1500x1500.png&imgrefurl=https%3A%2F%2Fwww.blog.google%2Fproducts%2Fandroid%2F&docid=SDYhQ-MI_6500M&tbnid=rL2RK3y7U-kTxM%3A&vet=10ahUKEwiY0p7Ey5TmAhXkIbkGHYlbBtMQMwh3KAAwAA..i&w=1500&h=803&bih=635&biw=1024&q=android&ved=0ahUKEwiY0p7Ey5TmAhXkIbkGHYlbBtMQMwh3KAAwAA&iact=mrc&uact=8'),
height: 70,
width: 70,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
image: DecorationImage(image: AssetImage(imagePath)),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.1),
blurRadius: 20,
spreadRadius: 1,
),
],
),
),
SizedBox(height: 15),
Text(
'${gv.nome}',
style: TextStyle(color: Color(0xff1e1e1e), fontSize: 20, fontWeight: FontWeight.bold),
),
SizedBox(height: 15),
Text(
'Para escanear precione o ícone da câmera!',
style: TextStyle(
color: Color(0xff1e1e1e),
fontSize: 15,
fontWeight: FontWeight.w500),
),
SizedBox(height: 10),
],
);
}
on the line child: Image.network('https://www.google.com/imgres?imgurl=https%3A%2F%2Fstorage.googleapis.com%2Fgweb-uniblog-publish-prod%2Fimages%2FAndroid_symbol_green_2.max-1500x1500.png&imgrefurl=https%3A%2F%2Fwww.blog.google%2Fproducts%2Fandroid%2F&docid=SDYhQ-MI_6500M&tbnid=rL2RK3y7U-kTxM%3A&vet=10ahUKEwiY0p7Ey5TmAhXkIbkGHYlbBtMQMwh3KAAwAA..i&w=1500&h=803&bih=635&biw=1024&q=android&ved=0ahUKEwiY0p7Ey5TmAhXkIbkGHYlbBtMQMwh3KAAwAA&iact=mrc&uact=8'),
I can place any link, but it loses image formatting with rounded edges and leaves only square.
Opa good afternoon, I will not post as an answer why I am not at home on my pc to show you an example, but I did it as follows, I took the image and passed it to a Boxdecoration inside the container but using the property of the Container itself. Try this and tell me if it worked, if you can’t, as soon as I get home today I’ll set an example here for you of how my code turned out.
– Matheus
Matheus, :)
– Thiago Correa
Opa Thiago, yes I can as soon as I get home I assemble an example of how I did, now I am at work hehe but as soon as I arrive I already assemble and put as answer here for you dai, vlww
– Matheus
opa Thiago blz, I was looking at the topic and noticed a mistake, I don’t know if you’ve noticed, but precione is written wrong in your app :)
– Matheus
Opa I’ve changed it rs, already changed some things worth.
– Thiago Correa