42 lines
1.2 KiB
Dart
42 lines
1.2 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});
|
|
|
|
final bool isPositive;
|
|
final double net;
|
|
|
|
@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(),
|
|
style: TextStyle(
|
|
fontSize: 20,
|
|
color: isPositive ? Styles.incomeGreen : Styles.expensesRed),
|
|
),
|
|
]),
|
|
),
|
|
);
|
|
}
|
|
}
|