Skip to content
Snippets Groups Projects
Commit bf7c9293 authored by vjrj's avatar vjrj
Browse files

helpers refactor

parent 52f4b64e
No related branches found
No related tags found
No related merge requests found
......@@ -124,7 +124,7 @@ bool bigScreen(BuildContext context) =>
bool smallScreen(BuildContext context) =>
MediaQuery.of(context).size.width <= smallScreenWidth;
String formatAmount(
String _formatAmount(
{required BuildContext context,
required double amount,
required bool isG1,
......@@ -151,7 +151,7 @@ NumberFormat currentNumberFormat(
final NumberFormat currencyFormatter = NumberFormat.currency(
symbol: useSymbol ? currentCurrency(isG1) : '',
locale: locale,
decimalDigits: isG1 ? 2 : 4,
decimalDigits: isG1 ? 2 : 3,
);
return currencyFormatter;
}
......@@ -164,13 +164,13 @@ String currentCurrencyTrimmed(bool isG1) {
return currentCurrency(isG1).trim();
}
String formatKAmount(
String formatKAmountInView(
{required BuildContext context,
required double amount,
required bool isG1,
required double currentUd,
required bool useSymbol}) =>
formatAmount(
_formatAmount(
context: context,
amount: convertAmount(isG1, amount, currentUd),
isG1: isG1,
......
......@@ -53,7 +53,7 @@ class TransactionListItem extends StatelessWidget {
Color? iconColor;
String statusText;
final String amountWithSymbol = formatKAmount(
final String amountWithSymbol = formatKAmountInView(
context: context,
amount: transaction.amount,
isG1: isG1,
......
......@@ -204,7 +204,7 @@ class _TransactionsAndBalanceWidgetState
currencyBalanceWidget(isG1, currentSymbol),
if (isCurrencyBefore) separatorSpan(),
TextSpan(
text: formatKAmount(
text: formatKAmountInView(
context: context,
amount: balance,
isG1: isG1,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment