플러터 간단 예제 만들어보기

고동이의 IT·2025년 9월 4일
0

flutter

목록 보기
2/5

유튜브 코딩애플 강의 그대로 따라하는데 나만.. 상단바 배경 파랑아니고 가운데 정렬이야? 알아보니 맥이라 그런거같음^_^ 색상은 내가 넣어주지뭐

컨테이너 박스는 남용하지말것 무겁다
성능을 위해 간단한 크기 조절이면 사이즈드 박스써라

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp()); /* 앱 구동 시켜주세요 MyApp()에 메인메이지 넣어주면됨 */
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {

    /* 실제 내용은 여기 안에 */
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('상단바'),
          backgroundColor: Colors.blue
        ),
        body: Text('가운데'),
        bottomNavigationBar: BottomAppBar(
          child: SizedBox( /* 가벼운 사이즈 박스 */
            height: 200,
            child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            children: [
              Icon(Icons.phone),
              Icon(Icons.message),
              Icon(Icons.contact_page),
            ]
                    ),
          ),
        ),
      ),
    );

  }
}
profile
삐약..뺙뺙

0개의 댓글