Line data Source code
1 : // Copyright 2024 The terCAD team. All rights reserved.
2 : // Use of this source code is governed by a CC BY-NC-ND 4.0 license that can be found in the LICENSE file.
3 :
4 : import 'package:app_finance/_classes/herald/app_locale.dart';
5 : import 'package:app_finance/design/form/list_selector_item.dart';
6 :
7 : enum AppPaymentType { bill, invoice, transfer }
8 :
9 : class PaymentType {
10 0 : static List<ListSelectorItem> getList() {
11 0 : return [
12 0 : ListSelectorItem(id: AppPaymentType.bill.name, name: AppLocale.labels.bill),
13 0 : ListSelectorItem(id: AppPaymentType.invoice.name, name: AppLocale.labels.flowTypeInvoice),
14 0 : ListSelectorItem(id: AppPaymentType.transfer.name, name: AppLocale.labels.transferHeadline),
15 : ];
16 : }
17 :
18 0 : static String getLabel(String id) => getList().firstWhere((e) => e.id == id).name;
19 :
20 0 : static bool contains(String id, List<AppPaymentType> type) => type.map((e) => e.toString()).contains(id);
21 : }
|