cpd_app_gruppe_finanzplaner/lib/account/account.dart

26 lines
434 B
Dart
Raw Normal View History

2023-06-15 00:55:02 +02:00
import 'dart:convert';
class Account {
String name;
double balance;
Account({
required this.name,
required this.balance,
});
factory Account.fromJson(String json) {
final Map<String, dynamic> map = jsonDecode(json);
return Account(
name: map['name'],
balance: map['balance'],
);
}
Map<String, dynamic> toJson() {
return {
'name': name,
'balance': balance,
};
}
}