본문 바로가기
728x90

Flutter80

ChatGpt 사용해서 flutter dart 코딩하기 질문 In flutter, horizontal listview, which when I click most left circle button, the other 5 buttons will be appear with 0.5 second animation and when I click the other buttons, the most left circle button will be change to clicked button. The other buttons is circle and indicate 5 colors. 답: import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidg.. 2023. 2. 4.
Map 에서 flutter dotdotdot 사용하기 맵에서 어떤 요소를 추가할 때 이런식으로 추가하면 된다. list에 요소 추가하는 건 흔한데 map에 추가 가능한 것도 메모해놓고 싶었음! 2023. 1. 24.
sublist 오류 막기 import 'dart:math'; void main() { var a = [1,2,3,4,5,6]; var c = [1]; var b= a.sublist(0,2); var d= c.sublist(0,2); 다음과 같은 식은 오류가 발생한다. 왜냐? c는 2보다 작은 데 사이즈를 2크기로 잘라서 그렇다. 그렇다면, 해결해주려면 어떻게 해야할까? 이렇게 해결해 줄 수 있다! var d= c.sublist(0,min(2, 0)); 2022. 12. 30.
Rx null 사용 하는 법, RxList, RxSet Rx는 null 을 사용하지 말라는 권고가 있다. 그런데 null 을 사용해야하면 어떻게 하느냐 Rxn을 사용해보자! final Rxn _moimModel = Rxn(); MoimModel? get moimModel => _moimModel.value; 이렇게 하면 된다. 리스트 사용하는 방법, Set을 사용하는 방법 final RxList _placeList = RxList(); List get placeList => _placeList; final RxSet _collectionModelOnShelf = RxSet(); Set get collectionModelOnShelf => _collectionModelOnShelf; 2022. 12. 29.
728x90