Skip to content

Instantly share code, notes, and snippets.

@Chralu
Last active September 19, 2022 15:37
Show Gist options
  • Save Chralu/31f73062dfc6f7ffdb4dc9a9e9629d2b to your computer and use it in GitHub Desktop.
Save Chralu/31f73062dfc6f7ffdb4dc9a9e9629d2b to your computer and use it in GitHub Desktop.
Flutter101 - Layout column

Flutter101 - Layout column

Created with <3 with dartpad.dev.

import 'package:flutter/material.dart';
class ColumnDemo extends StatelessWidget {
const ColumnDemo({super.key});
@override
Widget build(BuildContext context) {
return Column(
textDirection: TextDirection.ltr,
mainAxisAlignment: MainAxisAlignment.center, // Positionnement vertical
crossAxisAlignment: CrossAxisAlignment.center, // Positionnement horizontal
children: [
Container(
color: Colors.red,
width: 100,
height: 100,
),
Container(
color: Colors.green,
width: 100,
height: 100,
),
Container(
color: Colors.blue,
width: 100,
height: 100,
)
],
);
}
}
void main() {
runApp(
const ColumnDemo(),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment