forked from Nexus/nexus
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
0a09a4ee0a |
|||
|
62e200f305 |
|||
|
dd01ad9d74 |
|||
|
853116ab2f |
|||
|
53d9c2b1e6 |
|||
|
401b527714 |
|||
|
3754bc2feb |
|||
|
868023a4a1 |
|||
|
9e6951818a |
|||
|
0743c4cfc6 |
|||
|
6336764da0 |
|||
|
3a39f1c5ac |
|||
|
6e2d56ec75 |
|||
|
4e140e9fc7 |
|||
|
e5dd53ed6c |
|||
|
c0f4c053b0 |
|||
|
ee36a9b1c8 |
|||
|
f5371382d7 |
|||
|
2937c241e0 |
|||
|
9dcddb3fbe |
|||
|
3014a9d029 |
|||
|
4a9f151d92 |
|||
|
d4ae5ebccf |
|||
|
850bd33b18 |
|||
|
8fbfcde9c5 |
|||
|
e0b5dc58d0 |
|||
|
ffbf2722f7 |
|||
|
3e1552f246 |
|||
|
44a1ec667e |
|||
|
479279b68e |
|||
|
b0dd452926 |
|||
|
fcfe4eed1e |
|||
|
b390dbbbe1 |
|||
|
8e51852ae3 |
|||
|
48c04d9b3e |
|||
|
7f30150e95 |
|||
|
c8e1aef74b |
|||
|
5ee3449f02 |
|||
|
1715ee785e |
|||
|
e38307657d |
|||
|
e14ab3e708 |
|||
|
f5645db6ea |
|||
|
0fcbc275cd |
|||
|
a54004736b |
|||
|
427e06be3e |
|||
|
a1a15af30d |
|||
| 800fb5566d | |||
|
80197aff00 |
|||
|
78162efbde |
|||
|
a2906746b9 |
|||
|
6659f21ceb |
|||
|
a065b823bb |
|||
|
765e96cce4 |
|||
|
9cf16db669 |
|||
|
2c8a4da2a8 |
|||
|
cb426cd27e |
|||
|
bfd259543d |
|||
|
9f0b80072d |
|||
|
b6ee5aec64 |
|||
|
deac9ef24e |
|||
|
e24e99fd8e |
|||
|
4580110da0 |
|||
|
d1724932b2 |
|||
|
a6fe80fea2 |
|||
|
9f45cbc1e7 |
|||
|
eca2b0b558 |
|||
|
4e6ba571fc |
|||
|
200e03f082 |
|||
|
8180338d99 |
|||
|
72c5e7d819 |
|||
|
254b7e134f |
|||
|
ef25e765d4 |
|||
|
58a27fdd9e |
|||
|
6d42477041 |
|||
|
2f17f5b6c6 |
|||
|
1380233f2e |
|||
|
a3a3781252 |
|||
|
81851bdc42 |
|||
|
f19a51939c |
|||
|
0ad85f24d5 |
|||
|
1c2ba2971b |
|||
|
fb0af571ed |
|||
|
9cd43f4e3c |
|||
|
0fa0f57738 |
|||
|
00f22d46b7 |
|||
|
23046f08a9 |
|||
|
784e5254e2 |
|||
|
7193ac0dba |
|||
|
7ab4b5e59f |
|||
|
c23dc19c6e |
|||
|
0b79aac7af |
|||
|
e4f290eaa6 |
|||
|
d309754c60 |
|||
|
a5dedb0d38 |
|||
|
659e76b8f8 |
|||
|
ab3eda0beb |
|||
|
b71a7f0bd6 |
|||
|
8d944831f5 |
|||
|
9117663c48 |
|||
|
ba258c2fcd |
|||
|
485383e99c |
|||
|
ed84410039 |
|||
|
df592b3f38 |
|||
|
d47c4ae15c |
|||
|
d308ef98cb |
|||
|
f082a75d9c |
|||
|
36f61a62d8 |
|||
|
27137c488d |
|||
|
ce5c7b972b |
|||
|
76d78596cd |
|||
|
ed2d08ed40 |
|||
|
24e516e6dd |
|||
|
66a437094a |
|||
|
d37ec2878b |
|||
|
dbf30c3706 |
|||
|
2d619bf1ad |
|||
|
07700c1eff |
|||
|
a5fef138dd |
|||
|
7353955d4e |
|||
|
012ecd9249 |
|||
|
8fda43ccf8 |
|||
|
3a33bf7bfe |
|||
|
9237a3dbed |
|||
|
30a5fa100c |
|||
|
f198888635 |
|||
|
be945031cd |
263 changed files with 11833 additions and 3580 deletions
4
.github/workflows/android.yml
vendored
4
.github/workflows/android.yml
vendored
|
|
@ -27,7 +27,7 @@ jobs:
|
||||||
KEYSTORE_CONTENT: ${{ secrets.KEYSTORE_CONTENT }}
|
KEYSTORE_CONTENT: ${{ secrets.KEYSTORE_CONTENT }}
|
||||||
|
|
||||||
- name: Build app
|
- 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 --dart-define=GIT_COMMIT=${{ github.sha }}"
|
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:
|
env:
|
||||||
KEYSTORE_PATH: ../../keystore.jks
|
KEYSTORE_PATH: ../../keystore.jks
|
||||||
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
||||||
|
|
@ -36,4 +36,4 @@ jobs:
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v6
|
||||||
with:
|
with:
|
||||||
name: APK
|
name: APK
|
||||||
path: build/app/outputs/flutter-apk/app-release.apk
|
path: build/app/outputs/flutter-apk/app-arm64-v8a-release.apk
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,8 @@ 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.
|
We use an object oriented style for controllers, where `provider` is a static member on the controller class. E.g.
|
||||||
|
|
||||||
```dart
|
```dart
|
||||||
class MyController extends AsyncNotifier<DataThisControllerExposes> {
|
class MyController(final SomeInputType input)
|
||||||
final SomeInputType input;
|
extends AsyncNotifier<DataThisControllerExposes> {
|
||||||
MyController(this.input);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<DataThisControllerExposes> build() async {
|
Future<DataThisControllerExposes> build() async {
|
||||||
return input.foo;
|
return input.foo;
|
||||||
|
|
@ -38,11 +36,17 @@ class MyController extends AsyncNotifier<DataThisControllerExposes> {
|
||||||
|
|
||||||
static final provider =
|
static final provider =
|
||||||
AsyncNotifierProvider.family<MyController, DataThisControllerExposes, SomeInputType>(
|
AsyncNotifierProvider.family<MyController, DataThisControllerExposes, SomeInputType>(
|
||||||
AuthorController.new,
|
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/`.
|
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))
|
### Don't use StatefulWidgets ([Flutter Hooks](https://pub.dev/packages/flutter_hooks))
|
||||||
|
|
@ -61,6 +65,36 @@ When possible, use immutable collections instead of the mutable equivalent. For
|
||||||
|
|
||||||
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.
|
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/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.
|
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.
|
||||||
|
|
|
||||||
129
README.md
129
README.md
|
|
@ -1,8 +1,5 @@
|
||||||
# Nexus Client
|
# Nexus Client
|
||||||
|
|
||||||
> [!WARNING]
|
|
||||||
> Nexus Client is still in development, and doesn't support everything needed for daily 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 a Gomuks backend.
|
||||||
|
|
@ -13,113 +10,13 @@ A simple and user-friendly Matrix client made with Flutter and a Gomuks backend.
|
||||||
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------: |
|
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------: |
|
||||||
|  |  |
|
|  |  |
|
||||||
|
|
||||||
## Progress
|
|
||||||
|
|
||||||
- [x] Platform Support
|
|
||||||
- [x] Linux
|
|
||||||
- [x] Notifications through UnifiedPush
|
|
||||||
- [x] Windows
|
|
||||||
- [ ] Background notifications
|
|
||||||
- [x] Android
|
|
||||||
- [x] Notifications through UnifiedPush
|
|
||||||
- [x] Notifications through FCM
|
|
||||||
- [x] MacOS
|
|
||||||
- [x] Unsigned .ipa
|
|
||||||
- [ ] App Store
|
|
||||||
- [ ] Background notifications
|
|
||||||
- [x] iOS
|
|
||||||
- [x] Unsigned .ipa
|
|
||||||
- [ ] App Store
|
|
||||||
- [ ] Background notifications
|
|
||||||
- [ ] Web (may not be possible)
|
|
||||||
- [x] Login (via OAuth)
|
|
||||||
- [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
|
|
||||||
- [x] Parse vias
|
|
||||||
- [x] Using a text/uri/link
|
|
||||||
- [x] Plain text
|
|
||||||
- [x] `matrix:` Uri
|
|
||||||
- [x] Matrix.to link
|
|
||||||
- [ ] From space
|
|
||||||
- [ ] From directory
|
|
||||||
- [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
|
|
||||||
- [x] Per message profiles
|
|
||||||
- [x] Attachments
|
|
||||||
- [ ] Commands with [MSC4391](https://github.com/matrix-org/matrix-spec-proposals/pull/4391)
|
|
||||||
- [x] Tags
|
|
||||||
- [x] Users
|
|
||||||
- [x] Rooms
|
|
||||||
- [x] Emojis
|
|
||||||
- [ ] Custom emojis/stickers
|
|
||||||
- [ ] GIFs using Gomuks' GIF proxies
|
|
||||||
- [x] Receiving
|
|
||||||
- [x] Plain text
|
|
||||||
- [x] Per message profiles
|
|
||||||
- [x] HTML
|
|
||||||
- [x] URL Previews
|
|
||||||
- [x] Replies
|
|
||||||
- [x] Viewing
|
|
||||||
- [x] Jump to original message
|
|
||||||
- [x] Edits
|
|
||||||
- [x] Attachments
|
|
||||||
- [x] Unencrypted
|
|
||||||
- [x] Encrypted
|
|
||||||
- [x] Blurhashing
|
|
||||||
- [ ] Downloading attachments
|
|
||||||
- [x] Opening attachments in their own view
|
|
||||||
- [ ] Polls
|
|
||||||
- [x] Mentions
|
|
||||||
- [x] Users
|
|
||||||
- [x] Clickable
|
|
||||||
- [x] Rooms
|
|
||||||
- [x] Clickable
|
|
||||||
- [x] Matrix URIs
|
|
||||||
- [x] Matrix.to links
|
|
||||||
- [x] Events
|
|
||||||
- [x] Custom emojis/stickers
|
|
||||||
- [x] History loading
|
|
||||||
- [x] Editing
|
|
||||||
- [x] Deleting
|
|
||||||
- [x] Reactions
|
|
||||||
- [x] Pins
|
|
||||||
- [x] Displaying
|
|
||||||
- [x] Pinning/Unpinning
|
|
||||||
- [ ] Threads
|
|
||||||
- [x] Profile popouts
|
|
||||||
- [x] Working actions
|
|
||||||
- [x] Copy link to:
|
|
||||||
- [x] Room
|
|
||||||
- [x] Space
|
|
||||||
- [x] Message
|
|
||||||
- [ ] Reporting
|
|
||||||
- [x] Events
|
|
||||||
- [ ] Rooms
|
|
||||||
- [x] Member list
|
|
||||||
- [x] Sort by power level
|
|
||||||
- [ ] Colors based off of power level
|
|
||||||
- [x] Notifications using UnifiedPush ([#35](https://git.federated.nexus/Nexus/nexus/issues/35))
|
|
||||||
- [x] Notifications page
|
|
||||||
- [ ] Group calls using [MSC4195](https://github.com/matrix-org/matrix-spec-proposals/pull/4195)
|
|
||||||
- [ ] Invites
|
|
||||||
- [x] Settings
|
|
||||||
|
|
||||||
## Try it out
|
## Try it out
|
||||||
|
|
||||||
If you want to try out Nexus, grab one of the following artifacts from CI:
|
If you want to try out Nexus, download the [latest release](https://git.federated.nexus/Nexus/nexus/releases/latest).
|
||||||
|
|
||||||
|
### Nightly Builds
|
||||||
|
|
||||||
|
For the newest changes, grab one of the following nightly artifacts, built by CI from the latest commit on `main`.
|
||||||
|
|
||||||
- [Android APK](https://nightly.link/Henry-Hiles/nexus/workflows/android/main/APK.zip)
|
- [Android APK](https://nightly.link/Henry-Hiles/nexus/workflows/android/main/APK.zip)
|
||||||
- [Unsigned iOS IPA](https://nightly.link/Henry-Hiles/nexus/workflows/ios/main/Nexus.ipa.zip)
|
- [Unsigned iOS IPA](https://nightly.link/Henry-Hiles/nexus/workflows/ios/main/Nexus.ipa.zip)
|
||||||
|
|
@ -128,7 +25,7 @@ If you want to try out Nexus, grab one of the following artifacts from CI:
|
||||||
|
|
||||||
Or, use one of the below methods:
|
Or, use one of the below methods:
|
||||||
|
|
||||||
### Flatpak
|
### Nightly Flatpak Repo
|
||||||
|
|
||||||
Make sure Flatpak is set up on your system, then run:
|
Make sure Flatpak is set up on your system, then run:
|
||||||
|
|
||||||
|
|
@ -149,6 +46,12 @@ nexus = {
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
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.0";
|
||||||
|
```
|
||||||
|
|
||||||
Then import the module and enable it in your NixOS configuration:
|
Then import the module and enable it in your NixOS configuration:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
|
@ -232,12 +135,6 @@ dart scripts/generate.dart
|
||||||
> export CPATH="$(clang -v 2>&1 | grep "Selected GCC installation" | rev | cut -d' ' -f1 | rev)/include"
|
> export CPATH="$(clang -v 2>&1 | grep "Selected GCC installation" | rev | cut -d' ' -f1 | rev)/include"
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
Build webcrypto:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
flutter pub run webcrypto:setup
|
|
||||||
```
|
|
||||||
|
|
||||||
Build generated files, and watch for new changes:
|
Build generated files, and watch for new changes:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
|
@ -256,7 +153,7 @@ Development instructions can be found in [DEVELOPMENT.md](./DEVELOPMENT.md).
|
||||||
|
|
||||||
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
|
## Credits
|
||||||
|
|
||||||
Thank you Hylke Bons (https://planetpeanut.studio) for making the amazing icon for Nexus!
|
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!
|
Thank you Tulir Asokan for making [Gomuks](https://github.com/gomuks/gomuks), and helping us integrate it into Nexus!
|
||||||
|
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
{
|
|
||||||
"name": "Nexus",
|
|
||||||
"identifier": "nexus.federated.nexus.source",
|
|
||||||
"subtitle": "Nexus for iOS",
|
|
||||||
"description": "Nexus iOS builds for AltStore and SideStore.",
|
|
||||||
"iconURL": "https://git.federated.nexus/Nexus/nexus/raw/branch/main/assets/icon.png",
|
|
||||||
"website": "https://git.federated.nexus/Nexus/nexus",
|
|
||||||
"apps": [
|
|
||||||
{
|
|
||||||
"name": "Nexus",
|
|
||||||
"bundleIdentifier": "nexus.federated.nexus",
|
|
||||||
"developerName": "Nexus",
|
|
||||||
"subtitle": "A Matrix client",
|
|
||||||
"localizedDescription": "Nexus for iOS. Unsigned builds, resigned at install by AltStore/SideStore.",
|
|
||||||
"iconURL": "https://git.federated.nexus/Nexus/nexus/raw/branch/main/assets/icon.png",
|
|
||||||
"category": "social",
|
|
||||||
"screenshots": [],
|
|
||||||
"versions": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"news": []
|
|
||||||
}
|
|
||||||
|
|
@ -51,6 +51,16 @@
|
||||||
<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
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
package nexus.federated.nexus
|
|
||||||
|
|
||||||
import io.flutter.embedding.android.FlutterActivity
|
|
||||||
|
|
||||||
class MainActivity: FlutterActivity()
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
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) }
|
||||||
|
}
|
||||||
|
}
|
||||||
6
android/app/src/main/res/xml/provider_paths.xml
Normal file
6
android/app/src/main/res/xml/provider_paths.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<paths xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<external-path
|
||||||
|
name="external_files"
|
||||||
|
path="." />
|
||||||
|
</paths>
|
||||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 615 KiB After Width: | Height: | Size: 246 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 616 KiB After Width: | Height: | Size: 251 KiB |
0
assets/twim/.gitkeep
Normal file
0
assets/twim/.gitkeep
Normal file
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB |
11
flake.lock
generated
11
flake.lock
generated
|
|
@ -42,16 +42,15 @@
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1790870263,
|
"lastModified": 1791751882,
|
||||||
"narHash": "sha256-ZBblCzxsUBBCZJRJR0knnaOt2+Xl5JGfI+YkGPf2SI4=",
|
"narHash": "sha256-DWcMlQFQMEqQGAHU6rAbl4uKWmlJMR1HZG0BvH0H2fk=",
|
||||||
"owner": "Henry-Hiles",
|
"owner": "neobrain",
|
||||||
"repo": "nix2flatpak",
|
"repo": "nix2flatpak",
|
||||||
"rev": "2ef0e3cde2bdce0870f79a7568a72c2681ad20b5",
|
"rev": "7731e8b3fca73879f8217de5a919c0a5d17303de",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "Henry-Hiles",
|
"owner": "neobrain",
|
||||||
"ref": "quad/nexus",
|
|
||||||
"repo": "nix2flatpak",
|
"repo": "nix2flatpak",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
self.submodules = true;
|
self.submodules = true;
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
nix2flatpak.url = "github:Henry-Hiles/nix2flatpak/quad/nexus";
|
nix2flatpak.url = "github:neobrain/nix2flatpak";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
|
|
|
||||||
2
gomuks
2
gomuks
|
|
@ -1 +1 @@
|
||||||
Subproject commit 38e5033c3a91db0cbea6cbd9f0feef9ff6441038
|
Subproject commit 53cae0e0334aef5ac376ea84f19ba1cff8a92310
|
||||||
|
|
@ -122,7 +122,7 @@ Future<void> main(List<String> args) => build(args, (input, output) async {
|
||||||
"sqlite_fts5",
|
"sqlite_fts5",
|
||||||
"goolm",
|
"goolm",
|
||||||
// goheif/dav1d is not supported on Android or iOS, would need to be fixed upstream
|
// goheif/dav1d is not supported on Android or iOS, would need to be fixed upstream
|
||||||
if (targetOS == OS.android || targetOS == OS.iOS) "noheic",
|
"noheic",
|
||||||
].join(",");
|
].join(",");
|
||||||
|
|
||||||
final archiveFile = targetOS == OS.iOS
|
final archiveFile = targetOS == OS.iOS
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import "dart:convert";
|
import "dart:convert";
|
||||||
|
|
||||||
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||||
|
import "package:flutter/foundation.dart";
|
||||||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||||
import "package:nexus/models/account_data.dart";
|
import "package:nexus/models/account_data.dart";
|
||||||
|
|
||||||
|
|
@ -9,11 +10,16 @@ class AccountDataController extends Notifier<AccountData> {
|
||||||
AccountData build() => .new();
|
AccountData build() => .new();
|
||||||
|
|
||||||
void update(IMap<String, IMap<String, dynamic>> newAccountData) =>
|
void update(IMap<String, IMap<String, dynamic>> newAccountData) =>
|
||||||
state = .fromJson({
|
state = newAccountData.entries.fold(state, (data, entry) {
|
||||||
...json.decode(json.encode(state.toJson())),
|
try {
|
||||||
...newAccountData
|
return .fromJson({
|
||||||
.map((key, value) => MapEntry(key, value["content"]))
|
...json.decode(json.encode(data.toJson())),
|
||||||
.unlock,
|
entry.key: entry.value["content"],
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
debugPrint("Ignoring invalid ${entry.key} account data: $error");
|
||||||
|
return data;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
static final provider = NotifierProvider<AccountDataController, AccountData>(
|
static final provider = NotifierProvider<AccountDataController, AccountData>(
|
||||||
|
|
|
||||||
25
lib/controllers/all_emoji.dart
Normal file
25
lib/controllers/all_emoji.dart
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||||
|
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||||
|
import "package:material_emoji_picker/material_emoji_picker.dart";
|
||||||
|
import "package:nexus/controllers/image_packs.dart";
|
||||||
|
import "package:nexus/helpers/extensions/image_pack_emoji.dart";
|
||||||
|
|
||||||
|
class AllEmojiController(final String roomId)
|
||||||
|
extends AsyncNotifier<IList<EmojiCategory>> {
|
||||||
|
@override
|
||||||
|
Future<IList<EmojiCategory>> build() async {
|
||||||
|
final packs = await ref.watch(ImagePacksController.provider(roomId).future);
|
||||||
|
final unicode = await ref.watch(EmojiController.provider.future);
|
||||||
|
|
||||||
|
return packs
|
||||||
|
.map((pack) => pack.emojiCategory)
|
||||||
|
.nonNulls
|
||||||
|
.toIList()
|
||||||
|
.addAll(unicode);
|
||||||
|
}
|
||||||
|
|
||||||
|
static final provider = AsyncNotifierProvider.autoDispose
|
||||||
|
.family<AllEmojiController, IList<EmojiCategory>, String>(
|
||||||
|
AllEmojiController.new,
|
||||||
|
);
|
||||||
|
}
|
||||||
18
lib/controllers/app_paused.dart
Normal file
18
lib/controllers/app_paused.dart
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
import "package:flutter/widgets.dart";
|
||||||
|
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||||
|
|
||||||
|
class AppPausedController extends Notifier<bool> {
|
||||||
|
@override
|
||||||
|
bool build() {
|
||||||
|
final listener = AppLifecycleListener(
|
||||||
|
onPause: () => state = true,
|
||||||
|
onResume: () => state = false,
|
||||||
|
);
|
||||||
|
ref.onDispose(listener.dispose);
|
||||||
|
return WidgetsBinding.instance.lifecycleState == .paused;
|
||||||
|
}
|
||||||
|
|
||||||
|
static final provider = NotifierProvider<AppPausedController, bool>(
|
||||||
|
AppPausedController.new,
|
||||||
|
);
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue