MockApiService class

模拟 API 服务

Constructors

MockApiService()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

createUser(String name, String email) Future<User>
模拟创建用户(POST 请求)
deleteUser(int id) Future<void>
模拟删除用户(DELETE 请求)
fetchUserById(int id) Future<User>
模拟获取用户详情(GET 请求)
fetchUsers() Future<List<User>>
模拟获取用户列表(GET 请求)
updateUser(User user) Future<User>
模拟更新用户(PUT 请求)