You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#### Flutter wrapper and the .flutter git submodule
68
+
67
69
This project uses [flutter_wrapper](https://github.com/passsy/flutter_wrapper). Flutter wrapper is a tool that enables
68
70
having the same flutter version across multiple developers. It installs automatically the flutter version form the
69
71
pubspec.yml into the `.flutter` submodule.
70
72
71
73
Vscode automatically uses the `.flutter` as we have checked in the `.vscode` folder. For setting up the Android Studio,
72
74
please refer to the [documentation](https://github.com/passsy/flutter_wrapper#ide-setup).
73
75
74
-
Further info can be found in the [Medium Article](https://passsy.medium.com/flutter-wrapper-bind-your-project-to-an-explicit-flutter-release-4062cfe6dcaf).
75
-
76
-
**Note:** On windows, Git fails to update the flutter submodule when it has been changed on remote. This can be fixed with:
77
-
```shell
78
-
git submodule update --init
79
-
```
80
76
#### Linux and MacOs
81
77
Linux and MacOs users can simply replace all `flutter` CLI commands with `./flutterw` and it will just work.
82
78
83
79
#### Windows
84
-
In windows, this does unfortunately not work, but you can still set up your IDE to use the flutter version in from the `.flutter` git submodule. And you can do the following workaround:
85
-
86
-
[Melos](https://melos.invertase.dev/) splitting up large code bases into separate independently versioned packages is extremely useful for code sharing. However, making changes across many repositories is messy and difficult to track, and testing across repositories gets complicated really fast.
87
-
To solve these (and many other) problems, some projects will organize their code bases into multi-package repositories (sometimes called [monorepos](https://en.wikipedia.org/wiki/Monorepo)).
88
-
89
-
## Build js dependencies
90
-
91
-
Encointer wallet connects to the chains with [polkadot-js/api](https://polkadot.js.org/api/), running in a hidden webview.
92
-
You'll need `Nodejs` and `yarn` installed to build the bundled `main.js` file:
93
-
94
-
See the js_service_encointer [Readme](app/js_service_encointer/README.md) for more documentation.
80
+
In windows, this does unfortunately not work, but `.flutter` you can refer to the executables directly with:
81
+
`./flutter/bin/flutter` and `./flutter/bin/dart`.
95
82
83
+
**Note:** On windows, Git fails to update the flutter submodule when it has been changed on remote. This can be fixed with:
96
84
```shell
97
-
melos yarn-build
98
-
# windows
99
-
pub global run melos yarn-build
85
+
git submodule update --init
100
86
```
87
+
101
88
### Run App
102
89
Run Android platform
103
90
```shell
104
-
melos run-android
105
-
# windows
106
-
pub global run melos run-android
91
+
./.flutter\bin\dart melos run run-android
107
92
```
108
93
Run IOS platform
109
94
```shell
110
-
melos run-ios
111
-
# windows
112
-
pub global run melos run-ios
95
+
./.flutter\bin\dart run melos run-ios
113
96
```
114
97
If you have an AVD or real device attached, you can do
115
98
```shell
116
-
./flutterw run --flavor dev
99
+
./.flutter\bin\flutter run --flavor dev
117
100
```
118
101
### Build APK
119
102
120
103
You may build the App with Flutter's [Deployment Documentation](https://flutter.dev/docs).
121
104
122
105
In order to build a fat APK, you can do
123
106
```shell
124
-
melos build-apk-fdroid
125
-
# windows
126
-
pub global run melos build-apk-fdroid
107
+
.\.flutter\bin\dart run melos build-apk-fdroid
127
108
```
128
109
and find the output in `build/app/outputs/apk/fdroid/release/app-fdroid-release.apk`
129
110
130
111
For the play store, an appbundle is preferred:
131
112
```shell
132
-
melos build-appbundle
133
-
# windows
134
-
pub global run melos build-appbundle
113
+
.\.flutter\bin\dart run melos build-appbundle
135
114
```
136
115
and find the output in `build/app/outputs/bundle/release/app-release.aab`
137
116
@@ -147,28 +126,22 @@ The following file contains the supported flutter version:
147
126
* run all tests from the command line:`./flutterw test`
148
127
* exclude e2e-tests that need a running encointer node:
149
128
```shell
150
-
melos unit-test-app-exclude-encointer-node-e2e
129
+
.\.flutter\bin\dart run melos unit-test-app-exclude-encointer-node-e2e
151
130
```
152
131
* run e2e-tests that need a running encointer node:
153
132
```shell
154
-
melos unit-test-app-with-encointer-node-e2e
155
-
# windows
156
-
pub global run melos unit-test-app-with-encointer-node-e2e
133
+
.\.flutter\bin\dart run melos unit-test-app-with-encointer-node-e2e
157
134
```
158
135
159
136
### Integration tests
160
137
* run all integration tests in `test_driver` directory:
161
138
Integration test app.dart for Android system
162
139
```shell
163
-
melos integration-app-test-android
164
-
# windows
165
-
pub global run melos integration-app-test-android
140
+
.\.flutter\bin\dart run melos integration-app-test-android
166
141
```
167
142
Integration test app.dart for IOS system
168
143
```shell
169
-
melos integration-app-test-ios
170
-
# windows
171
-
pub global run melos integration-app-test-ios
144
+
.\.flutter\bin\dart run melos integration-app-test-ios
172
145
```
173
146
174
147
### Automated screenshots
@@ -177,45 +150,8 @@ pub global run melos integration-app-test-ios
177
150
#### Android Studio
178
151
To run the in Android Studio a build flavor must be specified. Go to Run/Debug configurations and add the build flavor `dev` in the appropriate field. Other available values are in the in the android/app/src/build.gradle file.
179
152
180
-
>Note that this project can be compiled both in Android and IOS,
181
-
>But there is an Issue running it on an IOS simulator, that the
182
-
>substrate `sr25519` keyPair is generated within an `WASM` virtual
183
-
>machine which is **not supported** by IOS simulators.
184
-
185
153
## Developer Remarks
186
154
187
-
### Windows Local Dev-setup
188
-
Setup to talk from emulators and/or cellphones with an encointer-node in the same local network. In windows 10/11 some
189
-
OS fixes are needed to get this working. I don't know if all of these steps are required.
190
-
191
-
1. Make PC discoverable in local network.
192
-
2. Enable inbound connections in windows firewall:
193
-
* Search: `Windows Defender Firewall with Advanced Security`.
194
-
* Inbound Rules > New Rule > Rule Type: Port > Tick TCP and specify the node's port, e.g. 9944.
195
-
* Click next until finished and give the rule a distinct name, e.g. `Substrate Node`.
196
-
* Double check if the rule is activated.
197
-
3. Find your local IP in the network and enter it in the encointer-wallet's [config](https://github.com/encointer/encointer-wallet-flutter/blob/1abb8a1f54ef551f19598fb809dfd6378cf1ac43/lib/config/consts.dart#L16-L23).
198
-
4. Restart the computer to be sure that the new configs are active.
If the node is run in WSL2 (WSL1 should be fine), some extra steps are needed:
205
-
206
-
6. WSL2 does only expose ports on the local interface, which means they only listen to `127.0.0.1`, hence WSL2 can't be
207
-
accessed on `hostname/-ip` on other devices in the LAN. This can be fixed with a simple tool [WSLHostPatcher](https://github.com/CzBiX/WSLHostPatcher).
208
-
* Download the release.zip
209
-
* Run `WSLHostPatcher.exe`
210
-
* (Re-)start the service in WSL2. A firewall warning will pop-up the first time and access must be granted.
211
-
212
-
7. Now you should be able to access the node with both, the emulator and a cellphone in the local network.
213
-
214
-
**Note**: The `WSLHostPatcher.exe` must be run after every OS restart. You can automatically run it with the following steps:
215
-
* Download the release.zip, unzip it and put it into the ProgramFiles folder, giving it a more suitable name.
216
-
* Press `windows key + r` and type `shell:startup`.
217
-
* Add a shortcut to the `WSLHostPatcher.exe` in the windows startup folder.
218
-
219
155
### Fmt
220
156
`dartfmt` lacks config file support, which implies that customizations need to be done by users individually. The default
221
157
limit of 80 characters line length conflicts with the deeply nested structure of flutter's declarative code for designing
@@ -227,9 +163,7 @@ length of the code to 120.
227
163
* Format the whole codebase with:
228
164
format all Dart code
229
165
```shell
230
-
melos format
231
-
# windows
232
-
pub global run melos format
166
+
.\.flutter\bin\dart run melos format
233
167
```
234
168
235
169
#### Other fmt hints:
@@ -244,9 +178,7 @@ e.g. `@JsonSerializable` or the mobx annotations. Whenever annotations are added
0 commit comments