Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- Flutter 예제
- sqlite
- InkWell
- Load Image
- Flutter Tutorial
- Row Widget
- Cached Image
- Row
- Snackbar
- Flutter 앱 배포
- CrossAxisAlignment
- Flutter 강좌
- Networking
- flutter
- Image.network
- Scaffold
- MainAxisAlignment
- HTTP
- ListView.builder
- ListTile
- FutureBuilder
- WillPopScope
- Flutter Example
- 반석천
- navigator
- Hello World
- node.js
- AppBar
- Column Widget
- listview
Archives
- Today
- Total
꿈꾸는 시스템 디자이너
Flutter Example - Row Widget - CrossAxisAlignment 본문
import 'package:flutter/material.dart';
class RowWidgetCrossAxisAlignment extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Row widget - CrossAxisAlignment")),
body: ListView(
children: <Widget>[
Text("default (CrossAxisAlignment.center)"),
Container(
decoration: BoxDecoration(
color: Colors.grey[200],
border: Border.all(color: Colors.indigo, width: 0.5)),
height: 80,
child: Row(
//crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
boxWidget(),
boxWidget(),
boxWidget(),
],
),
),
Text("\nDefault (CrossAxisAlignment.start)"),
Container(
decoration: BoxDecoration(
color: Colors.grey[200],
border: Border.all(color: Colors.indigo, width: 0.5)),
height: 80,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
boxWidget(),
boxWidget(),
boxWidget(),
],
),
),
Text("\nCrossAxisAlignment.end"),
Container(
decoration: BoxDecoration(
color: Colors.grey[200],
border: Border.all(color: Colors.indigo, width: 0.5)),
height: 80,
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
boxWidget(),
boxWidget(),
boxWidget(),
],
),
),
Text("\nCrossAxisAlignment.stretch"),
Container(
decoration: BoxDecoration(
color: Colors.grey[200],
border: Border.all(color: Colors.indigo, width: 0.5)),
height: 80,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
boxWidget(),
boxWidget(),
boxWidget(),
],
),
),
Text("\nCrossAxisAlignment.baseline"),
Container(
decoration: BoxDecoration(
color: Colors.grey[200],
border: Border.all(color: Colors.indigo, width: 0.5)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: <Widget>[
Text("Hello", style: TextStyle(fontSize: 50)),
Text("Hello", style: TextStyle(fontSize: 30)),
Text("Hello", style: TextStyle(fontSize: 10)),
],
),
),
Text("\nCrossAxisAlignment.center & MainAxisAlignment.center"),
Container(
decoration: BoxDecoration(
color: Colors.grey[200],
border: Border.all(color: Colors.indigo, width: 0.5)),
height: 80,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
boxWidget(),
boxWidget(),
boxWidget(),
],
),
),
],
),
);
}
boxWidget() {
return Container(
height: 50,
width: 50,
decoration: BoxDecoration(
color: Colors.blue[400],
border: Border.all(color: Colors.indigo, width: 0.5)),
child: Center(
child:
Text("Box", style: TextStyle(fontSize: 12, color: Colors.white))),
);
}
}
▶ Go to Table of Contents | 강의 목차로 이동
※ This example is also available in the Flutter Code Examples app. | 본 예제는 Flutter Code Examples 앱에서도 제공됩니다.
'Tutorial > Flutter with App' 카테고리의 다른 글
Flutter Example - Column Widget - Alignment (0) | 2019.09.24 |
---|---|
Flutter Example - Column Widget - Basic (0) | 2019.09.24 |
Flutter Example - Row Widget - MainAxisAlignment (0) | 2019.09.24 |
Flutter Example - Row Widget - Basic (0) | 2019.09.24 |
Flutter Example - Center Widget (0) | 2019.09.24 |
Comments