rluv_client/lib/features/budget/widgets/budget_net_bar.dart

39 lines
1.2 KiB
Dart
Raw Normal View History

2023-07-19 02:16:13 -06:00
import 'package:flutter/material.dart';
import 'package:rluv/global/styles.dart';
2023-07-22 21:29:32 -06:00
import 'package:rluv/global/utils.dart';
2023-07-19 02:16:13 -06:00
class BudgetNetBar extends StatelessWidget {
const BudgetNetBar({super.key, required this.isPositive, required this.net, required this.expected});
2023-07-19 02:16:13 -06:00
final bool isPositive;
final double net;
2023-08-17 13:34:30 -06:00
final double expected;
2023-07-19 02:16:13 -06:00
@override
Widget build(BuildContext context) {
final screenWidth = MediaQuery.of(context).size.width;
2023-07-19 02:16:13 -06:00
return Container(
width: screenWidth * 0.85,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
color: isPositive ? Styles.incomeBlue : Styles.expensesOrange,
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 12.0),
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
2023-07-19 02:16:13 -06:00
Text(
isPositive ? 'Income' : 'Expenses',
style: const TextStyle(
fontSize: 20,
),
),
Text(
2023-08-17 13:34:30 -06:00
'${net.currency()} / ${expected.currency()}',
style: TextStyle(fontSize: 20, color: isPositive ? Styles.incomeGreen : Styles.expensesRed),
2023-07-19 02:16:13 -06:00
),
]),
),
);
}
}