Skip to content

Commit 58c0c93

Browse files
[Next stable] Update documentation for new location of linux source (#11182)
The Linux directory was changed in flutter/flutter#153812. Land once flutter/flutter@8925e1f is in stable.
1 parent 83517f0 commit 58c0c93

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/content/platform-integration/platform-channels.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,19 +1014,19 @@ of your choice. The instructions below are for Visual Studio Code with the
10141014
1. Choose **Yes** in the prompt asking: `Would you like to configure project "linux"?`.
10151015
This enables C++ autocomplete.
10161016

1017-
1. Open the file `my_application.cc`.
1017+
1. Open the file `runner/my_application.cc`.
10181018

10191019
First, add the necessary includes to the top of the file, just
10201020
after `#include <flutter_linux/flutter_linux.h>`:
10211021

1022-
```c title="my_application.cc"
1022+
```c title="runner/my_application.cc"
10231023
#include <math.h>
10241024
#include <upower.h>
10251025
```
10261026

10271027
Add an `FlMethodChannel` to the `_MyApplication` struct:
10281028

1029-
```c title="my_application.cc"
1029+
```c title="runnner/my_application.cc"
10301030
struct _MyApplication {
10311031
GtkApplication parent_instance;
10321032
char** dart_entrypoint_arguments;
@@ -1036,7 +1036,7 @@ struct _MyApplication {
10361036

10371037
Make sure to clean it up in `my_application_dispose`:
10381038

1039-
```c title="my_application.cc"
1039+
```c title="runner/my_application.cc"
10401040
static void my_application_dispose(GObject* object) {
10411041
MyApplication* self = MY_APPLICATION(object);
10421042
g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev);
@@ -1050,7 +1050,7 @@ Edit the `my_application_activate` method and initialize
10501050
`samples.flutter.dev/battery`, just after the call to
10511051
`fl_register_plugins`:
10521052
1053-
```c title="my_application.cc"
1053+
```c title="runner/my_application.cc"
10541054
static void my_application_activate(GApplication* application) {
10551055
// ...
10561056
fl_register_plugins(FL_PLUGIN_REGISTRY(self->view));
@@ -1073,7 +1073,7 @@ you would write in a native Linux application.
10731073
Add the following as a new function at the top of
10741074
`my_application.cc` just after the `G_DEFINE_TYPE` line:
10751075

1076-
```c title="my_application.cc"
1076+
```c title="runner/my_application.cc"
10771077
static FlMethodResponse* get_battery_level() {
10781078
// Find the first available battery and report that.
10791079
g_autoptr(UpClient) up_client = up_client_new();
@@ -1103,7 +1103,7 @@ is called, report that instead.
11031103

11041104
Add the following code after the `get_battery_level` function:
11051105

1106-
```cpp title="my_application.cpp"
1106+
```cpp title="runner/my_application.cpp"
11071107
static void battery_method_call_handler(FlMethodChannel* channel,
11081108
FlMethodCall* method_call,
11091109
gpointer user_data) {

0 commit comments

Comments
 (0)