본문 바로가기
728x90

전체 글551

In flutter, Making 2 page with 1 GetXController If you make the App like instagram. sometimes you would like to 2 page with 1 GetXController. For example, A profilePage -> follower List page -> B profilePage in this time A profilePage and B profilePage are made in same page (Profile page) and same controller . the solution is here. https://stackoverflow.com/questions/69018689/flutter-getx-how-navigate-to-different-views-with-same-controller-c.. 2022. 9. 6.
Flutter에서 지네릭 메서드 만들기 Future matjipLike( {required MatjipModel matjipModel, required UserModel userModel, required T model, required bool like //true -> like, false unlike }) async { 지네릭을 메서드를 이해하고 사용은 해왔지만, 실제로 지네릭 메서드를 만들어서 사용해 본 적은 없었다. 그런데 코딩을 할수록, 함수의 재사용성을 고려해볼 때 지네릭을 사용해서 메서드를 만들면 훨씬 재사용성이 늘 것 같은 생각에, 만들어보기로 했다. 코드가 훨씬 줄어들 것이라고 예상하고 있다 https://stackoverflow.com/questions/42004475/how-to-create-a-generic-method.. 2022. 9. 2.
static 변수만 사용하고 constructor 쓸 필요 없는 class class AppColor { AppColor._(); static const Color notWhite = Color(0xFFEDF0F2); static const Color nearlyWhite = Color(0xFFFEFEFE); static const Color white = Color(0xFFFFFFFF); static const Color nearlyBlack = Color(0xFF213333); } https://velog.io/@vkdl370528/Dart-Private-Contructor에-관하여 [Dart] Private Contructor에 관하여 Dart, Flutter - Private Constructor velog.io 2022. 9. 1.
IntrinsicHeight , IntrinsicWidth IntrinsicHeight 위젯은 child인 Row가 crossAxisAlignment가 stretch일때, 높이의 범위를 Row의 하위 위젯 중 가장 높은 것에 맞추어 준다. 중요한 건 Column이나 Row를 자식으로 해야한다. 사용해야하는 이유는 각각의 위젯의 사이즈를 모르면, align을 맞추기가 어렵기 떄문이다 (특히 .end 나 .center로) 그러므로 각각의 위젯의 사이즈를 가장 큰 것으로 통일한다면 해결이 원활하다. 다음 예제를 보면 감이 좀 올 것이다 https://www.woolha.com/tutorials/flutter-using-intrinsicwidth-widget-examples Flutter - Using IntrinsicWidth Widget Examples Exampl.. 2022. 8. 29.
728x90