Created
April 27, 2020 19:04
-
-
Save zontyp/1f586eaf2fef85cc3b6caa48dc3c9187 to your computer and use it in GitHub Desktop.
hellostateless.dart
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
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(new HelloWorld()); | |
} | |
class HelloWorld extends StatelessWidget { | |
String mytext = "Hello World"; | |
void goodbyeText(){ | |
this.mytext = "GoodBye World"; | |
print("inside goodbye text") ; | |
} | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text('Hello World Example'), | |
), | |
body: GestureDetector( | |
onTap: goodbyeText, | |
child:Center( | |
child: Text(mytext), | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment