I would like to test output of this function ... how i can debug this using inspect or print ?

  Future<YourDataEntity> getproduct(int id) async {
    var response = await Network().getData('/publication/show/$id');
       return YourDataEntity.fromJson(response.body['publication']);
  }


Solution 1: eeqk

How about just assigning the output to a temporary variable?

import 'dart:developer';

Future<YourDataEntity> getproduct(int id) async {
  var response = await Network().getData('/publication/show/$id');
  final entity = YourDataEntity.fromJson(response.body['publication']);
  log(entity.toString())
  return entity;
}

But the most correct way is to use a debugger and add a breakpoint where you call this function.

There's a great video that teaches you just that: https://www.youtube.com/watch?v=ocvQ2aMluq8