Skip to content

Instantly share code, notes, and snippets.

@mdrobnych
Last active June 11, 2020 21:27
Show Gist options
  • Save mdrobnych/d7c0037de78c23aec71b1627414ce65c to your computer and use it in GitHub Desktop.
Save mdrobnych/d7c0037de78c23aec71b1627414ce65c to your computer and use it in GitHub Desktop.
Flutter Layout Hints
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
// Application name
title: 'Flutter Hello World',
// Application theme data, you can set the colors for the application as
// you want
theme: ThemeData(
primarySwatch: Colors.blue,
),
// A widget which will be started on application startup
home: MyHomePage(title: 'Row vs Column'),
);
}
}
class MyHomePage extends StatelessWidget {
final String title;
const MyHomePage({@required this.title});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: true,
title: Text(title),
),
body: Container(
color: Colors.white,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
alignment: Alignment.topLeft,
color: Colors.indigo[800],
height: 229,
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(Icons.tag_faces, size: 28, color: Colors.white),
Icon(Icons.tag_faces, size: 58, color: Colors.white),
Icon(Icons.tag_faces, size: 28, color: Colors.white),
],
),
),
Container(
alignment: Alignment.topLeft,
color: Colors.blueAccent,
height: 229,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(Icons.face, size: 28, color: Colors.white),
Icon(Icons.face, size: 58, color: Colors.white),
Icon(Icons.face, size: 28, color: Colors.white),
],
),
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment