home fix 3
This commit is contained in:
@@ -70,14 +70,32 @@ class _HomeState extends State<Home> {
|
|||||||
} else {
|
} else {
|
||||||
busData = null;
|
busData = null;
|
||||||
}
|
}
|
||||||
if (proPicUrl == "empty") {
|
|
||||||
getFileUrlApiCall(userData).then((results) {
|
if (userData.pro_pic_path == "") {
|
||||||
setState(() {
|
setState(() {
|
||||||
proPicUrl = results;
|
proPicUrl = "";
|
||||||
propicFile = NetworkImage(proPicUrl);
|
|
||||||
});
|
});
|
||||||
|
} else if (AppEnviroment.getEnv() == "Dev") {
|
||||||
|
setState(() {
|
||||||
|
proPicUrl = "${AppEnviroment.baseFileUrl}/mih/${userData.pro_pic_path}";
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
var url =
|
||||||
|
"${AppEnviroment.baseApiUrl}/minio/pull/file/${userData.pro_pic_path}/prod";
|
||||||
|
var response = await http.get(Uri.parse(url));
|
||||||
|
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
String body = response.body;
|
||||||
|
var decodedData = jsonDecode(body);
|
||||||
|
setState(() {
|
||||||
|
proPicUrl = decodedData['minioURL'];
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
throw Exception(
|
||||||
|
"Error: GetUserData status code ${response.statusCode}");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return BusinessArguments(userData, bUserData, busData);
|
return BusinessArguments(userData, bUserData, busData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,7 +184,7 @@ class _HomeState extends State<Home> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return FutureBuilder(
|
return FutureBuilder(
|
||||||
future: getProfile(),
|
future: profile,
|
||||||
builder: (BuildContext context, snapshot) {
|
builder: (BuildContext context, snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
if (snapshot.hasData) {
|
if (snapshot.hasData) {
|
||||||
|
|||||||
Reference in New Issue
Block a user