import 'package:flutter/material.dart';

import 'package:pweb/services/balance.dart';


class BalanceProvider with ChangeNotifier {
  final BalanceService _service;

  BalanceProvider(this._service);

  double? _balance;
  String? _walletName;
  String? _walletId;
  bool _isHidden = true;

  double? get balance => _balance;
  String? get walletName => _walletName;
  String? get walletId => _walletId;
  bool get isHidden => _isHidden;

  Future<void> loadData() async {
    _balance = await _service.getBalance();
    _walletName = await _service.getWalletName();
    _walletId = await _service.getWalletId();
    notifyListeners();
  }

  void toggleVisibility() {
    _isHidden = !_isHidden;
    notifyListeners();
  }
}
