<< 소스 코드 >>
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'BBANTO',
home: Grade(),
);
}
}
class Grade extends StatelessWidget {
const Grade({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.amber[800],
appBar: AppBar(
title: Text('BBANTO'),
backgroundColor: Colors.amber[700],
centerTitle: true, //AppBar에 타이틀을 중앙정렬 시킴
elevation: 0.0, //elevation을 사용하여 AppBar의 입체감을 없앰.
),
body: Padding(
padding: EdgeInsets.fromLTRB(30.0, 40.0, 0.0, 0.0),
child: Column(
//crossAxisAlignment: NAME과 BBANTO 문자열의 시작점을 정렬하기 위해 사용
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('NAME',
style: TextStyle(
color: Colors.white,
letterSpacing: 2.0,
),
),
SizedBox( //NAME과 BBANTO 문자열 사이 간격을 위해 SizedBox 삽입
height: 10.0,
),
Text('BBANTO',
style: TextStyle(
color: Colors.white,
letterSpacing: 2.0,
fontSize: 28.0,
fontWeight: FontWeight.bold,
),
),
],
),
),
);
}
}
<< 출력 화면 >>
'Flutter (with 코딩셰프)' 카테고리의 다른 글
[2023.11.20] 플러터(flutter) 순한 맛 강좌 14 | AppBar (1) | 2023.11.20 |
---|---|
[2023.11.17] 플러터(flutter) 순한 맛 강좌 11 | 캐릭터 페이지 디자인#3 (0) | 2023.11.17 |
[2023.11.15] 플러터(flutter) 순한 맛 강좌 9 | 위젯정렬 (0) | 2023.11.15 |
[2023.11.03] 플러터(flutter) 순한 맛 강좌 7-8 | 플러터 앱페이지 기본코드 이해하기 (0) | 2023.11.03 |
[2023.11.03] Intro. (0) | 2023.11.03 |