diff --git a/example/lib/base_map.dart b/example/lib/base_map.dart index 17d7162..4301205 100644 --- a/example/lib/base_map.dart +++ b/example/lib/base_map.dart @@ -89,10 +89,10 @@ class _BaseMapPageState extends State { )); } - _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, )); @@ -203,8 +203,8 @@ class _BaseMapPageState extends State { // } 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'); } diff --git a/example/lib/circle_map.dart b/example/lib/circle_map.dart index c3d8981..6f5120c 100644 --- a/example/lib/circle_map.dart +++ b/example/lib/circle_map.dart @@ -14,7 +14,7 @@ class _CircleMapPageState extends State { List _circles = []; double _sliderValue = 40.0; - int _selectedCircleIndex; + late int _selectedCircleIndex; @override Widget build(BuildContext context) { diff --git a/example/lib/marker_map_page.dart b/example/lib/marker_map_page.dart index 58c709b..dcff60e 100644 --- a/example/lib/marker_map_page.dart +++ b/example/lib/marker_map_page.dart @@ -19,7 +19,7 @@ class _MarkerMapPageState extends State { @override void initState() { - WidgetsBinding.instance.addPostFrameCallback((_) { + WidgetsBinding.instance!.addPostFrameCallback((_) { OverlayImage.fromAssetImage( assetName: 'icon/marker.png', ).then((image) { @@ -173,14 +173,14 @@ class _MarkerMapPageState extends State { } } - void _onMarkerTap(Marker marker, Map iconSize) { - int pos = _markers.indexWhere((m) => m.markerId == marker.markerId); + void _onMarkerTap(Marker? marker, Map 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); }); } } diff --git a/example/lib/path_map.dart b/example/lib/path_map.dart index 5fce3a0..b087fca 100644 --- a/example/lib/path_map.dart +++ b/example/lib/path_map.dart @@ -196,11 +196,11 @@ class _PathMapPageState extends State { } } - void _onMarkerTap(Marker marker, Map iconSize) { + void _onMarkerTap(Marker? marker, Map 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); }); } } diff --git a/example/lib/polygon_map.dart b/example/lib/polygon_map.dart index 978e411..b825f72 100644 --- a/example/lib/polygon_map.dart +++ b/example/lib/polygon_map.dart @@ -13,9 +13,9 @@ class _PolygonMapState extends State bool _isAdding = false; Completer _controller = Completer(); - AnimationController _animationController; - Animation _colorTwin; - Animation _rotation; + late AnimationController _animationController; + late Animation _colorTwin; + late Animation _rotation; List _markers = []; List _polygon = []; @@ -165,7 +165,7 @@ class _PolygonMapState extends State 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, diff --git a/example/lib/text_field_page.dart b/example/lib/text_field_page.dart index 9b638ea..b49282b 100644 --- a/example/lib/text_field_page.dart +++ b/example/lib/text_field_page.dart @@ -22,26 +22,26 @@ class _TextFieldPageState extends State { } _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, - ), - ), - ), - ); + ); }