Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lbarqueira/3af06d948bccb5fda004cf2e8bc0444d to your computer and use it in GitHub Desktop.
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
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