Created
August 13, 2022 23:04
-
-
Save FlutterZeroGit/c85f12732c7eacb6b21d948ea061ffa2 to your computer and use it in GitHub Desktop.
StatelessWidget
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'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
var text = 'Hello World'; | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
appBar: AppBar(title: Text('FlutterZero')), | |
body: Center( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: [ | |
Text(text, style: TextStyle(fontSize: 30)), | |
SizedBox(height: 20), | |
ElevatedButton( | |
onPressed: () { | |
text = 'I am Flutter'; | |
print(text); | |
}, | |
child: Text('Click'), | |
) | |
], | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment