Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Public Attributes | List of all members
io.flutter.embedding.engine.systemchannels.LocalizationChannel Class Reference

Classes

interface  LocalizationMessageHandler
 

Public Member Functions

 LocalizationChannel (@NonNull DartExecutor dartExecutor)
 
void setLocalizationMessageHandler ( @Nullable LocalizationMessageHandler localizationMessageHandler)
 
void sendLocales (@NonNull List< Locale > locales)
 

Public Attributes

final MethodChannel channel
 
final MethodChannel.MethodCallHandler handler
 

Detailed Description

Sends the platform's locales to Dart.

Definition at line 22 of file LocalizationChannel.java.

Constructor & Destructor Documentation

◆ LocalizationChannel()

io.flutter.embedding.engine.systemchannels.LocalizationChannel.LocalizationChannel ( @NonNull DartExecutor  dartExecutor)
inline

Definition at line 61 of file LocalizationChannel.java.

61 {
62 this.channel =
63 new MethodChannel(dartExecutor, "flutter/localization", JSONMethodCodec.INSTANCE);
65 }
void setMethodCallHandler(final @Nullable MethodCallHandler handler)

Member Function Documentation

◆ sendLocales()

void io.flutter.embedding.engine.systemchannels.LocalizationChannel.sendLocales ( @NonNull List< Locale >  locales)
inline

Send the given locales to Dart.

Definition at line 77 of file LocalizationChannel.java.

77 {
78 Log.v(TAG, "Sending Locales to Flutter.");
79 // Send the user's preferred locales.
80 List<String> data = new ArrayList<>();
81 for (Locale locale : locales) {
82 Log.v(
83 TAG,
84 "Locale (Language: "
85 + locale.getLanguage()
86 + ", Country: "
87 + locale.getCountry()
88 + ", Variant: "
89 + locale.getVariant()
90 + ")");
91 data.add(locale.getLanguage());
92 data.add(locale.getCountry());
93 data.add(locale.getScript());
94 data.add(locale.getVariant());
95 }
96 channel.invokeMethod("setLocale", data);
97 }
void invokeMethod(@NonNull String method, @Nullable Object arguments)
void Log(const char *format,...) SK_PRINTF_LIKE(1
Definition: TestRunner.cpp:137
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ setLocalizationMessageHandler()

void io.flutter.embedding.engine.systemchannels.LocalizationChannel.setLocalizationMessageHandler ( @Nullable LocalizationMessageHandler  localizationMessageHandler)
inline

Sets the LocalizationMessageHandler which receives all events and requests that are parsed from the underlying platform channel.

Definition at line 71 of file LocalizationChannel.java.

72 {
73 this.localizationMessageHandler = localizationMessageHandler;
74 }

Member Data Documentation

◆ channel

final MethodChannel io.flutter.embedding.engine.systemchannels.LocalizationChannel.channel

Definition at line 25 of file LocalizationChannel.java.

◆ handler

final MethodChannel.MethodCallHandler io.flutter.embedding.engine.systemchannels.LocalizationChannel.handler

Definition at line 29 of file LocalizationChannel.java.


The documentation for this class was generated from the following file: