cpd_app_gruppe_finanzplaner/lib/account/account.dart

27 lines
435 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,
};
}
2023-06-21 21:35:27 +02:00
}