Skip to content

Instantly share code, notes, and snippets.

@karan-ta
Created September 20, 2020 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karan-ta/232972bc302c9b9ed991eee294bbd4dd to your computer and use it in GitHub Desktop.
Save karan-ta/232972bc302c9b9ed991eee294bbd4dd to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
void main()
{
runApp(new HelloWorld());
}
class HelloWorld extends StatefulWidget {
@override
_HelloWorldState createState() => _HelloWorldState();
}
class _HelloWorldState extends State<HelloWorld> {
String mytext = "Hello World";
void goodbyeText()
{
setState((){
this.mytext = "GoodBye World";
});
print("inside goodbye text") ;
print (this.mytext);
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Hello'),
),
body:Center(
child:FlatButton(
color: Colors.blue,
textColor:Colors.lightGreenAccent,
onPressed:(){},
child:Text(
"1"
),
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment