mirrored_repositories/flutter_crud_with_provider_package/lib


import 'package:flutter_crud_with_provider_package/dao/user_api.dart';
import 'package:flutter_crud_with_provider_package/dao/user_dao.dart';
import 'package:flutter_crud_with_provider_package/model/user_model.dart';

class UserRepository {
  final userDao = UserApi(); // Use UserDao(); for SQLite

  Future getUsers({String query}) => userDao.getUsers(query: query);

  Future getUser(int id) => userDao.getUser(id: id);

  Future createUser(User user) => userDao.createUser(user);

  Future updateUser(User user) => userDao.updateUser(user);

  Future deleteUser(int id) => userDao.deleteUser(id);
}