Skip to content

Instantly share code, notes, and snippets.

@rullyalves
Created January 25, 2020 21:30
Show Gist options
  • Select an option

  • Save rullyalves/0e9c016a46a5cf29f9704b425a878397 to your computer and use it in GitHub Desktop.

Select an option

Save rullyalves/0e9c016a46a5cf29f9704b425a878397 to your computer and use it in GitHub Desktop.
abstract class ITodoDao{
Future<List<Todo>> findAll();
Future<Todo> findById(int id);
Future<void> delete(int id);
}
class PlaceHolderTodoDao implements ITodoDao{
Dio dio;
Future<List<Todo>> findAll() async{
try{
}catch(e){
}
}
Future<Todo> findById(int id) async{
try{
}catch(e){
}
}
Future<void> delete(int id) async{
try{
}catch(e){
}
}
}
class Todo{
int id;
String title;
bool completed;
Todo.fromJson(Map<String,dynamic> json){
id = json["id"];
title = json["title"];
completed = json["completed"];
}
Map<String,dynamic> toJson() =>
{
"id": id,
"title": title,
"completed": completed
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment