Build: Service Locator Demo
This screen demonstrates how to use the service locator pattern to access a simple greeting service from anywhere in the app.
Target UI
------------------------- | Service Locator Demo | |-----------------------| | Greeting: | | | | [Show Greeting] | | | -------------------------
Create a simple GreetingService class with a method that returns a greeting string.
Use a service locator to register and retrieve the GreetingService instance.
Build a screen with a button labeled 'Show Greeting'.
When the button is pressed, display the greeting text below the label 'Greeting:'.
Use the service locator to get the GreetingService inside the widget.