본문 바로가기
카테고리 없음

플러터 Flutter - Icon, Padding, Column, Row

by 땡칠이 2022. 2. 20.
반응형
플러터 Flutter Icon Padding Column Row

class MyHomePage extends StatelessWidget {
const MyHomePage({ Key? key }) : super(key: key);

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.orange,
foregroundColor: Colors.red,
title: const Text("text01_app_jenee"),
centerTitle: true,
),
body: Center(
child: Column( // 세로방향으로 나열
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0), // Padding 대한민국과 브라질 사이 간격
child: Row( // 가로방향으로 나열
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Icon(Icons.account_circle), // 계정 아이콘
SizedBox(
width: 20, // 아이콘과 대한민국 사이 간격
),
Text("대한민국")
],
),
),

Padding(
padding: const EdgeInsets.all(8.0), // Padding 브라질 기준 대한민국,독일 사이 간격
child: Row( // 가로방향으로 나열
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Icon(Icons.email_rounded), // 이메일 아이콘
SizedBox(
width: 20, // 아이콘과 브라질 사이 간격
),
Text("브라질",
style: TextStyle(
color: Colors.red,
fontSize: 20.0,
fontWeight: FontWeight.bold,
letterSpacing: 10.0,
),
),
],
),
),

Padding(
padding: const EdgeInsets.all(8.0), // Padding 브라질과 독일 사이 간격
child: Row( // 가로방향으로 나열
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Icon(Icons.account_balance), // 계정 아이콘
SizedBox(
width: 20, // 아이콘과 독일 사이 간격
),
Text("독일")
],
),
),
],
),
)
);
}
}

플러터 flutter Column Row Icon Padding

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(),
);
}
}

class MyHomePage extends StatelessWidget {
const MyHomePage({ Key? key }) : super(key: key);

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.grey,
foregroundColor: Colors.black,
title: const Text("Text01_app_jenee_2"),
centerTitle: true,
),
body: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Padding(
padding: EdgeInsets.all(8.0),
child: Icon(Icons.account_balance),
),
Padding(
padding: EdgeInsets.all(8.0),
child: Icon(Icons.account_circle),
),
Padding(
padding: EdgeInsets.all(8.0),
child: Icon(Icons.email_rounded),
),
]
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children:const [
Padding(
padding: EdgeInsets.all(8.0),
child: Text("대한민국",
style: TextStyle(
color:Colors.grey,
fontSize: 30.0,
fontWeight: FontWeight.bold,
letterSpacing: 15.0,
),
),
),
Padding(
padding: EdgeInsets.all(8.0),
child: Text("브라질"),
),
Padding(
padding: EdgeInsets.all(8.0),
child: Text("독일"),
),
],
),
],
)
)
);
}
}

반응형

댓글