Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
liplum committed Nov 30, 2022
2 parents ff27508 + 7db0b91 commit 4900558
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
7 changes: 6 additions & 1 deletion l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@
"expenseShower": "Shower",
"expenseStuff": "Stuff",
"expenseTotal": "Total",
"expenseConsume": "Consume",
"expenseTopUp": "Top Up",
"expenseSubsidy": "Subsidy",
"expenseLibrary": "Library",

"faculty": "Faculty",
"failed": "Failed",
"feedback": "Feedback",
Expand Down Expand Up @@ -622,4 +627,4 @@
"xuhui": "Xuhui",
"xuhuiDistrict": "Xuhui District",
"yes": "Yes"
}
}
7 changes: 6 additions & 1 deletion l10n/app_zh.arb
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@
"expenseShower": "淋浴",
"expenseStuff": "杂项",
"expenseTotal": "总计",
"expenseConsume": "Consume",
"expenseTopUp": "TopUp",
"expenseSubsidy": "圈存",
"expenseLibrary": "图书馆",

"faculty": "学院",
"failed": "失败",
"feedback": "反馈",
Expand Down Expand Up @@ -390,4 +395,4 @@
"xuhui": "徐汇",
"xuhuiDistrict": "徐汇区",
"yes": "好"
}
}
8 changes: 4 additions & 4 deletions lib/module/expense2/entity/local.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ enum TransactionType {
case TransactionType.other:
return i18n.expenseStuff;
case TransactionType.consume:
return "TODO";
return i18n.expenseConsume;
case TransactionType.topUp:
return "TODO";
return i18n.expenseTopUp;
case TransactionType.subsidy:
return "TODO";
return i18n.expenseSubsidy;
case TransactionType.library:
return "TODO";
return i18n.expenseLibrary;
}
}
}
4 changes: 3 additions & 1 deletion lib/module/expense2/page/statistics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ class _StatisticsPageState extends State<StatisticsPage> {

double sum = sumByClassification.fold(0.0, (previousValue, element) => previousValue += element);

return TransactionType.values.where((element) => element != TransactionType.consume).map(
return TransactionType.values
.where((e) => !{TransactionType.consume, TransactionType.topUp, TransactionType.subsidy}.contains(e))
.map(
(expenseType) {
final double sumInType = sumByClassification[expenseType.index];
final double percentage = sum != 0 ? sumInType / sum : 0;
Expand Down

0 comments on commit 4900558

Please sign in to comment.