Last active
August 30, 2020 11:28
-
-
Save karanahuja-android/f81606817894c6f6b3f17072a2bc0665 to your computer and use it in GitHub Desktop.
This file contains 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
import 'package:flutter/material.dart'; | |
main () | |
{ | |
runApp (HelloWorld ()); | |
} | |
class HelloWorld extends StatefulWidget | |
{ | |
@override | |
_HelloWorldState createState () => _HelloWorldState (); | |
} | |
class _HelloWorldState extends State <HelloWorld> | |
{ | |
var message = "Hello World"; | |
changeMyState () | |
{ | |
setState (() | |
{ | |
this.message = "Goodbye World"; | |
}); | |
} | |
@override | |
Widget build (BuildContext context) | |
{ | |
return MaterialApp( | |
home:Scaffold( | |
appBar:AppBar( | |
title:Text ("Hello World App") | |
), | |
body:Center ( | |
child:GestureDetector( | |
onTap: changeMyState, | |
child:Text("$message") | |
), | |
), | |
) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment