Robo-advisory-dart/lib/providers/wallet_provider.dart

19 lines
452 B
Dart
Raw Normal View History

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;
Wallet get wallet => _wallet;
void setWallet(Wallet wallet) {
_wallet = wallet;
notifyListeners();
}
Future<Wallet> loadWallet() async {
return await WalletRepository.loadWallet();
}
}