my code :
import 'package:http/http.dart' as http;
import 'dart:convert';
void main()async {
var data =await fatchalbum();
for(int i =0; i>100;i++){
print(data[i]["userId"]);
print(data[i]["id"]);
print(data[i]["title"]);
}
}
Future fatchalbum()async{
final url ="https://jsonplaceholder.typicode.com/albums";
final res = await http.get(Uri.parse(url));
if(res.statusCode==200){
var obj = json.decode(res.body);
return obj;
}else{
throw Exception("error");
}
}
If i write in the "main function " print("hi");
it can run in debuge console just "hi"
It does not display the rest of the data
when i run the code , This error appears to me in Debuge console
Failed to save Chrome preferences: FileSystemException: Cannot open file, path = 'C:\Users\dell\AppData\Local\Temp\flutter_tools.ab04b1f8\flutter_tools_chrome_device.49e73a42\Default\Cache\data_0' (OS Error: The process cannot access the file because it is being used by another process.
, errno = 32)
Sometimes when I press stop then press Run&Debuge It just shows me, it doesn't show me The ouput I want:
This app is linked to the debug service: ws://127.0.0.1:55071/6_DbR0EpDJg%3D/ws
Launching lib\main.dart on Edge in debug mode...
lib\main.dart:1
Debug service listening on ws://127.0.0.1:55071/6_DbR0EpDJg=/ws
Running with sound null safety
Connecting to VM Service at ws://127.0.0.1:55071/6_DbR0EpDJg=/ws