Skip to content

Commit 25edf5a

Browse files
authored
chore: expose NavigationViewCreationApi to fix static analysis for unused elements (#104)
1 parent 19d2491 commit 25edf5a

File tree

4 files changed

+58
-53
lines changed

4 files changed

+58
-53
lines changed

android/src/main/kotlin/com/google/maps/flutter/navigation/messages.g.kt

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,7 @@ data class NavInfoDto(
17751775
}
17761776

17771777
@Suppress("UNCHECKED_CAST")
1778-
private object _NavigationViewCreationApiCodec : StandardMessageCodec() {
1778+
private object NavigationViewCreationApiCodec : StandardMessageCodec() {
17791779
override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? {
17801780
return when (type) {
17811781
128.toByte() -> {
@@ -1832,29 +1832,30 @@ private object _NavigationViewCreationApiCodec : StandardMessageCodec() {
18321832
}
18331833

18341834
/**
1835-
* Pigeon only generates messages if the messages are used in API. [MapOptionsDto] is encoded and
1836-
* decoded directly to generate a PlatformView creation message. This API should never be used
1837-
* directly.
1835+
* Pigeon only generates messages if the messages are used in API. [ViewCreationOptionsDto] is
1836+
* encoded and decoded directly to generate a PlatformView creation message.
1837+
*
1838+
* This API should never be used directly.
18381839
*
18391840
* Generated interface from Pigeon that represents a handler of messages from Flutter.
18401841
*/
1841-
interface _NavigationViewCreationApi {
1842-
fun _create(msg: ViewCreationOptionsDto)
1842+
interface NavigationViewCreationApi {
1843+
fun create(msg: ViewCreationOptionsDto)
18431844

18441845
companion object {
1845-
/** The codec used by _NavigationViewCreationApi. */
1846-
val codec: MessageCodec<Any?> by lazy { _NavigationViewCreationApiCodec }
1846+
/** The codec used by NavigationViewCreationApi. */
1847+
val codec: MessageCodec<Any?> by lazy { NavigationViewCreationApiCodec }
18471848
/**
1848-
* Sets up an instance of `_NavigationViewCreationApi` to handle messages through the
1849+
* Sets up an instance of `NavigationViewCreationApi` to handle messages through the
18491850
* `binaryMessenger`.
18501851
*/
18511852
@Suppress("UNCHECKED_CAST")
1852-
fun setUp(binaryMessenger: BinaryMessenger, api: _NavigationViewCreationApi?) {
1853+
fun setUp(binaryMessenger: BinaryMessenger, api: NavigationViewCreationApi?) {
18531854
run {
18541855
val channel =
18551856
BasicMessageChannel<Any?>(
18561857
binaryMessenger,
1857-
"dev.flutter.pigeon.google_navigation_flutter._NavigationViewCreationApi._create",
1858+
"dev.flutter.pigeon.google_navigation_flutter.NavigationViewCreationApi.create",
18581859
codec
18591860
)
18601861
if (api != null) {
@@ -1863,7 +1864,7 @@ interface _NavigationViewCreationApi {
18631864
val msgArg = args[0] as ViewCreationOptionsDto
18641865
var wrapped: List<Any?>
18651866
try {
1866-
api._create(msgArg)
1867+
api.create(msgArg)
18671868
wrapped = listOf<Any?>(null)
18681869
} catch (exception: Throwable) {
18691870
wrapped = wrapError(exception)

ios/Classes/messages.g.swift

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,7 +1696,7 @@ struct NavInfoDto {
16961696
}
16971697
}
16981698

1699-
private class _NavigationViewCreationApiCodecReader: FlutterStandardReader {
1699+
private class NavigationViewCreationApiCodecReader: FlutterStandardReader {
17001700
override func readValue(ofType type: UInt8) -> Any? {
17011701
switch type {
17021702
case 128:
@@ -1717,7 +1717,7 @@ private class _NavigationViewCreationApiCodecReader: FlutterStandardReader {
17171717
}
17181718
}
17191719

1720-
private class _NavigationViewCreationApiCodecWriter: FlutterStandardWriter {
1720+
private class NavigationViewCreationApiCodecWriter: FlutterStandardWriter {
17211721
override func writeValue(_ value: Any) {
17221722
if let value = value as? CameraPositionDto {
17231723
super.writeByte(128)
@@ -1743,55 +1743,57 @@ private class _NavigationViewCreationApiCodecWriter: FlutterStandardWriter {
17431743
}
17441744
}
17451745

1746-
private class _NavigationViewCreationApiCodecReaderWriter: FlutterStandardReaderWriter {
1746+
private class NavigationViewCreationApiCodecReaderWriter: FlutterStandardReaderWriter {
17471747
override func reader(with data: Data) -> FlutterStandardReader {
1748-
_NavigationViewCreationApiCodecReader(data: data)
1748+
NavigationViewCreationApiCodecReader(data: data)
17491749
}
17501750

17511751
override func writer(with data: NSMutableData) -> FlutterStandardWriter {
1752-
_NavigationViewCreationApiCodecWriter(data: data)
1752+
NavigationViewCreationApiCodecWriter(data: data)
17531753
}
17541754
}
17551755

1756-
class _NavigationViewCreationApiCodec: FlutterStandardMessageCodec {
1756+
class NavigationViewCreationApiCodec: FlutterStandardMessageCodec {
17571757
static let shared =
1758-
_NavigationViewCreationApiCodec(readerWriter: _NavigationViewCreationApiCodecReaderWriter())
1758+
NavigationViewCreationApiCodec(readerWriter: NavigationViewCreationApiCodecReaderWriter())
17591759
}
17601760

17611761
/// Pigeon only generates messages if the messages are used in API.
1762-
/// [MapOptionsDto] is encoded and decoded directly to generate
1763-
/// a PlatformView creation message. This API should never be used directly.
1762+
/// [ViewCreationOptionsDto] is encoded and decoded directly to generate a
1763+
/// PlatformView creation message.
1764+
///
1765+
/// This API should never be used directly.
17641766
///
17651767
/// Generated protocol from Pigeon that represents a handler of messages from Flutter.
1766-
protocol _NavigationViewCreationApi {
1767-
func _create(msg: ViewCreationOptionsDto) throws
1768+
protocol NavigationViewCreationApi {
1769+
func create(msg: ViewCreationOptionsDto) throws
17681770
}
17691771

17701772
/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`.
1771-
enum _NavigationViewCreationApiSetup {
1772-
/// The codec used by _NavigationViewCreationApi.
1773-
static var codec: FlutterStandardMessageCodec { _NavigationViewCreationApiCodec.shared }
1774-
/// Sets up an instance of `_NavigationViewCreationApi` to handle messages through the
1773+
class NavigationViewCreationApiSetup {
1774+
/// The codec used by NavigationViewCreationApi.
1775+
static var codec: FlutterStandardMessageCodec { NavigationViewCreationApiCodec.shared }
1776+
/// Sets up an instance of `NavigationViewCreationApi` to handle messages through the
17751777
/// `binaryMessenger`.
1776-
static func setUp(binaryMessenger: FlutterBinaryMessenger, api: _NavigationViewCreationApi?) {
1777-
let _createChannel = FlutterBasicMessageChannel(
1778-
name: "dev.flutter.pigeon.google_navigation_flutter._NavigationViewCreationApi._create",
1778+
static func setUp(binaryMessenger: FlutterBinaryMessenger, api: NavigationViewCreationApi?) {
1779+
let createChannel = FlutterBasicMessageChannel(
1780+
name: "dev.flutter.pigeon.google_navigation_flutter.NavigationViewCreationApi.create",
17791781
binaryMessenger: binaryMessenger,
17801782
codec: codec
17811783
)
17821784
if let api {
1783-
_createChannel.setMessageHandler { message, reply in
1785+
createChannel.setMessageHandler { message, reply in
17841786
let args = message as! [Any?]
17851787
let msgArg = args[0] as! ViewCreationOptionsDto
17861788
do {
1787-
try api._create(msg: msgArg)
1789+
try api.create(msg: msgArg)
17881790
reply(wrapResult(nil))
17891791
} catch {
17901792
reply(wrapError(error))
17911793
}
17921794
}
17931795
} else {
1794-
_createChannel.setMessageHandler(nil)
1796+
createChannel.setMessageHandler(nil)
17951797
}
17961798
}
17971799
}
@@ -2026,7 +2028,7 @@ protocol MapViewApi {
20262028
}
20272029

20282030
/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`.
2029-
enum MapViewApiSetup {
2031+
class MapViewApiSetup {
20302032
/// The codec used by MapViewApi.
20312033
static var codec: FlutterStandardMessageCodec { MapViewApiCodec.shared }
20322034
/// Sets up an instance of `MapViewApi` to handle messages through the `binaryMessenger`.
@@ -3935,7 +3937,7 @@ protocol ImageRegistryApi {
39353937
}
39363938

39373939
/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`.
3938-
enum ImageRegistryApiSetup {
3940+
class ImageRegistryApiSetup {
39393941
/// The codec used by ImageRegistryApi.
39403942
static var codec: FlutterStandardMessageCodec { ImageRegistryApiCodec.shared }
39413943
/// Sets up an instance of `ImageRegistryApi` to handle messages through the `binaryMessenger`.
@@ -4586,7 +4588,7 @@ protocol NavigationSessionApi {
45864588
}
45874589

45884590
/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`.
4589-
enum NavigationSessionApiSetup {
4591+
class NavigationSessionApiSetup {
45904592
/// The codec used by NavigationSessionApi.
45914593
static var codec: FlutterStandardMessageCodec { NavigationSessionApiCodec.shared }
45924594
/// Sets up an instance of `NavigationSessionApi` to handle messages through the
@@ -5613,7 +5615,7 @@ protocol NavigationInspector {
56135615
}
56145616

56155617
/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`.
5616-
enum NavigationInspectorSetup {
5618+
class NavigationInspectorSetup {
56175619
/// The codec used by NavigationInspector.
56185620
/// Sets up an instance of `NavigationInspector` to handle messages through the `binaryMessenger`.
56195621
static func setUp(binaryMessenger: FlutterBinaryMessenger, api: NavigationInspector?) {

lib/src/method_channel/messages.g.dart

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1908,8 +1908,8 @@ class NavInfoDto {
19081908
}
19091909
}
19101910

1911-
class __NavigationViewCreationApiCodec extends StandardMessageCodec {
1912-
const __NavigationViewCreationApiCodec();
1911+
class _NavigationViewCreationApiCodec extends StandardMessageCodec {
1912+
const _NavigationViewCreationApiCodec();
19131913
@override
19141914
void writeValue(WriteBuffer buffer, Object? value) {
19151915
if (value is CameraPositionDto) {
@@ -1957,22 +1957,24 @@ class __NavigationViewCreationApiCodec extends StandardMessageCodec {
19571957
}
19581958

19591959
/// Pigeon only generates messages if the messages are used in API.
1960-
/// [MapOptionsDto] is encoded and decoded directly to generate
1961-
/// a PlatformView creation message. This API should never be used directly.
1962-
class _NavigationViewCreationApi {
1963-
/// Constructor for [_NavigationViewCreationApi]. The [binaryMessenger] named argument is
1960+
/// [ViewCreationOptionsDto] is encoded and decoded directly to generate a
1961+
/// PlatformView creation message.
1962+
///
1963+
/// This API should never be used directly.
1964+
class NavigationViewCreationApi {
1965+
/// Constructor for [NavigationViewCreationApi]. The [binaryMessenger] named argument is
19641966
/// available for dependency injection. If it is left null, the default
19651967
/// BinaryMessenger will be used which routes to the host platform.
1966-
_NavigationViewCreationApi({BinaryMessenger? binaryMessenger})
1968+
NavigationViewCreationApi({BinaryMessenger? binaryMessenger})
19671969
: __pigeon_binaryMessenger = binaryMessenger;
19681970
final BinaryMessenger? __pigeon_binaryMessenger;
19691971

19701972
static const MessageCodec<Object?> pigeonChannelCodec =
1971-
__NavigationViewCreationApiCodec();
1973+
_NavigationViewCreationApiCodec();
19721974

1973-
Future<void> _create(ViewCreationOptionsDto msg) async {
1975+
Future<void> create(ViewCreationOptionsDto msg) async {
19741976
const String __pigeon_channelName =
1975-
'dev.flutter.pigeon.google_navigation_flutter._NavigationViewCreationApi._create';
1977+
'dev.flutter.pigeon.google_navigation_flutter.NavigationViewCreationApi.create';
19761978
final BasicMessageChannel<Object?> __pigeon_channel =
19771979
BasicMessageChannel<Object?>(
19781980
__pigeon_channelName,

pigeons/messages.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,13 @@ class ViewCreationOptionsDto {
131131
}
132132

133133
/// Pigeon only generates messages if the messages are used in API.
134-
/// [MapOptionsDto] is encoded and decoded directly to generate
135-
/// a PlatformView creation message. This API should never be used directly.
134+
/// [ViewCreationOptionsDto] is encoded and decoded directly to generate a
135+
/// PlatformView creation message.
136+
///
137+
/// This API should never be used directly.
136138
@HostApi()
137-
// ignore: unused_element
138-
abstract class _NavigationViewCreationApi {
139-
// ignore: unused_element
140-
void _create(ViewCreationOptionsDto msg);
139+
abstract class NavigationViewCreationApi {
140+
void create(ViewCreationOptionsDto msg);
141141
}
142142

143143
enum MapTypeDto { none, normal, satellite, terrain, hybrid }

0 commit comments

Comments
 (0)