coyangi
코딩하는 고양이
coyangi
전체 방문자
오늘
어제
  • 분류 전체보기 (23)
    • 🚀 Daily Life (1)
      • 덕질 (1)
      • 회고 (0)
    • 🍎 MAC OS (1)
    • 🔫 Algorithm (1)
      • Goormlevel (0)
    • 🌈 Programming (18)
      • Dart (7)
      • ETC (1)
      • Flutter (4)
      • Git (0)
      • Javascript (1)
      • Laravel (3)
      • PHP (2)
    • 🌎 Server (1)
    • 🧠 Database (0)
      • MySQL (0)
    • 💻 Computer Science (0)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • Instance
  • 웹서버
  • json
  • Containe
  • Class
  • 알고리즘
  • Sizedbox
  • php
  • override
  • Server
  • 플루터
  • flutter
  • Laravel
  • parameter
  • constructor
  • 라라벨
  • 맥
  • 서버구축
  • 덕질
  • 앱
  • CENTER
  • dart
  • config
  • argument
  • XAMPP
  • crud
  • ajax
  • HOBBY FAIR
  • 인자
  • 데이터 구조

최근 글

티스토리

개인정보

  • 티스토리 홈
  • 스토리
  • 포럼
  • 로그인
hELLO · Designed By 정상우.
coyangi

코딩하는 고양이

[Flutter] 단일 박스(Container) 위젯 작성
🌈 Programming/Flutter

[Flutter] 단일 박스(Container) 위젯 작성

2022. 6. 7. 04:57

📚 Container, SizedBox, Center

1. Center

child 를 가운데 배치합니다.

const Center(
   child: Text('Flutter My Home Page');
)

2. Containsar

child 레이아웃의 위젯

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Center(child: const Text('Flutter My App Bar')),
      ),
      body: Container(
        color: Colors.yellow,
        alignment: const Alignment(1, -1),
        padding: const EdgeInsets.symmetric(
          horizontal: 20,
          vertical: 50,
        ),
        margin: const EdgeInsets.symmetric(
          horizontal: 50,
          vertical: 50,
        ),
        width: 100,
        height: 300,
        child: const Text('Flutter My Home Page'),
      ),
    );
  }
}

 

 

 

 

📍 Alignment

x축
• -1 left
• 0 center
• 1 right

y축
• -1 bottom
• 0 center
• -1 top

// x = 0 center
// y = 0 center
alignment: const Alignment(1, -1.1),

'🌈 Programming > Flutter' 카테고리의 다른 글

[Fltutter] MaterialApp, Text, Scaffold, Appbar  (0) 2022.06.07
[Flutter] 플러터 프로젝트 구조 이해하기  (0) 2022.06.07
[Flutter] Windows 에 개발 환경 구축  (0) 2022.05.02
    '🌈 Programming/Flutter' 카테고리의 다른 글
    • [Fltutter] MaterialApp, Text, Scaffold, Appbar
    • [Flutter] 플러터 프로젝트 구조 이해하기
    • [Flutter] Windows 에 개발 환경 구축
    coyangi
    coyangi
    경기도 모 창고에서 은둔하다 양지 바른 땅으로 올라온 고양이

    티스토리툴바