Robo-advisory-dart/lib/repository/wallet.repository.dart

46 lines
1.3 KiB
Dart

import 'package:robo_advisory/injection/dependency_injection.dart';
import 'package:robo_advisory/models/wallet.dart';
class WalletRepository {
static loadWallet() async {
switch (Injector.checkInjector()) {
case Flavor.MOCK:
return Wallet.fromMap(wallerJSON);
default:
// TODO: check how it will work with the API
return Wallet.fromMap(wallerJSON);
}
}
}
final wallerJSON = {
'total_assets': '50,000.00 TL',
'total_turkish_lira': '5000.00 TL',
'total_gold_in_gram': '90.00g XAU',
'total_gold_in_turkish_lira': '45,000.00 TL',
'health_stream_day': 'Day 01',
'health_stream': [
{
"type": "Loss",
"value_in_percentage": 30,
"gold_in_gram": "90.00 gXAU",
"gold_price_in_turkish_lira": "50,000.00 TL",
"one_gram_gold_price_in_turkish_lira": "555.55 TL"
},
{
"type": "Equal",
"value_in_percentage": 50,
"gold_in_gram": "90.00 gXAU",
"gold_price_in_turkish_lira": "50,000.00 TL",
"one_gram_gold_price_in_turkish_lira": "555.55 TL"
},
{
"type": "Gain",
"value_in_percentage": 20,
"gold_in_gram": "90.00 gXAU",
"gold_price_in_turkish_lira": "50,000.00 TL",
"one_gram_gold_price_in_turkish_lira": "555.55 TL"
}
]
};