I am facing problem. My app is working in emulator well but in release mode or in mobile device it is showing grey box for the below code. I am using Getx package. Cannot figure out.
Please help.
Positioned(
bottom: 0,
child: Obx(() {
if (appBarController.isDataProcessing.value == false) {
if (appBarController.loggedUserData[0] != null) {
return GestureDetector(
onTap: () {
// print('id');
appBarController.getAlumniProfile(
appBarController.loggedUserData[0]['id']);
},
child: Hero(
tag: appBarController.loggedUserData[0]['id'].toString(),
child: appBarController.loggedUserData[0]['user_image'] !=
null
? Container(
height: 50,
width: 50,
decoration: BoxDecoration(
border: Border.all(width: 0.5),
shape: BoxShape.circle,
image: DecorationImage(
fit: BoxFit.cover,
image: NetworkImage(
appBarController.loggedUserData[0]
['user_image'],
),
),
),
)
: Container(
decoration: BoxDecoration(
border:
Border.all(width: 0.5, color: Colors.white),
shape: BoxShape.circle,
),
child: Icon(
Icons.person,
size: 30,
color: Colors.white,
),
),
),
);
} else {
return Center(
child: SizedBox(),
);
}
} else {
return Center(
child: CircularProgressIndicator(),
);
}
}),
)
Thanks
This is the screenshot of my problem.
Updated code(Working Code)
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Obx(() {
if (appBarController.isDataProcessing.value == false) {
if (appBarController.loggedUserData[0] != null) {
return GestureDetector(
onTap: () {
// print('id');
appBarController.getAlumniProfile(
appBarController.loggedUserData[0]['id']);
},
child: Hero(
tag: appBarController.loggedUserData[0]['id']
.toString(),
child: appBarController.loggedUserData[0]
['user_image'] !=
null
? Container(
height: 50,
width: 50,
decoration: BoxDecoration(
border: Border.all(width: 0.5),
shape: BoxShape.circle,
image: DecorationImage(
fit: BoxFit.cover,
image: NetworkImage(
appBarController.loggedUserData[0]
['user_image'],
),
),
),
)
: Container(
decoration: BoxDecoration(
border: Border.all(
width: 0.5, color: Colors.white),
shape: BoxShape.circle,
),
child: Icon(
Icons.person,
size: 30,
color: Colors.white,
),
),
),
);
} else {
return Center(
child: SizedBox(),
);
}
} else {
return Center(
child: CircularProgressIndicator(),
);
}
}),
IconButton(
onPressed: () {
logout();
},
icon: Icon(Icons.exit_to_app),
tooltip: 'Log out',
color: Colors.white,
iconSize: 30,
),
// Text(appBarController.loggedUserData[0]['id'].toString()),
],
)
I have learned to solve the problem. This is pleaure to me. Thanks