본문 바로가기
반응형

flutter64

[flutter][firebase] How to sort data from snapshot taken from DB (DB에서 가져온 snapshot에서 데이터 정렬하는 방법) [flutter][firebase] How to sort data from snapshot taken from DB (DB에서 가져온 snapshot에서 데이터 정렬하는 방법) 앱을 만들때 firebase에서 데이터를 갖고 오고 싶다면 보통 FirebaseFirestore에서 인스턴스를 가져와 컬렉션, 도큐먼트에 접근한다. 이때 특정한 애트리뷰트에 대해 정렬하고 싶다면? 아래와 같이 orderBy를 사용하자. (If you want to get data from firebase when creating an app I usually get the instance from FirebaseFirestore Access to collections and documents. What if you want to .. 2021. 11. 4.
[flutter] String을 Uri로 변환하는법. string to uri [flutter] String을 Uri로 변환하는법. string to uri var uri = Uri.parse('https://example.org:8080/foo/bar#frag'); Uri.parse를 이용한다. 2021. 11. 3.
[flutter][firebase] [core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp() 오류 해결방법 [flutter][firebase] [core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp() 오류 해결방법 void main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); 위 코드를 적용하자. firebase를 사용하기전에 위 코드처럼 초기화 작업을 진행해주어야한다. 필자는 firebase관련 플러그인들의 버전을 업그레이드하다가 발생하여 이와 같이 해결함. https://stackoverflow.com/questions/67429742/error-core-no-app-no-firebase-app-.. 2021. 11. 2.
[Flutter][Dart] Increasing/Down/Round Decimal, Fixing the length of the decimal point string (소수점 올림/내림/반올림, 문자열의 소수점 길이 고정) [Flutter][Dart] Increasing/Down/Round Decimal, Fixing the length of the decimal point string [플러터][다트] 소수점 올림/내림/반올림, 문자열의 소수점 길이 고정 소수점(double형) 값을 가공하고 처리할 때 특정 소수점 자리수에서 잘라내고 싶을 때가 있습니다. 이 때 참고하기 위해 간략히 정리하겠습니다. 아래 예시는 store라는 클래스 인스턴스가 있고, 이 인스턴스의 rating을 현재 유저의 상호작용으로 인해 추가된 평가를 업데이트하고자 하는 상황입니다. 평점이 4.333333333... 처럼 길어지면 가독성이 떨어지겠지요. 그 때문에 소수점을 올리거나 내리거나 반올림하는 것이 좋아보입니다. (When processing .. 2021. 11. 1.
반응형