0
I made a basic app, because until then, I only used Image.asset()
to put picture, now I went to put Image.network()
and the URL and it worked on the AVD I created, but when I do the APK and install it on my phone, the images of Image.network()
.
Just now I put to run my app on my physical phone by wire and the images loads, but when I actually install (APK) does not work.
Could this be a cell phone error?
And also, when I made an app with an API, it only worked on AVD, when I installed it on my mobile didn’t run either.
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
title: "asdas",
home: Home(),
));
}
class Home extends StatefulWidget {
@override
_HomeState createState() => _HomeState();
}
class _HomeState extends State<Home> {
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 2,
child: Scaffold(
appBar: AppBar(
bottom: TabBar(tabs: <Widget>[
Tab(
icon: Icon(Icons.home),
text: "Home",
),
Tab(
icon: Icon(Icons.file_download),
text: "Download",
),
]),
),
body: SingleChildScrollView(
child: Container(
child: Column(
children: <Widget>[
Text("lorem ipsum dolor"),
Image.asset(
"images/judeu.jpg",
fit: BoxFit.fill,
),
Image.network(
'https://picsum.photos/250?image=9',
fit: BoxFit.fill,
),
],
),
),
),
),
);
}
}
Added internet access permissions on
Android Manifest
?– Leonardo Paim
Hello, no, I didn’t.
– Zé PIKENO dos AMVS
Where do I put this?
– Zé PIKENO dos AMVS
In the archive
AndroidManifest.xml
located inandroid/app/src/main
add this line inside the tag<manifest
:<uses-permission android:name="android.permission.INTERNET"/>
– Leonardo Paim
It worked, I didn’t know it.
– Zé PIKENO dos AMVS
Thank you very much.
– Zé PIKENO dos AMVS
No problem. To help other people I will post as a response and you can signal as a valid solution helping other members of the community if they have the same question as you.
– Leonardo Paim