🤖

## Flutter StatefulWidget Example

Here's a complete example showing how to create a stateful widget:

    DARTclass MyWidget extends StatefulWidget {
      const MyWidget({Key? key}) : super(key: key);

      @override
      State<MyWidget> createState() => _MyWidgetState();
    }

    class _MyWidgetState extends State<MyWidget> {
      int counter = 0;

      @override
      Widget build(BuildContext context) {
        return Text('Counter: $counter');
      }
    }

### Key Points

- StatefulWidget holds mutable state
- Use setState() to trigger rebuilds
- Separate State class manages the data

Check out the docs: https://flutter.dev

Use inline code like `setState()` for updates.

🤖

Here's a Flutter StatefulWidget example:

    DARTclass MyWidget extends StatefulWidget {
      const MyWidget({Key? key}) : super(key: key);

      @override
      State<MyWidget> createState() => _MyWidgetState();
    }

    class _MyWidgetState extends State<MyWidget> {
      int counter = 0;

      @override
      Widget build(BuildContext context) {
        return Text('Counter: $counter');
      }
    }

Check out the docs: https://flutter.dev

Use inline code like `setState()` for updates.