basic csv loader, transaction list & half done stats page
This commit is contained in:
41
lib/pages/stats/widgets/account_counters.dart
Normal file
41
lib/pages/stats/widgets/account_counters.dart
Normal file
@@ -0,0 +1,41 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class AccountCounter extends StatelessWidget {
|
||||
final Map<String, double> accountsTotals;
|
||||
|
||||
const AccountCounter({super.key, required this.accountsTotals});
|
||||
|
||||
List<Row> _renderAccountTotals() {
|
||||
return accountsTotals.entries.toList().map((entry) => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("${entry.key}:"),
|
||||
Text(
|
||||
NumberFormat('#######.00 €', 'fr_FR').format(entry.value),
|
||||
style: TextStyle(
|
||||
fontFamily: 'NovaMono',
|
||||
fontSize: 15,
|
||||
color: entry.value > 0 ? const Color.fromARGB(255, 0, 255, 8) : Colors.red
|
||||
)),
|
||||
],
|
||||
)).toList();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
margin: EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
color: Colors.blue
|
||||
),
|
||||
alignment: Alignment.centerRight,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: _renderAccountTotals(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user