Future<Transaction> findAll() async {
Client client = InterceptedClient.build(interceptors: [LoggingInterceptor()]);
final Response response =
await client.get(Uri.http('192.168.0.30:8080', 'transactions'));
final List<dynamic> decodeJoson = jsonDecode(response.body);
final List<Transaction> transactions = List();
for (Map<String, dynamic> transactionJson in decodeJoson) {
final Map<String, dynamic> contactJson = transactionJson['contact'];
final Transaction transaction = Transaction(
transactionJson['value'],
Contact(
0,
contactJson['name'],
contactJson['accountNumber'],
));
transactions.add(transaction);
}
return transactions;
}
Error: A value of type 'Future<List>' can't be assigned to a variable of type 'FutureOr'.
'Future' is from 'dart:async'.
'List' is from 'dart:core'.
'Transaction' is from 'package:my_ease/model/transaction.dart' ('lib/model/transaction.dart'). return transactions;
Na aula o code do professor tb tem o mesmo erro porem tem o corte do vídeo e volta funcionando