본문 바로가기
728x90

Flutter16

[Flutter/플러터] listview 안에서 scroll 하기 아래와 같은 Card가 나열된 listView를 만들었다 그런데 문제는 listview 안에서 저 회색 Container의 Text를 스크롤 하고 싶었지만, SingleChildScrollView를 써도 잘 되지 않았다 아래를 보면서 다시 해결해보자 다음과 같이 listview를 만들고 listview들을 스크롤하여 볼 수 있게 다음과 같이 설정해 준다. physics는 스크롤 상태를 설정한다. BouncingScrollPhysics()는 flutter에서 스크롤 했을 때 나타나는 그림자를 없앨 수 있다. scroll 방향과 shrinkWrap을 넣어주고.. ListView.separated( separatorBuilder: (BuildContext context, index){ return SizedB.. 2022. 10. 14.
[Flutter/플러터] Riverpod와 StateNotifier에 대해 stateNotifier는 changeNotifier의 업그레이드 버전이라고 볼 수 있다. 그럼 먼저 changeNotifier에 대해 알아보자.. ▶ ChangeNotifier 란? 변경사항을 알리고 싶을 때마다 리스너에게 알림을 제공하는 클래스 notifyListeners() 클래스에 변화가 있을 때 해당 메서드를 호출할 수 있다. ValueNotifier는 단일 값만을 전달하는 ChangeNotifier의 일종이다(오직 하나의 변경된 값만을 전달할 수 있다.) class MyValueNotifier extends ValueNotifier{ //하나의 값만을 갖고 있을 수 있음 int getValue() => value; } class MyChangeNotifier extends ChangeNotif.. 2022. 9. 28.
[Flutter/플러터] Riverpod 장점 및 사용법 getx를 사용하다가 프로젝트의 규모가 점점 더 커질 것 같아서, riverpod를 공부하기로 마음먹었다. getx를 사용했을 때, 코드가 간결해져서 생산성이 높고, global context로 어디에서나 객체 접근이 가능하지만 이것이 나중에는 단점이 될 수도 있다는 생각에 flutter에서 공식으로 밀고있는 provider와 그것의 개선안인 riverpod를 사용할 예정이다.. 일단 본격적으로 riverpod에 대해 알아보자.. Riverpod가 생겨난 배경 ▶ provider의 단점 provider를 사용하다 보면 결국에는 UI 코드와 섞이게 되는 문제를 볼 수 있다. main.dart class MyWidget extends StatelessWidget { @override Widget build(.. 2022. 9. 28.
[Flutter/플러터] Riverpod를 통해 알아보는 플러터 아키텍처 - (2) Domain Model 2편은 Domain Model에 관한 것이다. 원글은 .. https://codewithandrea.com/articles/flutter-app-architecture-domain-model/ Flutter App Architecture: The Domain Model An introduction to the domain model and its role in defining entities and the business logic for manipulating them in the context of Flutter app architecture. codewithandrea.com Domain-Driven Design(DDD)에서 중요한 것은 model 이다. 좋은 도메인 모델을 갖고 있는 지의 여부는 .. 2022. 9. 27.
728x90
반응형