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 {
2024-09-10 15:03:32 -06:00
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) {
2024-09-10 15:03:32 -06:00
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),
2024-09-10 15:03:32 -06:00
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()}',
2024-09-10 15:03:32 -06:00
style: TextStyle(fontSize: 20, color: isPositive ? Styles.incomeGreen : Styles.expensesRed),
2023-07-19 02:16:13 -06:00
),
]),
),
);
}
}