import 'package:flutter/material.dart';
void main() => runApp(ByteBankApp());
class ByteBankApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(body: FormularioTranferencia()),
);
}
}
class FormularioTranferencia extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Criando Tranferência'),
),
body: Column(
children: const <Widget>[
const Padding(
padding: EdgeInsets.all(16.0),
child: TextField(
style: TextStyle(fontSize: 24.0),
decoration: InputDecoration(
labelText: 'Número conta',
hintText: '0000',
),
keyboardType: TextInputType.number,
),
),
Padding(
padding: EdgeInsets.all(16.0),
child: TextField(
style: TextStyle(fontSize: 24.0),
decoration: InputDecoration(
icon: Icon(Icons.monetization_on),
labelText: 'Valor',
hintText: '0.00',
),
keyboardType: TextInputType.number,
),
),
ElevatedButton(
child: const Text('Confirmar'),
onPressed: () {
debugPrint('Clicou confirmar');
},
),
],
),
);
}
}
class ListaTransferencias extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Transferências'),
),
body: Column(
children: <Widget>[
ItemTransferencia(Transferencia(900.0, 1000)),
ItemTransferencia(Transferencia(800.0, 2000)),
ItemTransferencia(Transferencia(700.0, 3000)),
],
),
floatingActionButton: FloatingActionButton(
onPressed: () {},
child: Icon(Icons.add),
),
);
}
}
class ItemTransferencia extends StatelessWidget {
final Transferencia _transferencia;
ItemTransferencia(this._transferencia);
@override
Widget build(BuildContext context) {
// TODO: implement build
return Card(
child: ListTile(
leading: Icon(Icons.monetization_on),
title: Text(_transferencia.valor.toString()),
subtitle: Text(_transferencia.numeroConta.toString()),
),
);
}
}
class Transferencia {
final double valor;
final int numeroConta;
Transferencia(this.valor, this.numeroConta);
}