1234567891011121314 |
- import 'package:dio/dio.dart';
- import 'package:flutter_provider_demo/model/api.dart';
- import 'package:flutter_provider_demo/model/user_model.dart';
- class UserDao {
- Future<UserModel> login(String username, String pwd) async {
- Map<String, dynamic> params = {"username": username, "pwd": pwd};
- Response response = await Dio().post(
- Api.login,
- data: params,
- );
- return UserModel.fromJson(response.data);
- }
- }
|