Stateful Widget In Action
In this lesson, we cover how to implement a Stateful widget in detail.
We'll cover the following...
Introduction
In this lesson, we’ll make use of the Stateful widget to toggle “Hello Flutter !” text from English to Spanish and vice versa.
We chose the Stateful widget because we need to update the currently displayed text.
In the Hello Flutter app, clicking on the ‘refresh’ IconButton in appBar will trigger updating the text. The interface rebuild is triggered by the setState method provided by the Stateful widget.
Creating Stateful widget
First, HelloFlutterApp needs to extend Stateful widget:
class HelloFlutterApp extends ... Ask