You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
402 B
12 lines
402 B
class LoginModel { |
|
final String username; |
|
final String password; |
|
|
|
// 使用 const 构造函数,并要求所有字段在创建时必须被提供 |
|
const LoginModel({required this.username, required this.password}); |
|
|
|
// (可选)提供一个 toMap 方法,方便将对象转换为 JSON 或 Map |
|
Map<String, dynamic> toMap() { |
|
return {'username': username, 'password': password}; |
|
} |
|
}
|
|
|