Task Description: Implement a Simple In-Memory Todo List Application
You are required to implement a simple in-memory Todo List application that allows users to create, read, update, and delete todo items. The application should be structured such that the functionality is encapsulated within a class.
Requirements:
Class Definition:
Create a class named TodoList that has the following attributes and methods:
Attributes:
An internal list to store todo items. Each todo item should be represented as a dictionary with at least the following keys:
id: A unique identifier (integer) for each todo item.
title: A string representing the title of the todo item.
completed: A boolean indicating whether the todo item is completed.
Methods:
add_todo(title: str) -> int: Accepts a title (string), adds a new todo item to the list with a unique id and a completed status of False, and returns the id of the newly created todo item.
get_todo(id: int) -> dict: Accepts a todo item id and returns the corresponding todo item as a dictionary. If the item does not exist, it should return None.
update_todo(id: int, title: str, completed: bool) -> bool: Accepts a todo item id, a new title, and a completed status. It updates the corresponding todo item if it exists and returns True. If the item does not exist, it should return False.
delete_todo(id: int) -> bool: Accepts a todo item id and deletes the corresponding item if it exists, returning True. If the item does not exist, it should return False.
get_all_todos() -> List[dict]: Returns a list of all todo items in the todo list.
Implementation Location:
Please implement the solution in the file /app/todo_list.py.
Ensure that your implementation adheres to this specification so that all provided tests will pass successfully.