buildFinancialEntityFromBudgetData function

FinancialEntityCategoryView buildFinancialEntityFromBudgetData(
  1. BudgetData model,
  2. int budgetDataIndex,
  3. BuildContext context
)

Implementation

FinancialEntityCategoryView buildFinancialEntityFromBudgetData(
  BudgetData model,
  int budgetDataIndex,
  BuildContext context,
) {
  final amountUsed = usdWithSignFormat(context).format(model.amountUsed);
  final primaryAmount = usdWithSignFormat(context).format(model.primaryAmount);
  final amount =
      usdWithSignFormat(context).format(model.primaryAmount! - model.amountUsed!);

  return FinancialEntityCategoryView(
    suffix: Text("Left"
        //   GalleryLocalizations.of(context).rallyFinanceLeft,
        //   style: Theme.of(context)
        //       .textTheme
        //       .bodyText2
        //       .copyWith(color: RallyColors.gray60, fontSize: 10),
        ),
    title: model.name,
    subtitle: amountUsed + ' / ' + primaryAmount,
    semanticsLabel:
        "{budgetName} budget with {amountUsed} used of {amountTotal}, {amountLeft} left",
    // semanticsLabel: GalleryLocalizations.of(context).rallyBudgetAmount(
    //   model.name,
    //   model.amountUsed,
    //   model.primaryAmount,
    //   amount,
    // ),
    indicatorColor: RallyColors.budgetColor(budgetDataIndex),
    indicatorFraction: model.amountUsed! / model.primaryAmount!,
    amount: amount,
  );
}