Skip to content

Instantly share code, notes, and snippets.

@vladnicula
Created May 29, 2021 08:26
Show Gist options
  • Save vladnicula/a223a08e01af2e6818b63ed621571838 to your computer and use it in GitHub Desktop.
Save vladnicula/a223a08e01af2e6818b63ed621571838 to your computer and use it in GitHub Desktop.
Hello Flutter 04
import 'package:flutter/material.dart';
class MyHelloWorld extends StatelessWidget {
@override
build (BuildContext context) {
return Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text('Hello, world!'),
TextButton(
onPressed: () {
print("I was pressed");
},
child: Text("Click me")
)
]
)
);
}
}
void main() {
runApp(
MaterialApp(
title: 'Hello From Flutter', // used by the OS task switcher
home: SafeArea(
child: Scaffold(
body: MyHelloWorld()
),
),
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment