Add view and logik

This commit is contained in:
2026-04-01 14:28:38 +02:00
parent bf8fd37e51
commit 122ae48754
30 changed files with 1926 additions and 176 deletions

View File

@@ -0,0 +1,48 @@
// ignore_for_file: public_member_api_docs, sort_constructors_first
import 'dart:convert';
class UserModel {
final String uuid;
final String username;
final String passwort;
UserModel({
required this.uuid,
required this.username,
required this.passwort,
});
UserModel copyWith({
String? uuid,
String? username,
String? passwort,
}) {
return UserModel(
uuid: uuid ?? this.uuid,
username: username ?? this.username,
passwort: passwort ?? this.passwort,
);
}
Map<String, dynamic> toMap() {
return <String, dynamic>{
'pk_userUuid': uuid,
'benutzer': username,
'kennwort': passwort,
};
}
factory UserModel.fromMap(Map<String, dynamic> map) {
return UserModel(
uuid: map['pk_userUuid'] as String,
username: map['benutzer'] as String,
passwort: map['kennwort'] as String,
);
}
String toJson() => json.encode(toMap());
factory UserModel.fromJson(String source) => UserModel.fromMap(json.decode(source) as Map<String, dynamic>);
@override
String toString() => 'UserModel(uuid: $uuid, username: $username, passwort: $passwort)';
}