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

47 lines
1.2 KiB
Dart
Raw Permalink Normal View History

import 'package:robo_advisory/injection/dependency_injection.dart';
class TransactionRepository {
static loadTransactions() async {
switch (Injector.checkInjector()) {
case Flavor.MOCK:
return transactionJSON["dataKey"];
default:
// TODO: check how it will work with the API
return transactionJSON["dataKey"];
}
}
}
final transactionJSON = {
"dataKey": [
{
"date": "2020-12-09",
"name": "Transaction 1",
"amount": "20",
"description": "lorem ipsum dolor sit",
"category": {"name": "workplace", "color": "#0293ee"}
},
{
"date": "2020-12-01",
"name": "Transaction 2",
"amount": "23",
"description": "lorem ipsum dolor sit",
"category": {"name": "equipment", "color": "#f8b250"}
},
{
"date": "2020-12-01",
"name": "Transaction 3",
"amount": "23",
"description": "lorem ipsum dolor sit",
"category": {"name": "home", "color": "#13d38e"}
},
{
"date": "2020-12-01",
"name": "Transaction 4",
"amount": "23",
"description": "lorem ipsum dolor sit",
"category": {"name": "other", "color": "#845bef"}
}
]
};