Skip to content

Instantly share code, notes, and snippets.

@iamchathu
Last active November 9, 2018 19:41
Show Gist options
  • Save iamchathu/06640ebcf562d2fd4481438fd4546be4 to your computer and use it in GitHub Desktop.
Save iamchathu/06640ebcf562d2fd4481438fd4546be4 to your computer and use it in GitHub Desktop.
Hello Flutter
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Hello DevFest',
home: Scaffold(
appBar: AppBar(
title: Text('Hello DevFest Colombo'),
),
body: HelloRectangle(),
),
),
);
}
class HelloRectangle extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Center(
child: Container(
color: Colors.greenAccent,
height: 400.0,
width: 300.0,
child: Center(
child: Text(
'Hello from Flutter!',
style: TextStyle(fontSize: 40.0),
textAlign: TextAlign.center,
),
),
),
);
}
}
import 'package:flutter/material.dart';
class HelloDevFest extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
color: Colors.greenAccent,
height: 300,
width: 400,
);
}
}
void main() {
runApp(MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(
title: Text('Google DevFest'),
),
body: HelloDevFest())));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment