1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] the image not display to the web flutter after deploy

Discussão em 'Mobile' iniciado por Stack, Outubro 7, 2024 às 08:02.

  1. Stack

    Stack Membro Participativo

    i am building a web by flutter connecting to the firestore

    the issue is when i am using the external url the image is disply well, but once we upload the image inside the database the image not display at all?

    Stream<List<Map<String, dynamic>>> fetchBedroomProducts() async* {
    CollectionReference bedroomCollection = FirebaseFirestore.instance
    .collection('collections')
    .doc('bedroom')
    .collection('sub_collections');

    // Listen for changes in the sub-collections
    yield* bedroomCollection.snapshots().asyncMap((snapshot) async {
    List<Map<String, dynamic>> products = [];
    for (var subDoc in snapshot.docs) {
    // Fetch items from each sub-collection
    QuerySnapshot itemSnapshot =
    await subDoc.reference.collection('items').get();
    for (var itemDoc in itemSnapshot.docs) {
    products.add({
    'title':
    itemDoc['name'] ?? 'Unknown Title', // Default value for title
    'jodPrice': (itemDoc['jodPrice'] != null)
    ? itemDoc['jodPrice'].toString()
    : 'N/A', // Default value for JOD price
    'usdPrice': (itemDoc['usdPrice'] != null)
    ? itemDoc['usdPrice'].toString()
    : 'N/A', // Default value for USD price
    'images': itemDoc['images'] != null && itemDoc['images'].isNotEmpty
    ? List<String>.from(itemDoc['images'])
    : [
    'https://example.com/default_image.png'
    ], // Default image URL
    'description': itemDoc['description'] ??
    'No description available', // Default description
    });
    }
    }
    return products;
    });
    }



    my index

    <body>
    <script src="flutter_bootstrap.js" async></script>
    <script type="text/javascript">
    window.FlutterWebRenderer = "html";
    </script>
    </body>
    </html>


    please i want to display the image on the website after deploy

    Continue reading...

Compartilhe esta Página