Eu fazendo tava incomodado com a moeda ae fiz uma alteração no código
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
void main() {
Intl.defaultLocale = 'pt_BR';
runApp(MaterialApp(
home: Scaffold(
body: ListaTransferencias(),
appBar: AppBar(
title: const Text('Tansferências'),
),
floatingActionButton: FloatingActionButton(
onPressed: () {}, //é necessário passar o parâmetro para rodar
child: Icon(Icons.add),
),
),
));
}
class ListaTransferencias extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
children: [
ItemTransferencia(Transferencia(100.00, 5497628, 5)),
ItemTransferencia(Transferencia(1500.00, 5497628, 5)),
ItemTransferencia(Transferencia(500.00, 5987411, 5)),
],
);
}
}
class ItemTransferencia extends StatelessWidget {
final Transferencia _transferencia;
ItemTransferencia(this._transferencia);
@override
Widget build(BuildContext context) {
NumberFormat formatter = NumberFormat.simpleCurrency();
return Card(
child: ListTile(
leading: Icon(Icons.monetization_on),
title: Text(formatter.format(_transferencia.valor)),
subtitle: Text(_transferencia.numeroConta.toString() +
'-' +
_transferencia.digito.toString()),
),
);
}
}
class Transferencia {
final double valor;
final int numeroConta;
final int digito;
Transferencia(this.valor, this.numeroConta, this.digito);
}
Fonte: https://www.alura.com.br/artigos/formatando-numeros-e-datas-no-flutter