INNER CODE UNIT · Dart

_DisplayCountState

antz22/ultimate-guide-to-flutter · code/flutter_examples.dart:211

class _DisplayCountState extends State<DisplayCount> {

  // defining a variable, count, inside our widget
  int count = 0;    

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        // display the count as a string
        Text(count.toString()),

        ElevatedButton(
          // the text displayed on the button
          child: Text('Click me to add +'),

          // the code that will execute when the button is pressed
          onPressed: () {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…