2020-12-08 07:58:14 +00:00
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
import 'package:robo_advisory/models/wallet.dart';
|
|
|
|
import 'package:robo_advisory/repository/wallet.repository.dart';
|
|
|
|
|
|
|
|
class WalletProvider with ChangeNotifier {
|
2022-09-11 14:37:28 +00:00
|
|
|
Wallet _wallet = Wallet.emptyWallet;
|
2020-12-08 07:58:14 +00:00
|
|
|
|
|
|
|
Wallet get wallet => _wallet;
|
|
|
|
|
|
|
|
void setWallet(Wallet wallet) {
|
|
|
|
_wallet = wallet;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<Wallet> loadWallet() async {
|
|
|
|
return await WalletRepository.loadWallet();
|
|
|
|
}
|
|
|
|
}
|