Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 29d0edda30 |
606 changed files with 6170 additions and 34271 deletions
|
|
@ -1,28 +0,0 @@
|
||||||
name: "End-to-end tests"
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: ["main"]
|
|
||||||
pull_request:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
e2e:
|
|
||||||
runs-on: ["large", "debian-13-x86_64"]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Lix GHA Installer Action
|
|
||||||
uses: samueldr/lix-gha-installer-action@v2026-02-22
|
|
||||||
with:
|
|
||||||
extra_nix_config: experimental-features = nix-command flakes flake-self-attrs
|
|
||||||
|
|
||||||
- name: Generate code
|
|
||||||
run: nix develop --command bash -c "flutter pub get && dart scripts/generate.dart && flutter pub run build_runner build"
|
|
||||||
|
|
||||||
- name: Run end-to-end tests
|
|
||||||
run: nix run .#e2e-headless
|
|
||||||
39
.github/workflows/android.yml
vendored
39
.github/workflows/android.yml
vendored
|
|
@ -1,39 +0,0 @@
|
||||||
name: "Build APK"
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: ["main"]
|
|
||||||
tags: ["*"]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-apk:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Lix GHA Installer Action
|
|
||||||
uses: samueldr/lix-gha-installer-action@v2026-02-22
|
|
||||||
with:
|
|
||||||
extra_nix_config: experimental-features = nix-command flakes flake-self-attrs
|
|
||||||
|
|
||||||
- name: Decode keystore
|
|
||||||
run: echo "$KEYSTORE_CONTENT" | base64 --decode > keystore.jks
|
|
||||||
env:
|
|
||||||
KEYSTORE_CONTENT: ${{ secrets.KEYSTORE_CONTENT }}
|
|
||||||
|
|
||||||
- name: Build app
|
|
||||||
run: nix develop --command bash -c "flutter pub get && dart scripts/generate.dart && flutter pub run build_runner build && flutter build apk --target-platform android-arm64 --split-per-abi --dart-define=GIT_COMMIT=${{ github.sha }}"
|
|
||||||
env:
|
|
||||||
KEYSTORE_PATH: ../../keystore.jks
|
|
||||||
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Upload installer artifact
|
|
||||||
uses: actions/upload-artifact@v6
|
|
||||||
with:
|
|
||||||
name: APK
|
|
||||||
path: build/app/outputs/flutter-apk/app-arm64-v8a-release.apk
|
|
||||||
73
.github/workflows/flatpak.yml
vendored
73
.github/workflows/flatpak.yml
vendored
|
|
@ -1,73 +0,0 @@
|
||||||
name: "Build Flatpaks"
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: ["main"]
|
|
||||||
tags: ["*"]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-flatpak:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- arch: x86_64
|
|
||||||
runner: ubuntu-latest
|
|
||||||
- arch: aarch64
|
|
||||||
runner: ubuntu-24.04-arm
|
|
||||||
runs-on: ${{ matrix.runner }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Lix GHA Installer Action
|
|
||||||
uses: samueldr/lix-gha-installer-action@v2026-02-22
|
|
||||||
with:
|
|
||||||
extra_nix_config: experimental-features = nix-command flakes flake-self-attrs
|
|
||||||
|
|
||||||
- name: Build app
|
|
||||||
run: nix build .#flatpak
|
|
||||||
|
|
||||||
- name: Upload installer artifact
|
|
||||||
uses: actions/upload-artifact@v6
|
|
||||||
with:
|
|
||||||
name: flatpak-${{ matrix.arch }}
|
|
||||||
path: result/nexus.federated.nexus.flatpak
|
|
||||||
|
|
||||||
publish:
|
|
||||||
needs: build-flatpak
|
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
pages: write
|
|
||||||
id-token: write
|
|
||||||
environment:
|
|
||||||
name: github-pages
|
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
|
||||||
steps:
|
|
||||||
- name: Install flatpak tooling
|
|
||||||
run: sudo apt-get update && sudo apt-get install -y flatpak ostree
|
|
||||||
|
|
||||||
- name: Download bundles
|
|
||||||
uses: actions/download-artifact@v7
|
|
||||||
with:
|
|
||||||
pattern: flatpak-*
|
|
||||||
path: bundles
|
|
||||||
|
|
||||||
- name: Build OSTree repo
|
|
||||||
run: |
|
|
||||||
ostree init --repo=repo --mode=archive-z2
|
|
||||||
for bundle in bundles/*/nexus.federated.nexus.flatpak; do
|
|
||||||
flatpak build-import-bundle repo "$bundle"
|
|
||||||
done
|
|
||||||
flatpak build-update-repo --prune repo
|
|
||||||
|
|
||||||
- uses: actions/upload-pages-artifact@v4
|
|
||||||
with:
|
|
||||||
path: repo
|
|
||||||
|
|
||||||
- name: Deploy to Pages
|
|
||||||
id: deployment
|
|
||||||
uses: actions/deploy-pages@v4
|
|
||||||
48
.github/workflows/ios.yml
vendored
48
.github/workflows/ios.yml
vendored
|
|
@ -1,48 +0,0 @@
|
||||||
name: "Build iOS App"
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: ["main"]
|
|
||||||
tags: ["*"]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-app:
|
|
||||||
runs-on: macos-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Set up Flutter
|
|
||||||
uses: subosito/flutter-action@v2
|
|
||||||
with:
|
|
||||||
flutter-version: 3.47.4
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v6
|
|
||||||
with:
|
|
||||||
go-version-file: gomuks/go.mod
|
|
||||||
|
|
||||||
- name: Build app
|
|
||||||
run: |
|
|
||||||
flutter pub get
|
|
||||||
dart scripts/generate.dart
|
|
||||||
flutter pub run build_runner build
|
|
||||||
flutter build ios --no-codesign --dart-define=GIT_COMMIT=${{ github.sha }}
|
|
||||||
|
|
||||||
# Unsigned IPA: SideStore/AltStore re-sign this on-device with the
|
|
||||||
# user's own Apple ID at install time, so no certificate is needed here.
|
|
||||||
- name: Package unsigned IPA
|
|
||||||
run: |
|
|
||||||
mkdir Payload
|
|
||||||
cp -r build/ios/iphoneos/Runner.app Payload/
|
|
||||||
zip -r Nexus.ipa Payload
|
|
||||||
|
|
||||||
- name: Upload IPA artifact
|
|
||||||
uses: actions/upload-artifact@v6
|
|
||||||
with:
|
|
||||||
name: Nexus.ipa
|
|
||||||
path: Nexus.ipa
|
|
||||||
47
.github/workflows/macos.yml
vendored
47
.github/workflows/macos.yml
vendored
|
|
@ -1,47 +0,0 @@
|
||||||
name: "Build MacOS App"
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: ["main"]
|
|
||||||
tags: ["*"]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-app:
|
|
||||||
runs-on: macos-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Set up Flutter
|
|
||||||
uses: subosito/flutter-action@v2
|
|
||||||
with:
|
|
||||||
flutter-version: 3.47.4
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v6
|
|
||||||
with:
|
|
||||||
go-version-file: gomuks/go.mod
|
|
||||||
|
|
||||||
- name: Build App
|
|
||||||
run: |
|
|
||||||
flutter pub get
|
|
||||||
dart scripts/generate.dart
|
|
||||||
flutter pub run build_runner build
|
|
||||||
flutter build macos --dart-define=GIT_COMMIT=${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Create DMG
|
|
||||||
id: create-dmg
|
|
||||||
uses: L-Super/create-dmg-actions@28511e988b13ca34096d439159a66d468b8e724f
|
|
||||||
with:
|
|
||||||
dmg_name: nexus
|
|
||||||
src_dir: build/macos/Build/Products/Release/Nexus.app
|
|
||||||
|
|
||||||
- name: Upload DMG
|
|
||||||
uses: actions/upload-artifact@v6
|
|
||||||
with:
|
|
||||||
name: nexus.dmg
|
|
||||||
path: ${{ steps.create-dmg.outputs.dmg_path }}
|
|
||||||
88
.github/workflows/windows.yml
vendored
88
.github/workflows/windows.yml
vendored
|
|
@ -1,74 +1,46 @@
|
||||||
name: "Build EXE"
|
name: "Build Windows Version"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches: ["main"]
|
|
||||||
tags: ["*"]
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-exe:
|
build-windows:
|
||||||
runs-on: windows-latest
|
runs-on: "windows-latest"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: "Checkout repository"
|
||||||
uses: actions/checkout@v6
|
uses: "actions/checkout@v4"
|
||||||
|
|
||||||
|
- name: "Set up Flutter"
|
||||||
|
uses: "subosito/flutter-action@v2"
|
||||||
|
|
||||||
|
- name: "Set up Rust"
|
||||||
|
uses: "dtolnay/rust-toolchain@stable"
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
targets: "x86_64-pc-windows-msvc"
|
||||||
|
|
||||||
- name: Set up Flutter
|
- name: "Install Flutter dependencies"
|
||||||
uses: subosito/flutter-action@v2
|
run: flutter pub get
|
||||||
|
|
||||||
|
- name: "Run build_runner & build Windows EXE"
|
||||||
|
run: |
|
||||||
|
flutter pub run build_runner build --delete-conflicting-outputs
|
||||||
|
flutter build windows --release
|
||||||
|
|
||||||
|
- name: "Upload exe zip"
|
||||||
|
uses: "actions/upload-artifact@v4"
|
||||||
with:
|
with:
|
||||||
flutter-version: 3.47.4
|
name: "windows-portable"
|
||||||
|
path: "build/windows/x64/runner/Release/"
|
||||||
|
|
||||||
- name: Set up Go
|
- name: "Install Inno Setup"
|
||||||
uses: actions/setup-go@v6
|
|
||||||
with:
|
|
||||||
go-version-file: gomuks/go.mod
|
|
||||||
|
|
||||||
- name: Setup MSYS2
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
msystem: CLANG64
|
|
||||||
install: >-
|
|
||||||
mingw-w64-x86_64-gcc
|
|
||||||
|
|
||||||
- name: Go build
|
|
||||||
run: |
|
|
||||||
cd gomuks/pkg/ffi
|
|
||||||
go build -tags goolm,sqlite_fts5 -o ../../../libgomuks.dll -buildmode=c-shared
|
|
||||||
|
|
||||||
- name: Build with Flutter
|
|
||||||
run: |
|
|
||||||
flutter pub get
|
|
||||||
dart scripts/generate.dart
|
|
||||||
flutter pub run build_runner build
|
|
||||||
flutter build windows --dart-define=GIT_COMMIT=${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Copy MinGW runtime DLLs
|
|
||||||
shell: msys2 {0}
|
|
||||||
run: |
|
|
||||||
cp /mingw64/bin/libgcc_s_seh-1.dll build/windows/x64/runner/Release/
|
|
||||||
cp /mingw64/bin/libwinpthread-1.dll build/windows/x64/runner/Release/
|
|
||||||
cp /mingw64/bin/libstdc++-6.dll build/windows/x64/runner/Release/
|
|
||||||
|
|
||||||
- name: Copy MSVC runtime DLLs
|
|
||||||
shell: powershell
|
|
||||||
run: |
|
|
||||||
$release = "build/windows/x64/runner/Release"
|
|
||||||
|
|
||||||
Copy-Item C:\Windows\System32\MSVCP140.dll $release -Force
|
|
||||||
Copy-Item C:\Windows\System32\VCRUNTIME140.dll $release -Force
|
|
||||||
Copy-Item C:\Windows\System32\VCRUNTIME140_1.dll $release -Force
|
|
||||||
|
|
||||||
- name: Install Inno Setup
|
|
||||||
run: choco install innosetup -y
|
run: choco install innosetup -y
|
||||||
|
|
||||||
- name: Build Inno Setup installer
|
- name: "Build Inno Setup installer"
|
||||||
run: iscc windows/installer.iss
|
run: iscc windows/installer.iss
|
||||||
|
|
||||||
- name: Upload installer artifact
|
- name: "Upload installer artifact"
|
||||||
uses: actions/upload-artifact@v6
|
uses: "actions/upload-artifact@v4"
|
||||||
with:
|
with:
|
||||||
name: windows-installer
|
name: "windows-installer"
|
||||||
path: windows/dist/Nexus-Setup.exe
|
path: "windows/dist/Nexus-Setup.exe"
|
||||||
|
|
|
||||||
6
.gitignore
vendored
6
.gitignore
vendored
|
|
@ -36,11 +36,7 @@ key.properties
|
||||||
# Generated Files
|
# Generated Files
|
||||||
*.g.dart
|
*.g.dart
|
||||||
*.freezed.dart
|
*.freezed.dart
|
||||||
|
src/
|
||||||
|
|
||||||
# Devel Password
|
# Devel Password
|
||||||
password.txt
|
password.txt
|
||||||
|
|
||||||
# Nix
|
|
||||||
/result
|
|
||||||
# Widget Preview related
|
|
||||||
.widget_preview/
|
|
||||||
|
|
|
||||||
4
.gitmodules
vendored
4
.gitmodules
vendored
|
|
@ -1,4 +0,0 @@
|
||||||
[submodule "gomuks"]
|
|
||||||
path = gomuks
|
|
||||||
url = https://github.com/gomuks/gomuks
|
|
||||||
branch = quad/nexus
|
|
||||||
12
.metadata
12
.metadata
|
|
@ -4,7 +4,7 @@
|
||||||
# This file should be version controlled and should not be manually edited.
|
# This file should be version controlled and should not be manually edited.
|
||||||
|
|
||||||
version:
|
version:
|
||||||
revision: "6b182d2c7585eba26d4edce0f97630effd256c33"
|
revision: "67323de285b00232883f53b84095eb72be97d35c"
|
||||||
channel: "stable"
|
channel: "stable"
|
||||||
|
|
||||||
project_type: app
|
project_type: app
|
||||||
|
|
@ -13,11 +13,11 @@ project_type: app
|
||||||
migration:
|
migration:
|
||||||
platforms:
|
platforms:
|
||||||
- platform: root
|
- platform: root
|
||||||
create_revision: 6b182d2c7585eba26d4edce0f97630effd256c33
|
create_revision: 67323de285b00232883f53b84095eb72be97d35c
|
||||||
base_revision: 6b182d2c7585eba26d4edce0f97630effd256c33
|
base_revision: 67323de285b00232883f53b84095eb72be97d35c
|
||||||
- platform: ios
|
- platform: macos
|
||||||
create_revision: 6b182d2c7585eba26d4edce0f97630effd256c33
|
create_revision: 67323de285b00232883f53b84095eb72be97d35c
|
||||||
base_revision: 6b182d2c7585eba26d4edce0f97630effd256c33
|
base_revision: 67323de285b00232883f53b84095eb72be97d35c
|
||||||
|
|
||||||
# User provided section
|
# User provided section
|
||||||
|
|
||||||
|
|
|
||||||
17
.vscode/launch.json
vendored
17
.vscode/launch.json
vendored
|
|
@ -1,17 +0,0 @@
|
||||||
{
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "Flutter",
|
|
||||||
"type": "dart",
|
|
||||||
"request": "launch",
|
|
||||||
"program": "lib/main.dart"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Flutter (Headless)",
|
|
||||||
"type": "dart",
|
|
||||||
"request": "launch",
|
|
||||||
"program": "lib/main.dart",
|
|
||||||
"env": { "FLUTTER_HEADLESS": "1" }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
13
.vscode/settings.json
vendored
13
.vscode/settings.json
vendored
|
|
@ -2,19 +2,8 @@
|
||||||
"cSpell.words": [
|
"cSpell.words": [
|
||||||
"Appbar",
|
"Appbar",
|
||||||
"Displayname",
|
"Displayname",
|
||||||
"fluttertagger",
|
|
||||||
"Gomuks",
|
|
||||||
"Homeserver",
|
"Homeserver",
|
||||||
"Linkified",
|
|
||||||
"localpart",
|
|
||||||
"msgtype",
|
|
||||||
"muks",
|
|
||||||
"prefs",
|
"prefs",
|
||||||
"recents",
|
"vodozemac"
|
||||||
"unban",
|
|
||||||
"underride",
|
|
||||||
"unifiedpush",
|
|
||||||
"unredact",
|
|
||||||
"webpush"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
104
DEVELOPMENT.md
104
DEVELOPMENT.md
|
|
@ -1,104 +0,0 @@
|
||||||
# Development Documentation
|
|
||||||
|
|
||||||
## Build instructions
|
|
||||||
|
|
||||||
Build instructions can be found in [README.md](./README.md#build-it-yourself).
|
|
||||||
|
|
||||||
## Updating Gomuks
|
|
||||||
|
|
||||||
You can run the following command to update the Gomuks submodule:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
git submodule update --remote
|
|
||||||
```
|
|
||||||
|
|
||||||
## Code Style
|
|
||||||
|
|
||||||
See [Effective Dart: Style](https://dart.dev/effective-dart/style) for general rules. There are some extra rules detailed below:
|
|
||||||
|
|
||||||
### Controllers and Helpers ([Riverpod](https://pub.dev/packages/riverpod))
|
|
||||||
|
|
||||||
Controllers live in `lib/controllers/` and provide a source that exposes data and logic via Riverpod providers, allowing other parts of the code to watch state changes with ref.watch (`ref.watch(MyController.provider)`), access the current value with ref.read (`ref.read(MyController.provider)`), and run helper methods on those classes using the notifier:
|
|
||||||
|
|
||||||
```dart
|
|
||||||
ref.read(MyController.provider.notifier).helperMethod()
|
|
||||||
```
|
|
||||||
|
|
||||||
We use an object oriented style for controllers, where `provider` is a static member on the controller class. E.g.
|
|
||||||
|
|
||||||
```dart
|
|
||||||
class MyController(final SomeInputType input)
|
|
||||||
extends AsyncNotifier<DataThisControllerExposes> {
|
|
||||||
@override
|
|
||||||
Future<DataThisControllerExposes> build() async {
|
|
||||||
return input.foo;
|
|
||||||
}
|
|
||||||
|
|
||||||
static final provider =
|
|
||||||
AsyncNotifierProvider.family<MyController, DataThisControllerExposes, SomeInputType>(
|
|
||||||
MyController.new,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `watch` vs `read`
|
|
||||||
|
|
||||||
Only use `ref.watch` in a `build` method, where you want to rebuild when the value changes. Everywhere else, like callbacks, `useEffect`, and methods on a controller, use `ref.read`.
|
|
||||||
|
|
||||||
Use `.select` to narrow down what you depend on, e.g. `ref.watch(RoomsController.provider.select((rooms) => rooms[roomId]))`.
|
|
||||||
|
|
||||||
Providers which are not controllers, e.g. they expose no data, only methods, should instead live in `lib/helpers/`. For an example, see `lib/helpers/launch_helper.dart`. Other, non-provider helpers, like extensions or helper methods can also go in `lib/helpers/`.
|
|
||||||
|
|
||||||
### Don't use StatefulWidgets ([Flutter Hooks](https://pub.dev/packages/flutter_hooks))
|
|
||||||
|
|
||||||
This project uses Flutter Hooks to help with boilerplate that StatefulWidgets create. Instead of using a StatefulWidget, we just use hooks like `useState` or `useEffect` in the build method of a `HookWidget`, which is a drop in replacement for `StatelessWidget`. If you need both a `WidgetRef` to watch providers, and access to hooks, use `HookConsumerWidget`.
|
|
||||||
|
|
||||||
### Models ([Freezed](https://pub.dev/packages/freezed))
|
|
||||||
|
|
||||||
We use Freezed for our models to avoid boilerplate and enforce an immutable style of state and data modeling throughout the code. See their documentation for more info, or see our existing models in `lib/models/`.
|
|
||||||
|
|
||||||
### Immutable Data Collections ([Fast Immutable Collections](https://pub.dev/packages/fast_immutable_collections))
|
|
||||||
|
|
||||||
When possible, use immutable collections instead of the mutable equivalent. For example, use `IMap` over `Map`, `IList` over `List`, `ISet` over `Set`. This matches the immutable style of Riverpod and Freezed.
|
|
||||||
|
|
||||||
### Don't create globals
|
|
||||||
|
|
||||||
When possible, we prefer not to create global variables or methods. You can usually replace a global variable with a Riverpod controller, and a global method with an extension method.
|
|
||||||
|
|
||||||
I'm also not a big fan of unneeded private methods or variables, but this is contextual.
|
|
||||||
|
|
||||||
### Modern Dart syntax
|
|
||||||
|
|
||||||
We try to use newer Dart language features where they make code shorter:
|
|
||||||
|
|
||||||
- Primary constructors for classes, including widgets, e.g. `class const MemberList(final String roomId, {super.key}) extends HookConsumerWidget`.
|
|
||||||
- Dot shorthands wherever the type can be inferred, e.g. `.new(...)`, `padding: .all(8)`, `relationType == .reply`.
|
|
||||||
- Patterns and switch expressions over null checks and casts, e.g. `if (event.content case MessageContent(:final body?))` rather than checking `is` then using `!`.
|
|
||||||
|
|
||||||
### Prefer `map` over inline `for` loops
|
|
||||||
|
|
||||||
When building a list (or set, or map) from another collection, use `.map`, `.expand` and friends rather than a `for` inside the collection literal:
|
|
||||||
|
|
||||||
```dart
|
|
||||||
// Prefer
|
|
||||||
children: rooms.map((room) => RoomTile(room)).toList(),
|
|
||||||
|
|
||||||
// Over
|
|
||||||
children: [for (final room in rooms) RoomTile(room)],
|
|
||||||
```
|
|
||||||
|
|
||||||
Regular `for` statements are fine for logic that doesn't just build a collection.
|
|
||||||
|
|
||||||
### Async values and errors
|
|
||||||
|
|
||||||
When rendering an `AsyncValue`, use the `betterWhen` extension, which shows our standard loading and error widgets, or a switch expression if you need more control (e.g. `AsyncData(:final value) || AsyncLoading(:final value?)` to keep showing old data while reloading).
|
|
||||||
|
|
||||||
For futures started from the UI that nothing awaits, like button presses, add `.onError(showError)` so failures are shown to the user instead of being lost.
|
|
||||||
|
|
||||||
## LLM/AI Assisted Contributions
|
|
||||||
|
|
||||||
LLM generated code is NOT allowed. All contributions should be written by humans. Using LLMs for interacting with others, e.g. for Comments, PRs, etc, is also not allowed.
|
|
||||||
|
|
||||||
## Code of Conduct
|
|
||||||
|
|
||||||
All contributions must follow the [Federated Nexus Code of Conduct](https://federated.nexus/code/).
|
|
||||||
239
README.md
239
README.md
|
|
@ -1,8 +1,11 @@
|
||||||
# Nexus Client
|
# Nexus Client
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> Nexus Client is still heavily in development, and is not ready for use!
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
A simple and user-friendly Matrix client made with Flutter and a Gomuks backend.
|
A simple and user-friendly Matrix client made with Flutter and the Matrix Dart SDK.
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
|
|
@ -10,109 +13,135 @@ A simple and user-friendly Matrix client made with Flutter and a Gomuks backend.
|
||||||
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------: |
|
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------: |
|
||||||
|  |  |
|
|  |  |
|
||||||
|
|
||||||
## Try it out
|
## Progress
|
||||||
|
|
||||||
If you want to try out Nexus, download the [latest release](https://git.federated.nexus/Nexus/nexus/releases/latest).
|
- [ ] New logo
|
||||||
|
- [ ] Make context menus appear as bottom sheets on mobile
|
||||||
|
- [x] Move from the Dart SDK to the Gomuks SDK with Dart bindings: https://git.federated.nexus/Henry-Hiles/nexus/pulls/2
|
||||||
|
- [ ] Allow using remote gomuks over websocket
|
||||||
|
- [ ] Platform Support
|
||||||
|
- [x] Linux
|
||||||
|
- [x] Windows
|
||||||
|
- [ ] MacOS
|
||||||
|
- [ ] Android
|
||||||
|
- [ ] iOS
|
||||||
|
- [ ] Web (may not be possible)
|
||||||
|
- [x] Login
|
||||||
|
- [x] Username / password auth
|
||||||
|
- [ ] OAuth / OIDC
|
||||||
|
- [x] Improve initial sync experience
|
||||||
|
- [x] Rooms / Spaces
|
||||||
|
- [x] Displaying and choosing
|
||||||
|
- [x] Reading, showing unread
|
||||||
|
- [x] Mark as read button on rooms and spaces
|
||||||
|
- [ ] Searching
|
||||||
|
- [ ] Creating (Rooms, Spaces, and DMs)
|
||||||
|
- [x] Joining
|
||||||
|
- [ ] Parse vias
|
||||||
|
- [x] Using a text/uri/link
|
||||||
|
- [x] Plain text
|
||||||
|
- [x] `matrix:` Uri
|
||||||
|
- [x] Matrix.to link
|
||||||
|
- [ ] From space
|
||||||
|
- [ ] Exploring
|
||||||
|
- [x] Leaving
|
||||||
|
- [x] Subspaces
|
||||||
|
- [x] Messages
|
||||||
|
- [x] Encryption
|
||||||
|
- [x] Restoring crypto identity from a recovery passphrase/key
|
||||||
|
- [x] Sending
|
||||||
|
- [x] Plain text
|
||||||
|
- [x] HTML/Markdown
|
||||||
|
- [x] Replies
|
||||||
|
- [x] Choose ping on/off
|
||||||
|
- [ ] Attachments
|
||||||
|
- [ ] Commands with [MSC4391](https://github.com/matrix-org/matrix-spec-proposals/pull/4391)
|
||||||
|
- [x] Mentions
|
||||||
|
- [x] Users
|
||||||
|
- [x] Rooms
|
||||||
|
- [ ] Inline emoji picker (Putting this here since it'll be implemented the same way as mentions)
|
||||||
|
- [ ] Custom emojis/stickers
|
||||||
|
- [ ] GIFs using Gomuks' GIF proxies
|
||||||
|
- [x] Recieving
|
||||||
|
- [x] Plain text
|
||||||
|
- [x] HTML
|
||||||
|
- [x] Replies
|
||||||
|
- [x] Viewing
|
||||||
|
- [ ] Jump to original message
|
||||||
|
- [x] In loaded timeline
|
||||||
|
- [ ] Out of loaded timeline
|
||||||
|
- [x] Edits
|
||||||
|
- [x] Attachments
|
||||||
|
- [x] Unencrypted
|
||||||
|
- [ ] Encrypted
|
||||||
|
- [x] Blurhashing
|
||||||
|
- [ ] Downloading attachments
|
||||||
|
- [x] Opening attachments in their own view
|
||||||
|
- [ ] Polls: Waiting on https://github.com/SwanFlutter/dynamic_polls/issues/1
|
||||||
|
- [x] Mentions
|
||||||
|
- [x] Users
|
||||||
|
- [x] Rooms
|
||||||
|
- [ ] Plain text (not sure if I want to add this or not, I probably won't unless there's interest)
|
||||||
|
- [x] Matrix URIs
|
||||||
|
- [x] Matrix.to links
|
||||||
|
- [ ] Do some fancy fetching to get nice names
|
||||||
|
- [ ] Make clickable
|
||||||
|
- [x] Custom emojis/stickers
|
||||||
|
- [x] History loading
|
||||||
|
- [x] Backwards
|
||||||
|
- [ ] Forwards
|
||||||
|
- [x] Editing
|
||||||
|
- [x] Deleting
|
||||||
|
- [ ] Reactions: Waiting on https://github.com/flyerhq/flutter_chat_ui/pull/838 or me doing a custom impl
|
||||||
|
- [ ] Pins
|
||||||
|
- [ ] Displaying
|
||||||
|
- [ ] Creating
|
||||||
|
- [ ] Threads
|
||||||
|
- [ ] Profile popouts
|
||||||
|
- [ ] Copy link to [room, space]
|
||||||
|
- [ ] Reporting
|
||||||
|
- [x] Events
|
||||||
|
- [ ] Rooms
|
||||||
|
- [ ] Notifications using UnifiedPush
|
||||||
|
- [ ] Group calls using [MSC4195](https://github.com/matrix-org/matrix-spec-proposals/pull/4195)
|
||||||
|
- [ ] Invites
|
||||||
|
- [ ] Settings
|
||||||
|
- [ ] Light/Dark mode
|
||||||
|
- [ ] SSD or CSD
|
||||||
|
- [ ] Show media by default
|
||||||
|
- [ ] Dynamic Theming
|
||||||
|
- [ ] Devices
|
||||||
|
- [ ] Viewing devices
|
||||||
|
- [ ] Verifying devices
|
||||||
|
- [ ] URL preview: Server / Client / None
|
||||||
|
- [ ] Account changes
|
||||||
|
- [ ] Display name
|
||||||
|
- [ ] Profile picture
|
||||||
|
- [ ] Timezone
|
||||||
|
- [ ] Pronouns
|
||||||
|
- [ ] Password
|
||||||
|
- [ ] About
|
||||||
|
- [x] Log Out
|
||||||
|
|
||||||
### Nightly Builds
|
## Build Instructions
|
||||||
|
|
||||||
For the newest changes, grab one of the following nightly artifacts, built by CI from the latest commit on `main`.
|
First, clone and open the repo:
|
||||||
|
|
||||||
- [Android APK](https://nightly.link/Henry-Hiles/nexus/workflows/android/main/APK.zip)
|
```sh
|
||||||
- [Unsigned iOS IPA](https://nightly.link/Henry-Hiles/nexus/workflows/ios/main/Nexus.ipa.zip)
|
git clone https://git.federated.nexus/Henry-Hiles/nexus
|
||||||
- [Unsigned MacOS DMG](https://nightly.link/Henry-Hiles/nexus/workflows/macos/main/nexus.dmg.zip)
|
cd nexus
|
||||||
- [Windows EXE](https://nightly.link/Henry-Hiles/nexus/workflows/windows/main/windows-installer.zip)
|
|
||||||
|
|
||||||
Or, use one of the below methods:
|
|
||||||
|
|
||||||
### Nightly Flatpak Repo
|
|
||||||
|
|
||||||
Make sure Flatpak is set up on your system, then run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
flatpak install --user https://nexus.federated.nexus/flatpak/nexus.flatpakref
|
|
||||||
```
|
```
|
||||||
|
|
||||||
This adds the Nexus remote and installs the app for your user only, so no root access is needed (x86_64 and aarch64 are supported). To install system-wide instead, use `--system` in place of `--user`. Updates arrive through `flatpak update` or your software center.
|
|
||||||
|
|
||||||
### NixOS Module
|
|
||||||
|
|
||||||
Add Nexus as a flake input, following `nixpkgs` for less fetches:
|
|
||||||
|
|
||||||
```nix
|
|
||||||
nexus = {
|
|
||||||
url = "git+https://git.federated.nexus/Nexus/nexus";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
This tracks the latest commit on `main`. To stay on a release instead, pin the input to its tag:
|
|
||||||
|
|
||||||
```nix
|
|
||||||
url = "git+https://git.federated.nexus/Nexus/nexus?ref=refs/tags/v1.0.1";
|
|
||||||
```
|
|
||||||
|
|
||||||
Then import the module and enable it in your NixOS configuration:
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{ inputs, ... }:
|
|
||||||
{
|
|
||||||
imports = [ inputs.nexus.nixosModules.default ];
|
|
||||||
|
|
||||||
programs.nexus = {
|
|
||||||
enable = true;
|
|
||||||
enableNotifications = true; # optional: push notifications via UnifiedPush
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
This installs Nexus system-wide. With `enableNotifications`, it also installs KUnifiedPush and registers its systemd and D-Bus services so notifications work. The `package` option lets you override the package if you need to.
|
|
||||||
|
|
||||||
## Build it yourself
|
|
||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
#### Linux
|
#### Linux
|
||||||
|
|
||||||
- On NixOS: Either use direnv and `direnv allow`, or `nix develop`
|
- With Nix: Either use direnv, or `nix flake develop`
|
||||||
- On other distros: Install Flutter, Go, Git, Libclang, Libass, MPV, and Glibc. Do not use any Snap packages, they cause various compilation issues.
|
- Without Nix: Install Flutter, Go, Olm, Git, Clang, and GLibc.
|
||||||
|
|
||||||
#### Windows
|
#### Windows / MacOS
|
||||||
|
|
||||||
You will need:
|
I don't really know. You will need Flutter, Git, Olm, Go, and Visual Studio tools, and otherwise I guess just keep installing stuff until there aren't any errors. I will look into this sometimeTM.
|
||||||
|
|
||||||
- Flutter
|
|
||||||
- Git
|
|
||||||
- Libass
|
|
||||||
- MPV
|
|
||||||
- Go
|
|
||||||
- Visual Studio 2022 (Desktop development with C++)
|
|
||||||
- [MSYS2/MinGW-w64 GCC](https://www.msys2.org/) (for CGO)
|
|
||||||
- [LLVM/Clang + libclang](https://clang.llvm.org/get_started.html) (for `ffigen`)
|
|
||||||
|
|
||||||
On Windows, make sure these are available in your shell `PATH`:
|
|
||||||
|
|
||||||
- `C:\msys64\ucrt64\bin` (or your MinGW bin path containing `x86_64-w64-mingw32-gcc.exe`)
|
|
||||||
- `C:\Program Files\LLVM\bin` (contains `clang.exe` and `libclang.dll`)
|
|
||||||
|
|
||||||
For `dart scripts/generate.dart`, you may also need:
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
$env:CPATH = "C:\msys64\ucrt64\include"
|
|
||||||
```
|
|
||||||
|
|
||||||
#### MacOS
|
|
||||||
|
|
||||||
Similar prerequisites apply (Flutter, Git, Go, C toolchain, LLVM/libclang), but exact setup has not been fully documented yet.
|
|
||||||
|
|
||||||
### Clone repo
|
|
||||||
|
|
||||||
First, clone and open the repo:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
git clone --recurse-submodules https://git.federated.nexus/Nexus/nexus
|
|
||||||
cd nexus
|
|
||||||
```
|
|
||||||
|
|
||||||
### Set up Flutter
|
### Set up Flutter
|
||||||
|
|
||||||
|
|
@ -122,23 +151,22 @@ Get dependencies:
|
||||||
flutter pub get
|
flutter pub get
|
||||||
```
|
```
|
||||||
|
|
||||||
Generate Gomuks bindings:
|
Get dependencies:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
dart scripts/generate.dart
|
flutter pub get
|
||||||
```
|
```
|
||||||
|
|
||||||
> [!NOTE]
|
Clone Gomuks and generate bindings:
|
||||||
> If you are having issues with `stddef.h` not being found, try setting CPATH manually:
|
|
||||||
>
|
```sh
|
||||||
> ```sh
|
scripts/generate.sh
|
||||||
> export CPATH="$(clang -v 2>&1 | grep "Selected GCC installation" | rev | cut -d' ' -f1 | rev)/include"
|
```
|
||||||
> ```
|
|
||||||
|
|
||||||
Build generated files, and watch for new changes:
|
Build generated files, and watch for new changes:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
flutter pub run build_runner watch
|
flutter pub run build_runner watch --delete-conflicting-outputs
|
||||||
```
|
```
|
||||||
|
|
||||||
Run the app:
|
Run the app:
|
||||||
|
|
@ -147,13 +175,6 @@ Run the app:
|
||||||
flutter run
|
flutter run
|
||||||
```
|
```
|
||||||
|
|
||||||
Development instructions can be found in [DEVELOPMENT.md](./DEVELOPMENT.md).
|
|
||||||
|
|
||||||
## Community
|
## Community
|
||||||
|
|
||||||
Join the [Nexus Client Matrix room](https://matrix.to/#/#nexus:federated.nexus) for questions or help with developing or using Nexus Client.
|
Join the [Nexus Client Matrix Room](https://matrix.to/#/#nexus:federated.nexus) for questions or help with developing or using Nexus Client.
|
||||||
|
|
||||||
## Credits
|
|
||||||
|
|
||||||
Thank you Hylke Bons (https://planetpeanut.studio) for making the amazing icon for Nexus!
|
|
||||||
Thank you Tulir Asokan for making [Gomuks](https://github.com/gomuks/gomuks), and helping us integrate it into Nexus!
|
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,6 @@ analyzer:
|
||||||
- "build/**"
|
- "build/**"
|
||||||
- "**/*.g.dart"
|
- "**/*.g.dart"
|
||||||
- "**/*.freezed.dart"
|
- "**/*.freezed.dart"
|
||||||
- android/**
|
|
||||||
- ios/**
|
|
||||||
- web/**
|
|
||||||
- windows/**
|
|
||||||
- macos/**
|
|
||||||
- linux/**
|
|
||||||
include: package:flutter_lints/flutter.yaml
|
include: package:flutter_lints/flutter.yaml
|
||||||
linter:
|
linter:
|
||||||
rules:
|
rules:
|
||||||
|
|
|
||||||
72
android/app/build.gradle
Normal file
72
android/app/build.gradle
Normal file
|
|
@ -0,0 +1,72 @@
|
||||||
|
plugins {
|
||||||
|
id "com.android.application"
|
||||||
|
id "kotlin-android"
|
||||||
|
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||||
|
id "dev.flutter.flutter-gradle-plugin"
|
||||||
|
}
|
||||||
|
|
||||||
|
def localProperties = new Properties()
|
||||||
|
def localPropertiesFile = rootProject.file("local.properties")
|
||||||
|
if (localPropertiesFile.exists()) {
|
||||||
|
localPropertiesFile.withReader("UTF-8") { reader ->
|
||||||
|
localProperties.load(reader)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
|
||||||
|
if (flutterVersionCode == null) {
|
||||||
|
flutterVersionCode = "1"
|
||||||
|
}
|
||||||
|
|
||||||
|
def flutterVersionName = localProperties.getProperty("flutter.versionName")
|
||||||
|
if (flutterVersionName == null) {
|
||||||
|
flutterVersionName = "1.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
def keystoreProperties = new Properties()
|
||||||
|
def keystorePropertiesFile = rootProject.file('key.properties')
|
||||||
|
if (keystorePropertiesFile.exists()) {
|
||||||
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace = "nexus.federated.Nexus"
|
||||||
|
ndkVersion = flutter.ndkVersion
|
||||||
|
compileSdk = 34
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId = "nexus.federated.Nexus"
|
||||||
|
minSdk = 29
|
||||||
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
|
versionCode = flutterVersionCode.toInteger()
|
||||||
|
versionName = flutterVersionName
|
||||||
|
}
|
||||||
|
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
keyAlias "key"
|
||||||
|
storeFile keystoreProperties['path'] ? file(keystoreProperties['path']) : file(System.getenv("KEYSTORE_PATH"))
|
||||||
|
keyPassword keystoreProperties['password'] ?: System.getenv("KEYSTORE_PASSWORD")
|
||||||
|
storePassword keystoreProperties['password'] ?: System.getenv("KEYSTORE_PASSWORD")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
|
|
||||||
|
debug {
|
||||||
|
applicationIdSuffix = ".debug"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
flutter {
|
||||||
|
source = "../.."
|
||||||
|
}
|
||||||
|
|
@ -1,84 +0,0 @@
|
||||||
import java.util.Properties
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
id("com.android.application")
|
|
||||||
id("dev.flutter.flutter-gradle-plugin")
|
|
||||||
}
|
|
||||||
|
|
||||||
val keystoreProperties = Properties()
|
|
||||||
val keystorePropertiesFile = rootProject.file("key.properties")
|
|
||||||
|
|
||||||
if (keystorePropertiesFile.exists()) {
|
|
||||||
keystorePropertiesFile.inputStream().use {
|
|
||||||
keystoreProperties.load(it)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
android {
|
|
||||||
namespace = "nexus.federated.nexus"
|
|
||||||
compileSdk = 36
|
|
||||||
ndkVersion = flutter.ndkVersion
|
|
||||||
|
|
||||||
compileOptions {
|
|
||||||
isCoreLibraryDesugaringEnabled = true
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_21
|
|
||||||
targetCompatibility = JavaVersion.VERSION_21
|
|
||||||
}
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
applicationId = "nexus.federated.nexus"
|
|
||||||
|
|
||||||
minSdk = 29
|
|
||||||
targetSdk = flutter.targetSdkVersion
|
|
||||||
|
|
||||||
versionCode = flutter.versionCode
|
|
||||||
versionName = flutter.versionName
|
|
||||||
|
|
||||||
multiDexEnabled = true
|
|
||||||
}
|
|
||||||
|
|
||||||
signingConfigs {
|
|
||||||
create("release") {
|
|
||||||
keyAlias = "key"
|
|
||||||
|
|
||||||
val storePath =
|
|
||||||
keystoreProperties["path"]?.toString()
|
|
||||||
?: System.getenv("KEYSTORE_PATH")
|
|
||||||
|
|
||||||
storeFile = storePath?.let { file(it) }
|
|
||||||
|
|
||||||
keyPassword =
|
|
||||||
keystoreProperties["password"]?.toString()
|
|
||||||
?: System.getenv("KEYSTORE_PASSWORD")
|
|
||||||
|
|
||||||
storePassword =
|
|
||||||
keystoreProperties["password"]?.toString()
|
|
||||||
?: System.getenv("KEYSTORE_PASSWORD")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
buildTypes {
|
|
||||||
release {
|
|
||||||
signingConfig = signingConfigs.getByName("release")
|
|
||||||
}
|
|
||||||
|
|
||||||
debug {
|
|
||||||
applicationIdSuffix = ".debug"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation("org.unifiedpush.android:embedded-fcm-distributor:3.1.0")
|
|
||||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
|
||||||
compilerOptions {
|
|
||||||
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
flutter {
|
|
||||||
source = "../.."
|
|
||||||
}
|
|
||||||
|
|
@ -1,20 +1,16 @@
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
|
||||||
<uses-permission
|
<uses-permission
|
||||||
android:name="android.permission.READ_EXTERNAL_STORAGE"
|
android:name="android.permission.READ_EXTERNAL_STORAGE"
|
||||||
android:maxSdkVersion="32" />
|
android:maxSdkVersion="32" />
|
||||||
<uses-permission
|
<uses-permission
|
||||||
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||||
android:maxSdkVersion="29" />
|
android:maxSdkVersion="29" />
|
||||||
<!-- Until https://github.com/flutter/flutter/issues/145290 is fixed, we need enableOnBackInvokedCallback as false -->
|
|
||||||
<application
|
<application
|
||||||
android:enableOnBackInvokedCallback="false"
|
|
||||||
android:label="Nexus"
|
android:label="Nexus"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:roundIcon="@mipmap/ic_launcher"
|
android:roundIcon="@mipmap/nexus_round"
|
||||||
android:allowBackup="false"
|
android:allowBackup="false"
|
||||||
android:fullBackupContent="false">
|
android:fullBackupContent="false">
|
||||||
<activity
|
<activity
|
||||||
|
|
@ -26,21 +22,6 @@
|
||||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||||
android:hardwareAccelerated="true"
|
android:hardwareAccelerated="true"
|
||||||
android:windowSoftInputMode="adjustResize">
|
android:windowSoftInputMode="adjustResize">
|
||||||
<meta-data android:name="flutter_deeplinking_enabled" android:value="false" />
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.VIEW" />
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
|
||||||
|
|
||||||
<data android:scheme="nexus.federated.nexus" />
|
|
||||||
</intent-filter>
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.VIEW" />
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
|
||||||
|
|
||||||
<data android:scheme="matrix" />
|
|
||||||
</intent-filter>
|
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="io.flutter.embedding.android.NormalTheme"
|
android:name="io.flutter.embedding.android.NormalTheme"
|
||||||
android:resource="@style/NormalTheme"
|
android:resource="@style/NormalTheme"
|
||||||
|
|
@ -60,16 +41,6 @@
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="flutterEmbedding"
|
android:name="flutterEmbedding"
|
||||||
android:value="2" />
|
android:value="2" />
|
||||||
<!-- Needed by pasteboard, for pasting files from the clipboard -->
|
|
||||||
<provider
|
|
||||||
android:name="androidx.core.content.FileProvider"
|
|
||||||
android:authorities="${applicationId}.provider"
|
|
||||||
android:exported="false"
|
|
||||||
android:grantUriPermissions="true">
|
|
||||||
<meta-data
|
|
||||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
|
||||||
android:resource="@xml/provider_paths" />
|
|
||||||
</provider>
|
|
||||||
</application>
|
</application>
|
||||||
<!-- Required to query activities that can process text, see:
|
<!-- Required to query activities that can process text, see:
|
||||||
https://developer.android.com/training/package-visibility and
|
https://developer.android.com/training/package-visibility and
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
package nexus.federated.Nexus
|
||||||
|
|
||||||
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
|
|
||||||
|
class MainActivity: FlutterActivity()
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
package nexus.federated.nexus
|
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import android.os.Bundle
|
|
||||||
import android.view.View
|
|
||||||
import android.view.WindowInsets
|
|
||||||
import android.view.WindowInsetsAnimation
|
|
||||||
import io.flutter.embedding.android.FlutterActivity
|
|
||||||
|
|
||||||
// TODO: Revert this commit once https://github.com/flutter/flutter/issues/191156 is fixed
|
|
||||||
class MainActivity: FlutterActivity() {
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
|
||||||
super.onCreate(savedInstanceState)
|
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) return
|
|
||||||
|
|
||||||
window.decorView.setWindowInsetsAnimationCallback(
|
|
||||||
object : WindowInsetsAnimation.Callback(DISPATCH_MODE_CONTINUE_ON_SUBTREE) {
|
|
||||||
override fun onProgress(
|
|
||||||
insets: WindowInsets,
|
|
||||||
runningAnimations: List<WindowInsetsAnimation>,
|
|
||||||
) = insets
|
|
||||||
|
|
||||||
override fun onEnd(animation: WindowInsetsAnimation) {
|
|
||||||
if ((animation.typeMask and WindowInsets.Type.ime()) != 0) reapplyInsets()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onWindowFocusChanged(hasFocus: Boolean) {
|
|
||||||
super.onWindowFocusChanged(hasFocus)
|
|
||||||
if (hasFocus && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) reapplyInsets()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Posted so it runs after Flutter has applied any insets it deferred.
|
|
||||||
private fun reapplyInsets() {
|
|
||||||
val view = findViewById<View>(FLUTTER_VIEW_ID) ?: return
|
|
||||||
view.post { view.rootWindowInsets?.let(view::onApplyWindowInsets) }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.5 KiB |
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue