You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Olá acho que seria mais interessante na função converterMoedaParaDouble se o valor for igual a vazio retornar o valor de 0 em vez de retornar um error,
static double converterMoedaParaDouble(String valor) {
assert(valor.isNotEmpty);
final value = double.tryParse(
valor.replaceAll('R\$ ', '').replaceAll('.', '').replaceAll(',', '.'));
return value ?? 0;
}
Seria transformar esse código acima em
double converterMoedaParaDouble(String valor) {
if (valor.isEmpty) return 0;
final value = double.tryParse(valor.replaceAll('R\$ ', '').replaceAll('.', '').replaceAll(',', '.'));
return value ?? 0;
}
The text was updated successfully, but these errors were encountered:
Olá acho que seria mais interessante na função converterMoedaParaDouble se o valor for igual a vazio retornar o valor de 0 em vez de retornar um error,
Seria transformar esse código acima em
The text was updated successfully, but these errors were encountered: