flutter
-
fcm/백그라운드/터미네이트flutter 2023. 2. 22. 14:59
https://developer.android.com/guide/background?hl=ko 백그라운드 처리 가이드 | Android 개발자 | Android Developers 백그라운드 처리 가이드 컬렉션을 사용해 정리하기 내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요. 백그라운드 데이터 처리는 사용자의 기대에 부응하고 사용자에게 도움이 되는 Androi developer.android.com https://www.google.com/search?q=flutter+%EB%B0%B1%EA%B7%B8%EB%9D%BC%EC%9A%B4%EB%93%9C+%EC%95%8C%EB%A6%BC&newwindow=1&source=hp&ei=5pz1Y8KbMt6i2roPi92vqAU&iflsig=AK50M_UAA..
-
disposable classflutter 2022. 10. 23. 20:51
공식레퍼런스 https://pub.dev/documentation/w_common/latest/disposable/Disposable-class.html Disposable class - disposable library - Dart API Disposable class Allows the creation of managed objects, including helpers for common patterns. We recommend consuming this class in one of two ways. As a base class As a concrete proxy We do not recommend using this class as a mixin or as an interface. Us pub.de..
-
FirebaseAuth.instance.authStateChangesflutter 2022. 9. 21. 18:17
파베 auth를 쓸때 FirebaseAuth.instance.authStateChanges() 가 반환하는 User? 객체를 listen 하다 user가 null이냐의 여부로 로긴 이벤트를 트리거 시켜놨는데.. 똑같은 사용자를 두번 리슨하는 이슈가발생.. (불필요하게 구독이 두번 발생하면 의도하지않은 사이드이펙트가 발생할수있음) 리스너가 등록될때, user상태가 변경될때 등등 listen이 작동한다고하는데.. 해쉬코드를 보면 두번 리슨될때마다 메모리 주소가 다르다 동일한 문제를 겪는 외국인들의 문답 https://github.com/firebase/flutterfire/issues/3628 🐛 [firebase_auth] FirebaseAuth.instance.userChanges fires twice ..
-
BehaviorSubject close 이슈 Bad state: Cannot add new events after calling closeflutter 2022. 5. 13. 00:38
Bad state: Cannot add new events after calling close 관련 BehaviorSubject close 하면 객체가 폐기된다. 그래서 다음에 또 사용하려면 이벤트 추가를 할수가없음 그래서 참조값을 late 로 선언만 해놓고 사용하는 페이지에서 초기화해주고, dispose에서 close해주는게 좋다. class MyBloc { final _data = BehaviorSubject(); void fetchData() { // get your data from wherever it is located _data.safeValue = 'Safe to add data'; } void dispose() { _data.close(); } } -> MyBloc 사용할때 초기화되고, ..
-
bloc 7.2버전부터 바뀐 이벤트 처리flutter 2021. 12. 10. 19:52
flutter_bloc 7.2부터 @override Stream > transformEvents(events, transitionFn) { return super.transformEvents( events.distinct(), transitionFn, ); 함수의 지원이 되지 않습니다. 이전버전에서 Deprecated 표기가 되고, **@Deprecated - Use on with an EventTransformer instead. Will be removed in v8.0.0** 라는 팝업이 뜹니다. transformEvent 를 사용하지말고 핸들링할 이벤트를 on 와 EventTransformer를 함께 사용하라고 합니다. 최근에 flutter_bloc 8.0으로 업그레이드 했는데, mapEventT..
-
[메모/스크랩] map 함수flutter 2021. 12. 10. 15:42
https://devmg.tistory.com/184 [Flutter/Drat]다트 유용한 메소드 Method 함수 Function 정리~ Dart에서는 iterable이라는 개념이 있다. 이것은 반복이 가능한 그룹을 뜻하고 iterable? A collection of values, or "elements", that can be accessed sequentially. list나 array, 등을 의미한다. Map은 순서.. devmg.tistory.com https://papabee.tistory.com/43 플러터, flutter & Dart) iterable & .map function & spread operator(...) Dart에서는 iterable이라는 개념이 있다. 이것은 반복이 가능..
-
copyWith 함수flutter 2021. 12. 7. 15:08
사용예제는 이러하다 final ThemeData theme = Theme.of(context); Text("등록", style: theme.textTheme.subtitle1!.copyWith(color: AppColors.primary)) https://developer.school/tutorials/dart-flutter-what-does-copywith-do https://developer.school/tutorials/dart-flutter-what-does-copywith-do developer.school 블로그를 참조하면.. --> 불변성을 사용하면 더 이상 개체에 대한 내부 변경 사항을 추적할 필요가 없으므로 추론하기 쉬운 코드를 만들 수 있습니다. 이것은 원격 소스에서 오는 데이터로 작업..
-
Stream과 Futureflutter 2021. 12. 1. 13:12
특정 값의 카운트를 업데이트해주는 함수와 동시에 연속적으로 다음 calculateVote 함수를 사용해봤다. 이전 함수에서 특정 프로퍼티값을 0에서 1로 트랜잭션 처리에서 업데이트시켜줬고, 새로 갱신된 값이 반영되야하는데 반영이안된다. Future calculateVote(AppVote vote) async { var allvoteItemRef = _db.collection('votes').doc(vote.voteUid).collection('voteItem'); Stream listQs = allvoteItemRef.snapshots(); listQs.forEach((element) async{ element.docs.forEach((docsElement) async { if(docsElement.da..