I found solution on flutter/dart discord channel.
I should have marked the method of the new class as "late".
I marked late then working now.
class Data {
String read() {
return "";
}
}
class Data2 {
var newData= Data();
late String readData = newData.read();
}