12345678910111213141516171819202122232425262728 |
- import 'package:flutter_chinese_chees/models/user_model.dart';
- /// Description: 用户数据访问层
- /// Time : 04/28/2023 Friday
- /// Author : liuyuqi.gov@msn.cn
- class UserDao {
-
- /// 登录
- /// [name] 用户名
- /// [password] 密码
- Future<UserModel> login(String name, String password) async {
- return UserModel.fromJson({"name": "张三", "id": 1, "email": "", "age": 18});
- }
- /// 注册
- /// [name] 用户名
- /// [password] 密码
- /// [email] 邮箱
- Future<UserModel> register(String name, String password, String email) async {
- return UserModel.fromJson(
- {"name": name, "id": 1, "email": email, "age": 18});
- }
- /// 退出登录
- Future<bool> logout() async {
- return true;
- }
- }
|