Created
February 8, 2021 18:50
-
-
Save lbarqueira/3af06d948bccb5fda004cf2e8bc0444d to your computer and use it in GitHub Desktop.
Flutter layout codelab, where you learn how to build a Flutter UI without downloading and installing Flutter or Dart! Row, Column, Text, Icon, Image
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: 'Flutter Tutorial', | |
home: Scaffold( | |
body: Container( | |
decoration: BoxDecoration(color: Colors.cyan), | |
child: MyWidget(), | |
), | |
), | |
), | |
); | |
} | |
class MyWidget extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Row( | |
mainAxisAlignment: MainAxisAlignment.spaceAround, | |
crossAxisAlignment: CrossAxisAlignment.baseline, | |
textBaseline: TextBaseline.alphabetic, | |
children: [ | |
Text( | |
'Hey!', | |
style: TextStyle( | |
fontSize: 30, | |
fontFamily: 'Futura', | |
color: Colors.blue, | |
), | |
), | |
Icon( | |
Icons.access_alarm_outlined, | |
color: Colors.red, | |
size: 15.0, | |
), | |
Image.network( | |
'https://raw.githubusercontent.com/flutter/website/master/examples/layout/sizing/images/pic1.jpg', | |
width: 100.0, | |
height: 100.0, | |
fit: BoxFit.fill), | |
Text( | |
'Hey!', | |
style: TextStyle( | |
fontSize: 40, | |
fontFamily: 'Futura', | |
color: Colors.red, | |
), | |
), | |
], | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment