navigate method

Future navigate({
  1. required Location destination,
  2. NaviOption? option,
  3. List<Location>? viaList,
})

KO: 카카오내비 앱으로 길안내 실행, 모바일 기기에서만 동작
destination에 목적지 전달
option에 경로 검색 옵션 전달
viaList에 경유지 목록 전달(최대: 3개)

EN: Launches the Kakao Navi app to start navigation, available only on the mobile devices
Pass the destination to destination
Pass the options for searching the route to option
Pass the list of stops to viaList (Maximum: 3 places)

Implementation

Future navigate(
    {required Location destination,
    NaviOption? option,
    List<Location>? viaList}) async {
  String naviScheme = _getKakaoNaviScheme();
  final extras = await _getExtras();
  final arguments = {
    Constants.naviScheme: naviScheme,
    Constants.appKey: KakaoSdk.appKey,
    Constants.extras: jsonEncode(extras),
    Constants.naviParams: jsonEncode(
      KakaoNaviParams(
        destination: destination,
        option: option,
        viaList: viaList,
      ),
    )
  };
  await _channel.invokeMethod<bool>(CommonConstants.navigate, arguments);
}