flutterdartflutter-imagedebug-print

how to use debugPrint for image.network?


I want to see the link of the image in the terminal using debugPrint. kindly help me. This is my code:

           FutureBuilder<Iterable<SubCategories>>(
                builder: (context, snapshot) {
                    return ListView.builder(
                      itemBuilder: (context, index) =>
                          Image.network(
                            snapshot.data!.elementAt(index).logo,
                          ),
                    );
                }),

Solution

  • Try out this:

    **Note:** import log as **dart.developer** (import 'dart:developer';)
    
    
    
    
    
         FutureBuilder<Iterable<SubCategories>>(
                        builder: (context, snapshot) {                  
                            return ListView.builder(
                              itemBuilder: (context, index) {
                            log("Network image--->${snapshot.data!.elementAt(index).logo}");
                                return Image.network(
                                    snapshot.data!.elementAt(index).logo,
                                  ),
                              }
                            );
                        }),