본문 바로가기
반응형

Flutter47

[Flutter] BuildContext 와 of 함수 https://api.flutter.dev/flutter/material/Scaffold/of.html of method - Scaffold class - material library - Dart API ScaffoldState of(BuildContext context ) Finds the ScaffoldState from the closest instance of this class that encloses the given context. If no instance of this class encloses the given context, will cause an assert in debug mode, and throw an exception in api.flutter.dev https://api.. 2021. 12. 14.
[Flutter] state 관리와 provider https://docs.flutter.dev/development/data-and-backend/state-mgmt/declarative Start thinking declaratively How to think about declarative programming. docs.flutter.dev 해당 문서는 플러터 공식 문서를 기반으로 작성합니다. 0. 개요 본 문서는 Flutter의 UI의 기본적인 개념과 App State에 대한 정의를 익힌 뒤 State관리를 위한 Provider 사용법에 대해 배울 예정입니다. 1. Declarative UI에 대한 소개 먼저 소개해 드릴 내용은 Declarative 라는 개념입 니다. 플러터는 기본적으로 Declarative style 프레임 워크입니다. 다른 .. 2021. 12. 14.
[Flutter] floating bottom navigation bar 만들기 bottom navigation bar에 shadow를 주었더니 그림자가 잘리는 현상이 발생했다. bottom navigation bar가 차지하는 영역이 자기주장을 확실하게 하니 뒷배경이 안보여 상당히 허접해보인다. 이를 해결하는 방법은 scaffold에 extendBody = true 를 주면 된다. return Scaffold( extendBody: true, 2021. 11. 30.
[Flutter] Animation 이해하기 0. Animation의 대표적인 컨셉 한마디로 요약하면 위젯의 특정 속성 값을 계속 변화시키며 rebuild 하는것! 애니메이션은 value change를 가진다. 즉 어떤 값이 start에서 end로 변화한다. 이 값의 변화를 위젯의 특정속성에다가 부여하면 플러터는 계속해서 이를 rebuild 하게 된다. 그러므로 움직이는것 처럼 보이게 되는 것이다. 이러한 값 변화는 impicit에서는 Tween을 이용하고 explicit에선 AnimationController를 이용하게 된다. 1. implicit, explicit 애니메이션의 종류에는 크게 두가지가 있다. implicit, explicit implicit animation은 속성값을 변화시키면 자기가 알아서 애니메이션을 만들어준다. 만약 애니메.. 2021. 11. 26.
[Flutter] BorderRadius 가 child에 적용이 안될 때 아래 그림처럼 Container에 둥근 모서리를 적용했는데 child가 튀어나오는 경우가 있다. 이를 해결하는 방법은 child를 ClipRRect로 감싸주어 똑같은 raidus값을 적용해주면 된다. 2021. 11. 25.
[Flutter] 화면 터치하면 키보드 unfocus 되도록 만들기 1. 위젯 전체를 GestureDetector 위젯으로 wrapping 한다 2. onTab에 FocusScope.of(context).unfocus(); 문을 넣는다. GestureDetector( onTap: () { FocusScope.of(context).unfocus(); }, 2021. 11. 11.
[Flutter] Widget 위젯 배우기 https://flutter.dev/docs/development/ui/widgets-intro Introduction to widgets Learn about Flutter's widgets. flutter.dev 0. 요약 StatelessWidget : 상태가 없는 위젯. 변화가 거의 없는 위젯은 이것으로 선언한다 StatefulWidget : state라는 데이터 변화를 감지하고, state가 변할시 위젯을 rebuild 하는 위젯. setState라는 함수를 통해 state변화를 감지하여야 한다 GestureDetector : 위젯을 이것으로 감싸면 유저의 input gesture를 감지할 수 있다 initState: StatefulWidget 생성시 초기에 딱 한번 호출. 이니셜라이징 할 곳은.. 2021. 7. 21.
반응형