Skip to content

Instantly share code, notes, and snippets.

@YBCS
Created November 24, 2019 09:12
Show Gist options
  • Save YBCS/57102a24621b96d12df0033f33145545 to your computer and use it in GitHub Desktop.
Save YBCS/57102a24621b96d12df0033f33145545 to your computer and use it in GitHub Desktop.
some basic stuff on dart
// This is the basics
void main() => runApp(MaterialApp(
// home: Text('hey ninjas!'),
// notice : the widgets starts with upper case
// coma follows every property / widgets
home: Scaffold(
appBar: AppBar(
title: Text('my first app'),
centerTitle: true,
),
body: Center(
// there should always be property inside widgets
child: Text('helo ninja'),
),
floatingActionButton: FloatingActionButton(
child: Text('Click'),
),
),
));
// scaffold allows us to implement more stuff in the home page --
// it is wrapper to many properties such as home body etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment