Add budgets
This commit is contained in:
@@ -111,20 +111,6 @@ class AccountListPageState extends State<AccountListPage> {
|
||||
child: UpcomingTransactionsCard(),
|
||||
),
|
||||
|
||||
/*
|
||||
BlocBuilder<CoreCubit, CoreState>(
|
||||
builder:
|
||||
(context, state) => Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(16),
|
||||
child: AccountBalanceGraphCard(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),*/
|
||||
Row(
|
||||
children: [
|
||||
Padding(padding: EdgeInsets.all(16), child: BreakdownCard()),
|
||||
|
||||
@@ -28,15 +28,17 @@ class TotalBalanceCard extends StatelessWidget {
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text("Total balance"),
|
||||
Text(
|
||||
"Total balance",
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
FutureBuilder(
|
||||
future: _getTotalBalance(state.accounts),
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return Text("...");
|
||||
}
|
||||
|
||||
return Text(formatCurrency(snapshot.data!));
|
||||
return Text(
|
||||
snapshot.hasData ? formatCurrency(snapshot.data!) : "...",
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:okane/database/collections/recurrent.dart';
|
||||
@@ -29,7 +27,12 @@ class UpcomingTransactionsCard extends StatelessWidget {
|
||||
: upcomingRaw.sublist(0, min(upcomingRaw.length, 3));
|
||||
final transactions =
|
||||
upcoming.isEmpty
|
||||
? [Text("No upcoming transactions")]
|
||||
? [
|
||||
Text(
|
||||
"No upcoming transactions",
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
),
|
||||
]
|
||||
: upcoming
|
||||
.map(
|
||||
(t) => ListTile(
|
||||
@@ -59,7 +62,14 @@ class UpcomingTransactionsCard extends StatelessWidget {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
children: <Widget>[Text("Upcoming Transactions")] + transactions,
|
||||
children:
|
||||
<Widget>[
|
||||
Text(
|
||||
"Upcoming Transactions",
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
] +
|
||||
transactions,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user