// 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 toMap() { return { 'pk_userUuid': uuid, 'benutzer': username, 'kennwort': passwort, }; } factory UserModel.fromMap(Map map) { return UserModel( uuid: (map['pk_userUuid'] as String).trim(), username: (map['benutzer'] as String).trim(), passwort: (map['kennwort'] as String).trim(), ); } String toJson() => json.encode(toMap()); factory UserModel.fromJson(String source) => UserModel.fromMap(json.decode(source) as Map); @override String toString() => 'UserModel(uuid: $uuid, username: $username, passwort: $passwort)'; }