Created with <3 with dartpad.dev.
Last active
September 19, 2022 16:03
-
-
Save Chralu/505ef40582f263ce9129d5417fa7ea87 to your computer and use it in GitHub Desktop.
Flutter101 - Layout row
This file contains 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'; | |
class RowDemo extends StatelessWidget { | |
const RowDemo({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return Row( | |
textDirection: TextDirection.ltr, | |
mainAxisAlignment: MainAxisAlignment.center, // Positionnement horizontal | |
crossAxisAlignment: CrossAxisAlignment.center, // Positionnement vertical | |
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 RowDemo(), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment