Created
January 25, 2020 21:30
-
-
Save rullyalves/0e9c016a46a5cf29f9704b425a878397 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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