-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcurrency_feature_facade.dart
42 lines (36 loc) · 1.37 KB
/
currency_feature_facade.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import 'package:currency_calc/feature/currency/internal/app/init/currency_feature_dic.dart';
import 'package:currency_calc/feature/currency/internal/app/init/currency_feature_initializer.dart';
import 'package:currency_calc/feature/currency/internal/ui/setting/currency_setting_widget.dart';
export "package:currency_calc/feature/currency/internal/domain/model/currency.dart";
class CurrencyFeatureFacade {
CurrencyFeatureFacade() {
CurrencyFeatureInitializer();
this._dic = CurrencyFeatureDic();
}
late final CurrencyFeatureDic _dic;
/**
* Update currency DB with new fetched currencies, if time has come.
*/
Future<void> populateIfNeeded() async {
await _dic.currencyPopulator.populateIfNeeded();
}
/**
* Load currency codes of visible currencies for the source currency.
*/
Future<List<String>> loadVisibleSourceCurrencyCodes() async {
return _dic.currencyRepository.loadVisibleSourceCurrencyCodes();
}
/**
* Load currency codes of visible currencies for the target currency.
*/
Future<List<String>> loadVisibleTargetCurrencyCodes() async {
return _dic.currencyRepository.loadVisibleTargetCurrencyCodes();
}
/**
* Create a widget for currencies configuration.
*/
CurrencySettingWidget createCurrencySettingWidget() {
return CurrencySettingWidget(
_dic.currencyRepository, _dic.currencyVisibilityUpdater);
}
}