rluv_client/lib/features/budget/widgets/budget_net_bar.dart
2023-08-17 13:34:30 -06:00

47 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
import 'package:helpers/helpers.dart';
import 'package:rluv/global/styles.dart';
import 'package:rluv/global/utils.dart';
class BudgetNetBar extends StatelessWidget {
const BudgetNetBar(
{super.key,
required this.isPositive,
required this.net,
required this.expected});
final bool isPositive;
final double net;
final double expected;
@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(
'${net.currency()} / ${expected.currency()}',
style: TextStyle(
fontSize: 20,
color: isPositive ? Styles.incomeGreen : Styles.expensesRed),
),
]),
),
);
}
}