fix(mobile): resolve fake gallery item urls with their main photo path (uploads/kontrakan and uploads/Laundry) instead of forcing uploads/galeri path
This commit is contained in:
parent
ebddf558d3
commit
00dc5b4a96
|
|
@ -61,10 +61,13 @@ class Kontrakan {
|
|||
if (galleryList.isEmpty &&
|
||||
json['foto'] != null &&
|
||||
json['foto'].toString().isNotEmpty) {
|
||||
final resolved = json['foto_url'] != null && json['foto_url'].toString().isNotEmpty
|
||||
? json['foto_url'].toString()
|
||||
: _resolveKontrakanPhotoPath(json['foto'].toString());
|
||||
galleryList.add(
|
||||
Galeri(
|
||||
id: json['id'] ?? 0,
|
||||
foto: json['foto'].toString(),
|
||||
foto: resolved,
|
||||
isPrimary: true,
|
||||
urutan: 0,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -98,10 +98,15 @@ class Laundry {
|
|||
if (galleryList.isEmpty &&
|
||||
json['foto'] != null &&
|
||||
json['foto'].toString().isNotEmpty) {
|
||||
final resolved = json['foto_url'] != null && json['foto_url'].toString().isNotEmpty
|
||||
? json['foto_url'].toString()
|
||||
: (json['foto'].toString().startsWith('http')
|
||||
? json['foto'].toString()
|
||||
: '${AppConfig.serverUrl}/uploads/Laundry/${json['foto']}');
|
||||
galleryList.add(
|
||||
GaleriLaundry(
|
||||
id: json['id'] ?? 0,
|
||||
foto: json['foto'].toString(),
|
||||
foto: resolved,
|
||||
isPrimary: true,
|
||||
urutan: 0,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -612,6 +612,7 @@ class _KontrakanDetailScreenState extends State<KontrakanDetailScreen> {
|
|||
final imageUrl = galleryItems.isEmpty
|
||||
? _kontrakan.primaryPhoto
|
||||
: galleryItems[index].photoUrl;
|
||||
debugPrint('KONTRAKAN DETAIL IMAGE URL: $imageUrl');
|
||||
|
||||
return CachedNetworkImage(
|
||||
imageUrl: imageUrl,
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ class _LaundryDetailScreenState extends State<LaundryDetailScreen> {
|
|||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
debugPrint('LAUNDRY DETAIL IMAGE URL: ${widget.laundry.primaryPhoto}');
|
||||
_checkFavorite();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue