We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Lazy load Widgets
We have a `widgets` module that imports all the widgets. THis allows for easy imports like:

```python
from textual.widgets import DataTable, Button
```

The downside is that all widgets are imported even if you only need one, increasing startup time.

I think we should be able to do this lazily some how, possibly by implementing a module level `__getattr__`.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/textual/widgets/__init__.py`
Content:
```
1 from ._footer import Footer
2 from ._header import Header
3 from ._button import Button
4 from ._placeholder import Placeholder
5 from ._static import Static
6 from ._tree_control import TreeControl, TreeClick, TreeNode, NodeID
7 from ._directory_tree import DirectoryTree, FileClick
8 
9 __all__ = [
10     "Button",
11     "DirectoryTree",
12     "FileClick",
13     "Footer",
14     "Header",
15     "Placeholder",
16     "Static",
17     "TreeClick",
18     "TreeControl",
19     "TreeNode",
20     "NodeID",
21 ]
22
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/textual/widgets/__init__.py b/src/textual/widgets/__init__.py
--- a/src/textual/widgets/__init__.py
+++ b/src/textual/widgets/__init__.py
@@ -1,21 +1,41 @@
-from ._footer import Footer
-from ._header import Header
-from ._button import Button
-from ._placeholder import Placeholder
-from ._static import Static
-from ._tree_control import TreeControl, TreeClick, TreeNode, NodeID
-from ._directory_tree import DirectoryTree, FileClick
+from __future__ import annotations
+from importlib import import_module
+import typing
 
+from ..case import camel_to_snake
+
+if typing.TYPE_CHECKING:
+    from ..widget import Widget
+
+
+# ⚠️For any new built-in Widget we create, not only we have to add them to the following list, but also to the
+# `__init__.pyi` file in this same folder - otherwise text editors and type checkers won't be able to "see" them.
 __all__ = [
     "Button",
     "DirectoryTree",
-    "FileClick",
     "Footer",
     "Header",
     "Placeholder",
     "Static",
-    "TreeClick",
     "TreeControl",
-    "TreeNode",
-    "NodeID",
 ]
+
+
+_WIDGETS_LAZY_LOADING_CACHE: dict[str, type[Widget]] = {}
+
+# Let's decrease startup time by lazy loading our Widgets:
+def __getattr__(widget_class: str) -> type[Widget]:
+    try:
+        return _WIDGETS_LAZY_LOADING_CACHE[widget_class]
+    except KeyError:
+        pass
+
+    if widget_class not in __all__:
+        raise ImportError(f"Package 'textual.widgets' has no class '{widget_class}'")
+
+    widget_module_path = f"._{camel_to_snake(widget_class)}"
+    module = import_module(widget_module_path, package="textual.widgets")
+    class_ = getattr(module, widget_class)
+
+    _WIDGETS_LAZY_LOADING_CACHE[widget_class] = class_
+    return class_

{"golden_diff": "diff --git a/src/textual/widgets/__init__.py b/src/textual/widgets/__init__.py\n--- a/src/textual/widgets/__init__.py\n+++ b/src/textual/widgets/__init__.py\n@@ -1,21 +1,41 @@\n-from ._footer import Footer\n-from ._header import Header\n-from ._button import Button\n-from ._placeholder import Placeholder\n-from ._static import Static\n-from ._tree_control import TreeControl, TreeClick, TreeNode, NodeID\n-from ._directory_tree import DirectoryTree, FileClick\n+from __future__ import annotations\n+from importlib import import_module\n+import typing\n \n+from ..case import camel_to_snake\n+\n+if typing.TYPE_CHECKING:\n+    from ..widget import Widget\n+\n+\n+# \u26a0\ufe0fFor any new built-in Widget we create, not only we have to add them to the following list, but also to the\n+# `__init__.pyi` file in this same folder - otherwise text editors and type checkers won't be able to \"see\" them.\n __all__ = [\n     \"Button\",\n     \"DirectoryTree\",\n-    \"FileClick\",\n     \"Footer\",\n     \"Header\",\n     \"Placeholder\",\n     \"Static\",\n-    \"TreeClick\",\n     \"TreeControl\",\n-    \"TreeNode\",\n-    \"NodeID\",\n ]\n+\n+\n+_WIDGETS_LAZY_LOADING_CACHE: dict[str, type[Widget]] = {}\n+\n+# Let's decrease startup time by lazy loading our Widgets:\n+def __getattr__(widget_class: str) -> type[Widget]:\n+    try:\n+        return _WIDGETS_LAZY_LOADING_CACHE[widget_class]\n+    except KeyError:\n+        pass\n+\n+    if widget_class not in __all__:\n+        raise ImportError(f\"Package 'textual.widgets' has no class '{widget_class}'\")\n+\n+    widget_module_path = f\"._{camel_to_snake(widget_class)}\"\n+    module = import_module(widget_module_path, package=\"textual.widgets\")\n+    class_ = getattr(module, widget_class)\n+\n+    _WIDGETS_LAZY_LOADING_CACHE[widget_class] = class_\n+    return class_\n", "issue": "Lazy load Widgets\nWe have a `widgets` module that imports all the widgets. THis allows for easy imports like:\r\n\r\n```python\r\nfrom textual.widgets import DataTable, Button\r\n```\r\n\r\nThe downside is that all widgets are imported even if you only need one, increasing startup time.\r\n\r\nI think we should be able to do this lazily some how, possibly by implementing a module level `__getattr__`.\n", "before_files": [{"content": "from ._footer import Footer\nfrom ._header import Header\nfrom ._button import Button\nfrom ._placeholder import Placeholder\nfrom ._static import Static\nfrom ._tree_control import TreeControl, TreeClick, TreeNode, NodeID\nfrom ._directory_tree import DirectoryTree, FileClick\n\n__all__ = [\n    \"Button\",\n    \"DirectoryTree\",\n    \"FileClick\",\n    \"Footer\",\n    \"Header\",\n    \"Placeholder\",\n    \"Static\",\n    \"TreeClick\",\n    \"TreeControl\",\n    \"TreeNode\",\n    \"NodeID\",\n]\n", "path": "src/textual/widgets/__init__.py"}], "after_files": [{"content": "from __future__ import annotations\nfrom importlib import import_module\nimport typing\n\nfrom ..case import camel_to_snake\n\nif typing.TYPE_CHECKING:\n    from ..widget import Widget\n\n\n# \u26a0\ufe0fFor any new built-in Widget we create, not only we have to add them to the following list, but also to the\n# `__init__.pyi` file in this same folder - otherwise text editors and type checkers won't be able to \"see\" them.\n__all__ = [\n    \"Button\",\n    \"DirectoryTree\",\n    \"Footer\",\n    \"Header\",\n    \"Placeholder\",\n    \"Static\",\n    \"TreeControl\",\n]\n\n\n_WIDGETS_LAZY_LOADING_CACHE: dict[str, type[Widget]] = {}\n\n# Let's decrease startup time by lazy loading our Widgets:\ndef __getattr__(widget_class: str) -> type[Widget]:\n    try:\n        return _WIDGETS_LAZY_LOADING_CACHE[widget_class]\n    except KeyError:\n        pass\n\n    if widget_class not in __all__:\n        raise ImportError(f\"Package 'textual.widgets' has no class '{widget_class}'\")\n\n    widget_module_path = f\"._{camel_to_snake(widget_class)}\"\n    module = import_module(widget_module_path, package=\"textual.widgets\")\n    class_ = getattr(module, widget_class)\n\n    _WIDGETS_LAZY_LOADING_CACHE[widget_class] = class_\n    return class_\n", "path": "src/textual/widgets/__init__.py"}]}