[flutter] Stack + Positioned : 레이어만들기

Edward Hyun·2021년 11월 16일
0

app&web-dev

목록 보기
6/178
Stack(
  children: <Widget>[
    Positioned(
      top: 30,
      left: 30,
      height:250,
      width: 250,
      child: Container(
        width: 150,
        height: 150,
        color: Colors.green[300],
        child: Text(
          'Green',
          style: TextStyle(
              color: Colors.white,
              fontSize: 20
          ),
        ),
      ),
    ),
 ],
),

그냥 stack을 쌓으면 아래에 있는 위젯의 버튼을 클릭할 수 없음. positioned로 쌓으면 아래에 보이는 위젯에 이벤트를 가할 수 있음.

참고 :: https://medium.flutterdevs.com/stack-and-positioned-widget-in-flutter-3d1a7b30b09a

profile
앱&웹개발(flutter, vuejs, typescript, react), 인공지능(nlp, asr, rl), 백엔드(nodejs, flask, golang, grpc, webrtc, aws, msa, nft, spring cloud, nest.js), 함수형 프로그래밍(scala, erlang)을 공부하며 정리합니다.

0개의 댓글