Created
          June 22, 2018 17:32 
        
      - 
      
- 
        Save kn0ch3n/f0ae81adde270b33d46b5d38b7ddcb9b to your computer and use it in GitHub Desktop. 
    Flutter example
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class CounterState extends State<Counter> { | |
| int counter = 0; | |
| void increment() { | |
| // Tells the Flutter framework that state has changed, | |
| // so the framework can run build() and update the display. | |
| setState(() { | |
| counter++; | |
| }); | |
| } | |
| Widget build(BuildContext context) { | |
| // This method is rerun every time setState is called. | |
| // The Flutter framework has been optimized to make rerunning | |
| // build methods fast, so that you can just rebuild anything that | |
| // needs updating rather than having to individually change | |
| // instances of widgets. | |
| return new Row( | |
| children: <Widget>[ | |
| new RaisedButton( | |
| onPressed: increment, | |
| child: new Text('Increment'), | |
| ), | |
| new Text('Count: $counter'), | |
| ], | |
| ); | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment