Unverified Commit 75ad491f authored by Lau Ching Jun's avatar Lau Ching Jun Committed by GitHub

Add system channel to access the localization plugin. (#76847)

parent dc1cb297
...@@ -344,4 +344,20 @@ class SystemChannels { ...@@ -344,4 +344,20 @@ class SystemChannels {
'flutter/deferredcomponent', 'flutter/deferredcomponent',
StandardMethodCodec(), StandardMethodCodec(),
); );
/// A JSON [MethodChannel] for localization.
///
/// The following outgoing methods are defined for this channel (invoked using
/// [OptionalMethodChannel.invokeMethod]):
///
/// * `Localization.getStringResource`: Obtains the native string resource
/// for a specific locale. The argument is a [Map] with two keys, `key`
/// giving a [String] which the resource is defined with, and an optional
/// `locale` which is a [String] containing the BCP47 locale identifier of
/// the locale requested. See [Locale.toLanguageTag]. When `locale` is not
/// specified, the current system locale is used instead.
static const MethodChannel localization = OptionalMethodChannel(
'flutter/localization',
JSONMethodCodec(),
);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment