본문 바로가기
728x90

개발458

지도에 해당 지점이 어떤 지역 안에 있는 지 판별하기 https://pub.dev/packages/maps_toolkit PolygonUtil.containsLocation - computes whether the given point lies inside the specified polygon. maps_toolkit | Dart Package Maps toolkit - geo-measurements utils - area of polygon, distance between point, heading and offset between points (port of SphericalUtil, PolyUtil from `android-maps-utils`). pub.dev 까먹을까봐 결론부터 적어놓고, logger.d('myLocation -> $myLocat.. 2022. 12. 22.
How to query flutter hive data ? List matjipList({String? queryText}) { if (_matjipBox == null) { logger.e('박스 생성 실패'); return []; } else { if (queryText == null) { return _matjipBox!.values.toList(); } else { Set resultSet = {}; resultSet.addAll(_matjipBox!.values.where((element) => element.description?.contains(queryText) ?? false)); resultSet.addAll(_matjipBox!.values.where((element) => element.name.contains(queryText))); re.. 2022. 12. 17.
dart 2차 정렬하기 (twice ordering) https://stackoverflow.com/questions/55920677/how-to-sort-a-list-based-on-two-values How to sort a list based on two values I have a list in which I want to sort based on two values date and the status like this: pollsList.sort((a, b) => b.active.compareTo(a.active)); pollsList.sort((a, b) { return b. stackoverflow.com pollsList.sort((a, b) { int cmp = b.actualStartDatetime.compareTo(a.actualStar.. 2022. 12. 16.
how to compare boolean value? This is simple algorithm for compare with boolean value! matjipList.sort((a, b) => (a.visited? 1:0).compareTo(b.visited? 1:0)); 2022. 12. 16.
728x90