39 lines
1.2 KiB
Dart
39 lines
1.2 KiB
Dart
import 'package:flutter/material.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 = MediaQuery.of(context).size.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),
|
|
),
|
|
]),
|
|
),
|
|
);
|
|
}
|
|
}
|