플러터 여백 마진 패딩

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

flutter

목록 보기
5/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: Align(
          alignment: Alignment.bottomCenter,
          child: Container(
            width: double.infinity, height: 100, color: Colors.red,
           /* margin: EdgeInsets.all(20),  바깥 여백 주기 */
           /* padding: EdgeInsets.all(15), 안쪽 여백 주기 */
                 /*   decoration: BoxDecoration(
              border: Border.all(color: Colors.black)
              박스 테두리 주기
            ),*/
            child: Text('온도'),
          ),
        ),
      ),
    );

  }
}
profile
삐약..뺙뺙

0개의 댓글