Created
February 9, 2021 17:32
-
-
Save lbarqueira/a44e1cf91f337115d880bae2a41d916b to your computer and use it in GitHub Desktop.
Putting it all together - https://flutter.dev/docs/codelabs/layout-basics#putting-it-all-together
This file contains hidden or 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( | |
MaterialApp( | |
debugShowCheckedModeBanner: false, | |
title: 'Putting it all together', | |
home: Scaffold( | |
body: MyWidget(), | |
), | |
), | |
); | |
} | |
class MyWidget extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Container( | |
decoration: BoxDecoration( | |
color: Colors.amber, | |
border: Border.all( | |
color: Colors.black, | |
width: 8.0, | |
), | |
), | |
margin: EdgeInsets.all(8.0), | |
child: Column( | |
mainAxisSize: MainAxisSize.min, | |
crossAxisAlignment: CrossAxisAlignment.stretch, | |
children: [ | |
Row( | |
mainAxisAlignment: MainAxisAlignment.start, | |
children: [ | |
Padding( | |
padding: const EdgeInsets.all(8.0), | |
child: Icon(Icons.account_circle, size: 50), | |
), | |
Column( | |
crossAxisAlignment: CrossAxisAlignment.center, | |
mainAxisSize: MainAxisSize.min, | |
children: [ | |
Text( | |
'Flutter McFlutter', | |
style: Theme.of(context).textTheme.headline5, | |
), | |
Text( | |
'Experienced App Developer', | |
) | |
], | |
), | |
], | |
), | |
SizedBox(height: 8), | |
Row( | |
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | |
children: [ | |
Text( | |
'123 Main Street', | |
), | |
Text( | |
'(415) 555-0198', | |
), | |
], | |
), | |
SizedBox(height: 16), | |
Row( | |
mainAxisAlignment: MainAxisAlignment.spaceAround, | |
children: [ | |
Icon(Icons.accessibility), | |
Icon(Icons.timer), | |
Icon(Icons.phone_android), | |
Icon(Icons.phone_iphone), | |
], | |
), | |
SizedBox(height: 8), | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment