Flutter Engine
The Flutter Engine
platform_data.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_RUNTIME_PLATFORM_DATA_H_
6#define FLUTTER_RUNTIME_PLATFORM_DATA_H_
7
8#include <memory>
9#include <string>
10#include <vector>
11
12#include "flutter/lib/ui/window/viewport_metrics.h"
13#include "flutter/shell/common/display.h"
14
15namespace flutter {
16
17//------------------------------------------------------------------------------
18/// The struct of platform-specific data used for initializing
19/// ui.PlatformDispatcher.
20///
21/// The framework may request data from ui.PlatformDispatcher before the
22/// platform is properly configured. When creating the Shell, the engine sets
23/// this struct to default values until the platform is ready to send the real
24/// data.
25///
26/// See also:
27///
28/// * flutter::Shell::Create, which takes a platform_data to initialize the
29/// ui.PlatformDispatcher attached to it.
32
34
35 // A map from view IDs of existing views to their viewport metrics.
36 std::unordered_map<int64_t, ViewportMetrics> viewport_metrics_for_views;
37
38 std::string language_code;
39 std::string country_code;
40 std::string script_code;
41 std::string variant_code;
42 std::vector<std::string> locale_data;
43 std::string user_settings_data = "{}";
44 std::string lifecycle_state;
45 bool semantics_enabled = false;
48 std::vector<DisplayData> displays;
49};
50
51} // namespace flutter
52
53#endif // FLUTTER_RUNTIME_PLATFORM_DATA_H_
std::unordered_map< int64_t, ViewportMetrics > viewport_metrics_for_views
Definition: platform_data.h:36
std::string language_code
Definition: platform_data.h:38
int32_t accessibility_feature_flags_
Definition: platform_data.h:47
std::string lifecycle_state
Definition: platform_data.h:44
std::string country_code
Definition: platform_data.h:39
std::vector< DisplayData > displays
Definition: platform_data.h:48
std::vector< std::string > locale_data
Definition: platform_data.h:42
std::string script_code
Definition: platform_data.h:40
std::string variant_code
Definition: platform_data.h:41
std::string user_settings_data
Definition: platform_data.h:43