Skip to content

1.1.1 release #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Jan 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
8c3c931
Prepare Release: fix dart codes with formatter rules
note11g Jan 2, 2024
9fa9ac3
Chore: Update README.md
note11g Jan 2, 2024
a3bd32b
Release: 1.1.0+1 (README & Formatting Changed)
note11g Jan 2, 2024
a7232e4
Update: README.md (correct Image Button Size)
note11g Jan 4, 2024
097616d
Improve: NOverlayImage.fromWidget delete Image Widget support.
note11g Jan 4, 2024
83c7adb
Fix: #56
note11g Jan 4, 2024
59a5d2d
Remove: Unnecessary Example App code (because #56 issue resolved)
note11g Jan 4, 2024
869466c
Fix: Change to using correct Context with ContextWrapper provided fro…
note11g Jan 4, 2024
78457b5
Add: takeSnapshot example
note11g Jan 4, 2024
8842b98
Add: controller.pickAll example
note11g Jan 4, 2024
4297101
Fix: controller.pickAll example unbound height issue
note11g Jan 4, 2024
6bcff30
Merge PR #151 (fix #56)
note11g Jan 5, 2024
69a1e01
Prepare Release: Update pubspec.yaml, README.md, CHANGELOG.md
note11g Jan 5, 2024
0dadb7b
Fix: Change to using correct Context with ContextWrapper provided fro…
note11g Jan 4, 2024
b618b6c
Merge remote-tracking branch 'origin/fix/#135' into fix/#135
note11g Jan 5, 2024
c25d0d3
Fix: #135, Change API 23~29 RenderView to TextureView
note11g Jan 5, 2024
9608ff1
Fix: #135, Change SDK 23~29 Platform View Display Mode to TLHC Mode.
note11g Jan 5, 2024
2015110
Merge PR #153 (fix #135)
note11g Jan 5, 2024
97b7c03
Prepare Release: Update CHANGELOG.md
note11g Jan 5, 2024
d57fd1b
Prepare Release: fix dart codes with formatter rules
note11g Jan 5, 2024
c952a7c
Add: Improve And All Impl Example
note11g Jan 6, 2024
1cb4b88
Add: Partially Impl Overlay Tapped on Example Page
note11g Jan 6, 2024
e0883d7
Merge PR #155 (Improve Examples)
note11g Jan 6, 2024
dd28a64
Add: Add Test Code for #154
note11g Jan 6, 2024
719b989
Fix: Fix #154 on Android Platform
note11g Jan 6, 2024
47fa80b
Fix: Fix #154 on iOS Platform
note11g Jan 6, 2024
317dcdb
Update: update CHANGELOG.md
note11g Jan 6, 2024
9db9d1b
Merge PR #156 (fix #154)
note11g Jan 6, 2024
34d369e
Update: update CHANGELOG.md
note11g Jan 6, 2024
a3ec523
Fix: fix Example Page BottomDrawer overflow issue.
note11g Jan 6, 2024
ec43e37
Prepare Release: fix dart codes with formatter rules
note11g Jan 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## 1.1.1

### Improve
- [All Platform] Improve: NOverlayImage.fromWidget delete Image Widget support with assertion.
- [Example] Improve: All Examples Improve

### Fix
- [All Platform] Fix: InfoWindow.onMarker not attached successfully (issue: [#154](https://github.com/note11g/flutter_naver_map/issues/154), PR: [#156](https://github.com/note11g/flutter_naver_map/pull/156))
- [Android] Fix: black screen caused by flutter 3.16.0~ & android 6.0~9.0 (SDK 23~28) (issue: [#135](https://github.com/note11g/flutter_naver_map/issues/135), PR: [#153](https://github.com/note11g/flutter_naver_map/pull/153))
- [Android] Fix: MapWidget ignore navigator stack issue android 6.0~13.0 (SDK 23~33) (issue: [#56](https://github.com/note11g/flutter_naver_map/issues/56), Temp Fix PR: [#151](https://github.com/note11g/flutter_naver_map/pull/151))

## 1.1.0+1
- Update Readme & Apply Dart formatting

## 1.1.0
### Improve
- [All Platform] Add method `controller.forceRefresh` & Update Naver Map SDK version to 3.17.0 (issue: [#116](https://github.com/note11g/flutter_naver_map/issues/116), PR: [#139](https://github.com/note11g/flutter_naver_map/pull/139))
Expand Down
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,29 @@
[![pub package](https://img.shields.io/pub/v/flutter_naver_map.svg?color=4285F4)](https://pub.dev/packages/flutter_naver_map)
[![github](https://img.shields.io/github/stars/note11g/flutter_naver_map)](https://github.com/note11g/flutter_naver_map)

<a href="https://note11.dev/flutter_naver_map" alt="go to documentation page"><img style="width: 796px;" src="https://github.com/note11g/flutter_naver_map/assets/67783062/25a93cad-f372-4f07-a975-9b9b40c7846b"/></a>
<a href="https://note11.dev/flutter_naver_map" alt="go to documentation page"><img src="https://github.com/note11g/flutter_naver_map/assets/67783062/82e86cd1-7011-490d-bdc1-c6ef6312e83f"/></a>

<a href="https://note11.dev/flutter_naver_map" alt="go to documentation page"><img style="height: 50px;" src="https://github.com/note11g/flutter_naver_map/assets/67783062/e505e9c2-9973-4939-8d27-8874387091da"/></a>
<a href="https://github.com/note11g/flutter_naver_map/issues" alt="go to github issue page"><img style="height: 50px;" src="https://github.com/note11g/flutter_naver_map/assets/67783062/9a2d53f9-fb08-4ad2-bdeb-bdad23b3ede3"/></a>
<a href="https://github.com/users/note11g/projects/2/views/2" alt="go to issue tracker page"><img style="height: 50px;" src="https://github.com/note11g/flutter_naver_map/assets/67783062/6b110546-0c45-4f25-86d5-b86007d1a95b"/></a>

## Known issues
<a href="https://note11.dev/flutter_naver_map" alt="go to documentation page"><img src="https://github.com/note11g/flutter_naver_map/assets/67783062/f3c9c433-0a45-4d35-95b6-3baf753878e0"/></a><a href="https://github.com/note11g/flutter_naver_map/issues" alt="go to github issue page"><img src="https://github.com/note11g/flutter_naver_map/assets/67783062/89efa17d-bf96-413d-b910-0f38e9c36c3f"/></a><a href="https://github.com/users/note11g/projects/2/views/2" alt="go to issue tracker page"><img src="https://github.com/note11g/flutter_naver_map/assets/67783062/4bb00306-85e6-4e4d-9329-6129d6f344f6"/></a>

## Version Up Guide
`1.1.1` 이상으로 업그레이드 할 경우, 해당 코드를 다음과 같이 지워주세요.<br>(편의상 주석처리로 표시해두었지만, 그냥 지워주세요)

[관련 이슈](https://github.com/note11g/flutter_naver_map/issues/56)가 해결되어, 더 이상 필요하지 않습니다.

### Android Platform
- Impeller Engine 지원 안함 (Android 기본 값은 Skia) [#133](https://github.com/note11g/flutter_naver_map/issues/133)
- **[WIP]** flutter 3.16 버전부터 Android 9.0(SDK 28) 이하 작동 오류 [#135](https://github.com/note11g/flutter_naver_map/issues/135) ([임시 해결 PR #148](https://github.com/note11g/flutter_naver_map/pull/148))
- **[WIP]** native_splash_screen 패키지 동시 사용 지원 안함 [#56](https://github.com/note11g/flutter_naver_map/issues/56)
```kotlin
// android/app/main/.../MainActivity.kt
class MainActivity : FlutterActivity() // {
// override fun onCreate(savedInstanceState: Bundle?) {
// intent.putExtra("background_mode", "transparent")
// super.onCreate(savedInstanceState)
// }
// }
```

## Known issues

- Android Impeller Engine 지원 안함 (Android 기본 값은 Skia) [#133](https://github.com/note11g/flutter_naver_map/issues/133)

이슈 제보는 언제나 환영입니다:)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.note11.flutter_naver_map.flutter_naver_map

import android.app.Activity
import android.content.Context
import dev.note11.flutter_naver_map.flutter_naver_map.sdk.SdkInitializer
import dev.note11.flutter_naver_map.flutter_naver_map.view.NaverMapViewFactory
Expand Down Expand Up @@ -28,14 +29,19 @@ internal class FlutterNaverMapPlugin : FlutterPlugin, ActivityAware {
override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) = Unit

override fun onAttachedToActivity(binding: ActivityPluginBinding) {
val activity = binding.activity
val naverMapViewFactory =
NaverMapViewFactory(binding.activity, pluginBinding.binaryMessenger)
NaverMapViewFactory(activity, pluginBinding.binaryMessenger)
correctDisplayOnFlutterNavigatorStackWithActivityBackgroundMode(activity)
pluginBinding.platformViewRegistry.registerViewFactory(
MAP_VIEW_TYPE_ID,
naverMapViewFactory
MAP_VIEW_TYPE_ID, naverMapViewFactory
)
}

private fun correctDisplayOnFlutterNavigatorStackWithActivityBackgroundMode(activity: Activity) {
activity.intent.putExtra("background_mode", "transparent")
}

override fun onDetachedFromActivityForConfigChanges() = Unit

override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) = Unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ internal class OverlayController(
success: (Any?) -> Unit,
) {
val nInfoWindow = NInfoWindow.fromMessageable(rawInfoWindow, context = context)
.apply { setCommonProperties(rawInfoWindow.asMap()) }
val infoWindow = saveOverlayWithAddable(creator = nInfoWindow)

val align = rawAlign.asAlign()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal abstract class AddableOverlay<T : Overlay> {

private lateinit var commonProperties: Map<String, Any>

private fun setCommonProperties(rawArgs: Map<String, Any>) {
fun setCommonProperties(rawArgs: Map<String, Any>) {
commonProperties = rawArgs.filter { OverlayHandler.allPropertyNames.contains(it.key) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal class SdkInitializer(
try {
if (clientId != null) initializeMapSdk(context, clientId, isGov)
if (setAuthFailedListener) setOnAuthFailedListener()
val sendPayload = mapOf("androidSdkVersion" to androidSdkVersion)
val sendPayload = mapOf("androidSdkVersion" to Build.VERSION.SDK_INT)
onSuccess(sendPayload)
} catch (e: NaverMapSdk.AuthFailedException) {
onFailure(e)
Expand All @@ -63,8 +63,4 @@ internal class SdkInitializer(
)
)
}

companion object {
private val androidSdkVersion: Int get() = Build.VERSION.SDK_INT
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package dev.note11.flutter_naver_map.flutter_naver_map.view
import android.app.Activity
import android.app.Application
import android.content.ComponentCallbacks
import android.content.Context
import android.content.res.Configuration
import android.os.Build
import android.os.Bundle
import android.view.View
import com.naver.maps.map.MapView
Expand All @@ -21,20 +23,24 @@ import io.flutter.plugin.platform.PlatformView

internal class NaverMapView(
private val activity: Activity,
private val flutterProvidedContext: Context,
private val naverMapViewOptions: NaverMapViewOptions,
private val channel: MethodChannel,
private val overlayController: OverlayHandler,
) : PlatformView, Application.ActivityLifecycleCallbacks, ComponentCallbacks {

private lateinit var naverMap: NaverMap
private lateinit var naverMapControlSender: NaverMapControlSender
private val mapView = MapView(activity, naverMapViewOptions.naverMapOptions).apply {
setTempMethodCallHandler()
getMapAsync { naverMap ->
[email protected] = naverMap
onMapReady()
private val mapView =
MapView(flutterProvidedContext, naverMapViewOptions.naverMapOptions.apply {
useTextureView(Build.VERSION.SDK_INT <= 29)
}).apply {
setTempMethodCallHandler()
getMapAsync { naverMap ->
[email protected] = naverMap
onMapReady()
}
}
}
private var isListenerRegistered = false
private var rawNaverMapOptionTempCache: Any? = null

Expand All @@ -60,7 +66,7 @@ internal class NaverMapView(

private fun initializeMapController() {
naverMapControlSender = NaverMapController(
naverMap, channel, activity.applicationContext, overlayController
naverMap, channel, flutterProvidedContext, overlayController
).apply {
rawNaverMapOptionTempCache?.let { updateOptions(it.asMap()) {} }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ internal class NaverMapViewFactory(

return NaverMapView(
activity = activity,
flutterProvidedContext = context,
naverMapViewOptions = options,
channel = channel,
overlayController = overlayController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,4 @@ package dev.note11.flutter_naver_map.flutter_naver_map_example
import android.os.Bundle
import io.flutter.embedding.android.FlutterActivity

class MainActivity : FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
intent.putExtra("background_mode", "transparent")
super.onCreate(savedInstanceState)
}
}
class MainActivity : FlutterActivity() {}
37 changes: 37 additions & 0 deletions example/integration_test/overlay_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,42 @@ void main() {
marker.setAlpha(0.8);
expect(marker.alpha, 0.8);
});

/// #154 issue test (https://github.com/note11g/flutter_naver_map/issues/154)
testNaverMap("NInfoWindow.onMarker test", (controller, tester) async {
final cameraTarget =
await controller.getCameraPosition().then((cp) => cp.target);
final marker = NMarker(id: "1", position: cameraTarget);
await controller.addOverlay(marker);
final infoWindow =
NInfoWindow.onMarker(id: "2", text: "infowindow", offsetX: 0.1)
..setMinZoom(13);
await marker.openInfoWindow(infoWindow);
expect(infoWindow.offsetX, 0.1);
expect(infoWindow.minZoom, 13);

await Future.delayed(const Duration(milliseconds: 200));
final screenTarget =
await controller.latLngToScreenLocation(cameraTarget);

Future<List<NOverlayInfo>> pickNOverlayInfo() {
return controller
.pickAll(screenTarget, radius: 800)
.then((pickable) => pickable.whereType<NOverlayInfo>().toList());
}

final pickedInfoListByDefaultZoom = await pickNOverlayInfo();
print(pickedInfoListByDefaultZoom);
expect(pickedInfoListByDefaultZoom.contains(infoWindow.info), true);

await controller.updateCamera(NCameraUpdate.scrollAndZoomTo(zoom: 12)
..setAnimation(duration: Duration.zero));

await Future.delayed(const Duration(milliseconds: 200));

final pickedInfoListWhenZoomOut = await pickNOverlayInfo();
print(pickedInfoListWhenZoomOut);
expect(pickedInfoListWhenZoomOut.contains(infoWindow.info), false);
});
});
}
93 changes: 69 additions & 24 deletions example/lib/design/custom_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,7 @@ class BottomPadding extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Padding(
padding:
EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom));
padding: EdgeInsets.only(bottom: MediaQuery.paddingOf(context).bottom));
}
}

Expand Down Expand Up @@ -571,23 +570,25 @@ class _BalloonPainter extends CustomPainter {
}

class HalfActionButton extends StatelessWidget {
final Function() action;
final Function()? action;
final IconData icon;
final Color? color;
final String title;
final String description;

const HalfActionButton({
super.key,
required this.action,
required this.icon,
this.color,
required this.title,
required this.description,
});

@override
Widget build(BuildContext context) {
return Material(
color: getColorTheme(context).outlineVariant,
color: color ?? getColorTheme(context).outline,
borderRadius: BorderRadius.circular(12),
clipBehavior: Clip.antiAlias,
child: InkWell(
Expand All @@ -596,28 +597,24 @@ class HalfActionButton extends StatelessWidget {
padding:
const EdgeInsets.symmetric(vertical: 12, horizontal: 12),
child: Row(children: [
Icon(icon,
color: getColorTheme(context).primary, size: 22),
Icon(icon, color: getColorTheme(context).primary, size: 22),
const SizedBox(width: 10),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(title,
style: getTextTheme(context)
.labelMedium
?.copyWith(color: Colors.black),
overflow: TextOverflow.fade,
softWrap: false,
maxLines: 1),
const SizedBox(height: 2),
Text(description,
style: getTextTheme(context).bodySmall,
overflow: TextOverflow.fade,
softWrap: false,
maxLines: 1),
]),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(title,
style: getTextTheme(context).labelMedium,
overflow: TextOverflow.fade,
softWrap: false,
maxLines: 1),
const SizedBox(height: 2),
Text(description,
style: getTextTheme(context).bodySmall,
overflow: TextOverflow.fade,
softWrap: false,
maxLines: 1),
])),
]))));
}
}
Expand Down Expand Up @@ -654,3 +651,51 @@ class HalfActionButtonGrid extends StatelessWidget {
return Column(children: rowCellAndGapWidgets);
}
}

class SmallButton extends StatelessWidget {
final String text;
final VoidCallback onTap;
final Color? color;
final Color? textColor;
final IconData? icon;
final double radius;

const SmallButton(
this.text, {
super.key,
required this.onTap,
this.color,
this.textColor,
this.icon,
this.radius = 6,
});

BorderRadius get borderRadius => BorderRadius.circular(radius);

@override
Widget build(BuildContext context) {
return Material(
color: color ?? getColorTheme(context).secondary,
borderRadius: borderRadius,
child: InkWell(
onTap: onTap,
borderRadius: borderRadius,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
if (icon != null)
Padding(
padding: const EdgeInsets.only(right: 4),
child: Icon(icon,
color: textColor ?? Colors.white, size: 16),
),
Text(text,
style: getTextTheme(context)
.labelSmall
?.copyWith(color: textColor)),
]))));
}
}
Loading