mirror of
https://github.com/hmalik144/easy_cc_flutter.git
synced 2026-10-30 18:34:50 +00:00
Ability to cache currency selection (#5)
This commit is contained in:
1 parent
3c1ecd76c2
commit
5104fc674e
13 files changed
+415
-172
No files matched your search
@@ -0,0 +1,6 @@
|
||||
import '../prefs/CurrencyPair.dart';
|
||||
|
||||
abstract class Repository {
|
||||
CurrencyPair getConversionPair();
|
||||
Future<void> setConversionPair(String fromCurrency, String toCurrency);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import 'package:easy_cc_flutter/data/prefs/CurrencyPair.dart';
|
||||
import 'package:easy_cc_flutter/data/prefs/PreferenceProvider.dart';
|
||||
|
||||
import '../../locator.dart';
|
||||
import 'Repository.dart';
|
||||
|
||||
class RepositoryImpl extends Repository {
|
||||
final PreferenceProvider _prefs = locator<PreferenceProvider>();
|
||||
|
||||
@override
|
||||
CurrencyPair getConversionPair() {
|
||||
return _prefs.getConversionPair();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> setConversionPair(String fromCurrency, String toCurrency) {
|
||||
return _prefs.saveConversionPair(fromCurrency, toCurrency);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user