Skip to content

Instantly share code, notes, and snippets.

@FlutterZeroGit
Created August 13, 2022 23:04
Show Gist options
  • Save FlutterZeroGit/c85f12732c7eacb6b21d948ea061ffa2 to your computer and use it in GitHub Desktop.
Save FlutterZeroGit/c85f12732c7eacb6b21d948ea061ffa2 to your computer and use it in GitHub Desktop.
StatelessWidget
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