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

47 lines
1.3 KiB
Dart
Raw Normal View History

2023-07-19 02:16:13 -06:00
import 'package:flutter/material.dart';
import 'package:helpers/helpers.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 {
2023-08-17 13:34:30 -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) {
final screenWidth = BuildMedia(context).width;
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: [
Text(
isPositive ? 'Income' : 'Expenses',
style: const TextStyle(
fontSize: 20,
),
),
Text(
2023-08-17 13:34:30 -06:00
'${net.currency()} / ${expected.currency()}',
2023-07-19 02:16:13 -06:00
style: TextStyle(
fontSize: 20,
color: isPositive ? Styles.incomeGreen : Styles.expensesRed),
),
]),
),
);
}
}