Skip to content

Instantly share code, notes, and snippets.

@zontyp
Created April 27, 2020 19:04
Show Gist options
  • Save zontyp/1f586eaf2fef85cc3b6caa48dc3c9187 to your computer and use it in GitHub Desktop.
Save zontyp/1f586eaf2fef85cc3b6caa48dc3c9187 to your computer and use it in GitHub Desktop.
hellostateless.dart
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