Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions example/lib/base_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ class _BaseMapPageState extends State<BaseMapPage> {
));
}

_onSymbolTap(LatLng position, String caption) {
_onSymbolTap(LatLng? position, String? caption) {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(
'[onSymbolTap] caption: $caption, lat: ${position.latitude}, lon: ${position.longitude}'),
'[onSymbolTap] caption: $caption, lat: ${position?.latitude}, lon: ${position?.longitude}'),
duration: Duration(milliseconds: 500),
backgroundColor: Colors.black,
));
Expand Down Expand Up @@ -203,8 +203,8 @@ class _BaseMapPageState extends State<BaseMapPage> {
// }

void _onCameraChange(
LatLng latLng, CameraChangeReason reason, bool isAnimated) {
print('카메라 움직임 >>> 위치 : ${latLng.latitude}, ${latLng.longitude}'
LatLng? latLng, CameraChangeReason reason, bool? isAnimated) {
print('카메라 움직임 >>> 위치 : ${latLng?.latitude}, ${latLng?.longitude}'
'\n원인: $reason'
'\n에니메이션 여부: $isAnimated');
}
Expand Down
2 changes: 1 addition & 1 deletion example/lib/circle_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class _CircleMapPageState extends State<CircleMapPage> {
List<CircleOverlay> _circles = [];
double _sliderValue = 40.0;

int _selectedCircleIndex;
late int _selectedCircleIndex;

@override
Widget build(BuildContext context) {
Expand Down
8 changes: 4 additions & 4 deletions example/lib/marker_map_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class _MarkerMapPageState extends State<MarkerMapPage> {

@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) {
WidgetsBinding.instance!.addPostFrameCallback((_) {
OverlayImage.fromAssetImage(
assetName: 'icon/marker.png',
).then((image) {
Expand Down Expand Up @@ -173,14 +173,14 @@ class _MarkerMapPageState extends State<MarkerMapPage> {
}
}

void _onMarkerTap(Marker marker, Map<String, int> iconSize) {
int pos = _markers.indexWhere((m) => m.markerId == marker.markerId);
void _onMarkerTap(Marker? marker, Map<String, int?> iconSize) {
int pos = _markers.indexWhere((m) => m.markerId == marker?.markerId);
setState(() {
_markers[pos].captionText = '선택됨';
});
if (_currentMode == MODE_REMOVE) {
setState(() {
_markers.removeWhere((m) => m.markerId == marker.markerId);
_markers.removeWhere((m) => m.markerId == marker?.markerId);
});
}
}
Expand Down
6 changes: 3 additions & 3 deletions example/lib/path_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ class _PathMapPageState extends State<PathMapPage> {
}
}

void _onMarkerTap(Marker marker, Map<String, int> iconSize) {
void _onMarkerTap(Marker? marker, Map<String, int?> iconSize) {
if (_currentMode == MODE_REMOVE && _coordinates.length > 2) {
setState(() {
_coordinates.remove(marker.position);
_markers.removeWhere((m) => m.markerId == marker.markerId);
_coordinates.remove(marker?.position);
_markers.removeWhere((m) => m.markerId == marker?.markerId);
});
}
}
Expand Down
8 changes: 4 additions & 4 deletions example/lib/polygon_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ class _PolygonMapState extends State<PolygonMap>
bool _isAdding = false;

Completer<NaverMapController> _controller = Completer();
AnimationController _animationController;
Animation _colorTwin;
Animation _rotation;
late AnimationController _animationController;
late Animation _colorTwin;
late Animation<double> _rotation;

List<Marker> _markers = [];
List<PolygonOverlay> _polygon = [];
Expand Down Expand Up @@ -165,7 +165,7 @@ class _PolygonMapState extends State<PolygonMap>
if (_markers.length >= 3) {
_polygon.add(PolygonOverlay(
DateTime.now().millisecondsSinceEpoch.toString(),
_markers.map((e) => e.position).toList(),
_markers.map((e) => e.position!).toList(),
color: Colors.transparent,
outlineWidth: 3,
outlineColor: Colors.redAccent,
Expand Down
38 changes: 19 additions & 19 deletions example/lib/text_field_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@ class _TextFieldPageState extends State<TextFieldPage> {
}

_mapView() => NaverMap(
useSurface: kReleaseMode,
initLocationTrackingMode: LocationTrackingMode.Follow,
);
useSurface: kReleaseMode,
initLocationTrackingMode: LocationTrackingMode.Follow,
);

_textFieldView() => Align(
alignment: Alignment.topCenter,
child: SafeArea(
bottom: false,
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(50),
alignment: Alignment.topCenter,
child: SafeArea(
bottom: false,
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(50),
),
margin: EdgeInsets.all(24),
padding: EdgeInsets.symmetric(horizontal: 24, vertical: 8),
child: TextField(
decoration: InputDecoration.collapsed(hintText: ''),
maxLines: 1,
),
),
),
margin: EdgeInsets.all(24),
padding: EdgeInsets.symmetric(horizontal: 24, vertical: 8),
child: TextField(
decoration: InputDecoration.collapsed(hintText: ''),
maxLines: 1,
),
),
),
);
);
}