반응형 Flutter7 [Flutter] WorkManager를 활용하여 백그라운드 api 통신하기 서비스를 운영하면서 의문이 생겼다. 용량이 큰 파일을 서버에 전송하는 도중 네트워크 통신이 끊긴다면 어떡하지? 유저가 기다리는 동안 못참고 앱이 dispose 상태로 간다면? 그러고서 들어왔을 때 업로드 안되어있으면 화내지 않을까? 그렇다면, 백그라운드에서 api 통신을 하면 좀 안정적이지 않을까? 라는 생각으로 개발하게 되었다. ----------------------- workmanager: ^0.5.1 우선 워크매니저를 pubspec에 등록해준다. 그리고 WorkManager로 무언가 백그라운드 작업을 수행하고 싶을 땐 최상단 루트에 있어야한다고 해서 main에서 사용하기로 했다. await Workmanager().initialize( callbackDispatcher, // The top lev.. 2023. 8. 16. flutter Google Map Marker에 이미지 파일 추가하기 출시하려는 앱 UT를 마치고, 시간이 남아서 오랜만에 글을 쓴다. 블로그에 어려운내용을 안올리게 되는게 너무너무 글쓰기가 귀찮다.. 구글맵을 띄우고, 마커 Stream 까지 다등록햇다는 가정하에 글을 씁니다. (인터넷에 플러터 구글맵 마커 이런식으로 쳐도 이 과정까진 다 나올겁니다.) final Uint8List markerIcon = await _getBytesFromCanvas(feature); BitmapDescriptor bitmapDescriptor = BitmapDescriptor.fromBytes(markerIcon); Marker marker = Marker( markerId: MarkerId(feature.markerId!), position: LatLng(feature.latitude!.. 2022. 7. 31. Could not find a file named "pubspec.yaml" When get from GitHub in Flutter flutter에서 github에 있는 플러그인, 혹은 포크한 repository를 가져올때 이 오류를 볼 수 있다. 해결법은 간단하다 1. .pub-cache가 있는 폴더로 가서 cache되어있는 플러그인을 제거한다. 여기서 해결이 되면 좋겠지만 내경우는 다른 FileName too long이라는 오류가 함께 딸려왔었다. 이것은 gitconfig에 글자수 제한이 되어있기 때문이다. 2. cmd를 관리자모드로 실행해주자. 그리고 git config --system core.longpaths true를 입력해주자 끝 2022. 6. 8. Flutter Text 글자 수가 너무 길어져서 OverFlow가 난다면? Text Widget에는 overFlow라는 속성이있다. 한번 살펴보자. /// How overflowing text should be handled. /// /// A [TextOverflow] can be passed to [Text] and [RichText] via their /// [Text.overflow] and [RichText.overflow] properties respectively. enum TextOverflow { /// Clip the overflowing text to fix its container. clip, /// Fade the overflowing text to transparent. fade, /// Use an ellipsis to indicate that the.. 2022. 5. 1. 이전 1 2 다음 반응형