import 'package:aman_kassa_flutter/redux/constants/setting_const.dart';
import 'package:meta/meta.dart';

@immutable
class BankState {
  final String login;
  final String password;

  BankState({this.login, this.password});

  //read hive
  factory BankState.initial(BankState payload) {
    return BankState(
        login: payload?.login,
        password: payload?.password);
  }

  //write hive
  BankState copyWith({
    @required login,
    @required password,
  }) {
    return BankState(
      login: login ?? this.login,
      password: password ?? this.password,
    );
  }

  static BankState fromJson(dynamic json) {
    return json != null
        ? BankState(
      password: json['password'],
      login: json['login'],
    )
        : null;
  }

  dynamic toJson() {
    return {"password": password, "login": login};
  }
}
