Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d0df1a198b | ||
|
|
cc050f62fc | ||
|
|
f72c59f79d | ||
|
|
32393f12c0 |
11 changed files with 173 additions and 20 deletions
22
README.md
22
README.md
|
|
@ -36,7 +36,7 @@ A simple and user-friendly Matrix client made with Flutter and the Matrix Dart S
|
||||||
- [x] Using a text/uri/link
|
- [x] Using a text/uri/link
|
||||||
- [x] Plain text
|
- [x] Plain text
|
||||||
- [x] `matrix:` Uri
|
- [x] `matrix:` Uri
|
||||||
- [ ] Matrix.to link: I just need to fix my regex, I should do this next.
|
- [ ] Matrix.to link: I just need to fix my regex
|
||||||
- [ ] From space
|
- [ ] From space
|
||||||
- [ ] Exploring
|
- [ ] Exploring
|
||||||
- [x] Leaving
|
- [x] Leaving
|
||||||
|
|
@ -108,7 +108,7 @@ A simple and user-friendly Matrix client made with Flutter and the Matrix Dart S
|
||||||
- [ ] About
|
- [ ] About
|
||||||
- [x] Log Out
|
- [x] Log Out
|
||||||
|
|
||||||
## Build Instructions
|
## Development
|
||||||
|
|
||||||
First, clone and open the repo:
|
First, clone and open the repo:
|
||||||
|
|
||||||
|
|
@ -122,13 +122,13 @@ cd nexus
|
||||||
#### Linux
|
#### Linux
|
||||||
|
|
||||||
- With Nix: Either use direnv, or `nix flake develop`
|
- With Nix: Either use direnv, or `nix flake develop`
|
||||||
- Without Nix: Install Flutter, Go, Olm, Git, Clang, and GLibc.
|
- Without Nix: Install Flutter, Rust, the libsecret dev package for your distro (must be in `PKG_CONFIG_PATH`), and sqlite (must be in `LD_LIBRARY_PATH`).
|
||||||
|
|
||||||
#### Windows / MacOS
|
#### Windows / MacOS
|
||||||
|
|
||||||
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.
|
I don't really know. You will need Flutter and Rust, and otherwise I guess just keep installing stuff until there aren't any errors.
|
||||||
|
|
||||||
### Set up Flutter
|
###
|
||||||
|
|
||||||
Get dependencies:
|
Get dependencies:
|
||||||
|
|
||||||
|
|
@ -136,18 +136,6 @@ Get dependencies:
|
||||||
flutter pub get
|
flutter pub get
|
||||||
```
|
```
|
||||||
|
|
||||||
Get dependencies:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
flutter pub get
|
|
||||||
```
|
|
||||||
|
|
||||||
Clone Gomuks and generate bindings:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
scripts/generate.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
Build generated files, and watch for new changes:
|
Build generated files, and watch for new changes:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
|
|
||||||
41
flake.nix
41
flake.nix
|
|
@ -29,6 +29,22 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
src = ./.;
|
||||||
|
|
||||||
|
# from https://discourse.nixos.org/t/is-there-a-way-to-read-a-yaml-file-and-get-back-a-set/18385/5
|
||||||
|
importYAML =
|
||||||
|
file:
|
||||||
|
lib.importJSON (
|
||||||
|
pkgs.runCommand "converted-yaml.json" { } ''${pkgs.yj}/bin/yj < "${file}" > "$out"''
|
||||||
|
);
|
||||||
|
|
||||||
|
package = importYAML "${src}/pubspec.yaml";
|
||||||
|
|
||||||
|
usedFlutter = (pkgs.flutter.override { extraPkgConfigPackages = [ pkgs.libsecret ]; });
|
||||||
|
|
||||||
|
buildInputs = [ pkgs.sqlite ];
|
||||||
|
in
|
||||||
{
|
{
|
||||||
_module.args.pkgs = import nixpkgs {
|
_module.args.pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
|
|
@ -45,14 +61,35 @@
|
||||||
olm
|
olm
|
||||||
git
|
git
|
||||||
clang
|
clang
|
||||||
flutter
|
usedFlutter
|
||||||
|
|
||||||
|
(pkgs.writeShellScriptBin "rustup" (builtins.readFile ./nix/fake-rustup.sh))
|
||||||
];
|
];
|
||||||
|
|
||||||
env = {
|
env = {
|
||||||
LD_LIBRARY_PATH = "./build/native_assets/linux";
|
LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}:./build/native_assets/linux";
|
||||||
CPATH = lib.makeSearchPath "include" [ pkgs.glibc.dev ];
|
CPATH = lib.makeSearchPath "include" [ pkgs.glibc.dev ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
packages.default = usedFlutter.buildFlutterApplication {
|
||||||
|
inherit src buildInputs;
|
||||||
|
pname = package.name;
|
||||||
|
version = package.version;
|
||||||
|
|
||||||
|
pubspecLock = importYAML "${src}/pubspec.lock";
|
||||||
|
gitHashes = {
|
||||||
|
flutter_chat_ui = "sha256-4fuag7lRH5cMBFD3fUzj2K541JwXLoz8HF/4OMr3uhk=";
|
||||||
|
flutter_link_previewer = "sha256-4fuag7lRH5cMBFD3fUzj2K541JwXLoz8HF/4OMr3uhk=";
|
||||||
|
flyer_chat_text_message = "sha256-4fuag7lRH5cMBFD3fUzj2K541JwXLoz8HF/4OMr3uhk=";
|
||||||
|
window_size = "sha256-XelNtp7tpZ91QCEcvewVphNUtgQX7xrp5QP0oFo6DgM=";
|
||||||
|
};
|
||||||
|
|
||||||
|
patchPhase = /* sh */ ''
|
||||||
|
patchShebangs ./scripts/generate.sh
|
||||||
|
./scripts/generate.sh # note: this doesn't quit the build on fail
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
19
lib/controllers/secure_storage_controller.dart
Normal file
19
lib/controllers/secure_storage_controller.dart
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||||
|
import "package:flutter_secure_storage/flutter_secure_storage.dart";
|
||||||
|
|
||||||
|
class SecureStorageController extends Notifier<FlutterSecureStorage> {
|
||||||
|
@override
|
||||||
|
FlutterSecureStorage build() => FlutterSecureStorage();
|
||||||
|
|
||||||
|
Future<String?> get(String key) => state.read(key: key);
|
||||||
|
|
||||||
|
Future<void> set(String key, String value) =>
|
||||||
|
state.write(key: key, value: value);
|
||||||
|
|
||||||
|
Future<void> clear() => state.deleteAll();
|
||||||
|
|
||||||
|
static final provider =
|
||||||
|
NotifierProvider<SecureStorageController, FlutterSecureStorage>(
|
||||||
|
SecureStorageController.new,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -1,11 +1,18 @@
|
||||||
import "package:flutter/material.dart";
|
import "package:flutter/material.dart";
|
||||||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||||
|
import "package:nexus/controllers/secure_storage_controller.dart";
|
||||||
|
|
||||||
class SettingsPage extends ConsumerWidget {
|
class SettingsPage extends ConsumerWidget {
|
||||||
const SettingsPage({super.key});
|
const SettingsPage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
return Placeholder();
|
return Scaffold(
|
||||||
|
appBar: AppBar(title: Text("Settings")),
|
||||||
|
body: ElevatedButton(
|
||||||
|
onPressed: ref.watch(SecureStorageController.provider.notifier).clear,
|
||||||
|
child: Text("Log out"),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include <dynamic_system_colors/dynamic_color_plugin.h>
|
#include <dynamic_system_colors/dynamic_color_plugin.h>
|
||||||
#include <file_selector_linux/file_selector_plugin.h>
|
#include <file_selector_linux/file_selector_plugin.h>
|
||||||
|
#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
|
||||||
#include <screen_retriever_linux/screen_retriever_linux_plugin.h>
|
#include <screen_retriever_linux/screen_retriever_linux_plugin.h>
|
||||||
#include <url_launcher_linux/url_launcher_plugin.h>
|
#include <url_launcher_linux/url_launcher_plugin.h>
|
||||||
#include <window_manager/window_manager_plugin.h>
|
#include <window_manager/window_manager_plugin.h>
|
||||||
|
|
@ -20,6 +21,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
|
||||||
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
|
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
|
||||||
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
|
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
|
||||||
|
g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =
|
||||||
|
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");
|
||||||
|
flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);
|
||||||
g_autoptr(FlPluginRegistrar) screen_retriever_linux_registrar =
|
g_autoptr(FlPluginRegistrar) screen_retriever_linux_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverLinuxPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverLinuxPlugin");
|
||||||
screen_retriever_linux_plugin_register_with_registrar(screen_retriever_linux_registrar);
|
screen_retriever_linux_plugin_register_with_registrar(screen_retriever_linux_registrar);
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
dynamic_system_colors
|
dynamic_system_colors
|
||||||
file_selector_linux
|
file_selector_linux
|
||||||
|
flutter_secure_storage_linux
|
||||||
screen_retriever_linux
|
screen_retriever_linux
|
||||||
url_launcher_linux
|
url_launcher_linux
|
||||||
window_manager
|
window_manager
|
||||||
|
|
|
||||||
35
nix/fake-rustup.sh
Normal file
35
nix/fake-rustup.sh
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# Fake rustup for nix-managed Rust toolchains
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
run)
|
||||||
|
if [[ "$2" == "stable" ]]; then
|
||||||
|
shift 2
|
||||||
|
if [[ $# -eq 0 ]]; then
|
||||||
|
echo "fake rustup: no command given" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
exec "$@"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
toolchain)
|
||||||
|
if [[ "$2" == "list" ]]; then
|
||||||
|
echo "stable (default)"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
target)
|
||||||
|
if [[ "$2" == "list" && "$3" == "--toolchain" && "$4" == "stable" && "$5" == "--installed" ]]; then
|
||||||
|
echo "x86_64-unknown-linux-gnu"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "fake rustup: the command:" >&2
|
||||||
|
echo " rustup $*" >&2
|
||||||
|
echo "…is not mocked yet" >&2
|
||||||
|
exit 1
|
||||||
56
pubspec.lock
56
pubspec.lock
|
|
@ -533,6 +533,54 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.0"
|
version: "3.1.0"
|
||||||
|
flutter_secure_storage:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_secure_storage
|
||||||
|
sha256: da922f2aab2d733db7e011a6bcc4a825b844892d4edd6df83ff156b09a9b2e40
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "10.0.0"
|
||||||
|
flutter_secure_storage_darwin:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_secure_storage_darwin
|
||||||
|
sha256: "8878c25136a79def1668c75985e8e193d9d7d095453ec28730da0315dc69aee3"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.2.0"
|
||||||
|
flutter_secure_storage_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_secure_storage_linux
|
||||||
|
sha256: "2b5c76dce569ab752d55a1cee6a2242bcc11fdba927078fb88c503f150767cda"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.0"
|
||||||
|
flutter_secure_storage_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_secure_storage_platform_interface
|
||||||
|
sha256: "8ceea1223bee3c6ac1a22dabd8feefc550e4729b3675de4b5900f55afcb435d6"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.1"
|
||||||
|
flutter_secure_storage_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_secure_storage_web
|
||||||
|
sha256: "6a1137df62b84b54261dca582c1c09ea72f4f9a4b2fcee21b025964132d5d0c3"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.0"
|
||||||
|
flutter_secure_storage_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_secure_storage_windows
|
||||||
|
sha256: "3b7c8e068875dfd46719ff57c90d8c459c87f2302ed6b00ff006b3c9fcad1613"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.1.0"
|
||||||
flutter_svg:
|
flutter_svg:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
@ -880,6 +928,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.11.1"
|
version: "0.11.1"
|
||||||
|
mention_tag_text_field:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: mention_tag_text_field
|
||||||
|
sha256: ba7b9d8003e0f340a65c6dcdb7770f4340f653ae1612a9e31e11d12f7f1dd80f
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.0.9"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,9 @@ dependencies:
|
||||||
flutter_svg: ^2.2.2
|
flutter_svg: ^2.2.2
|
||||||
json_annotation: ^4.9.0
|
json_annotation: ^4.9.0
|
||||||
shared_preferences: ^2.5.3
|
shared_preferences: ^2.5.3
|
||||||
|
mention_tag_text_field: ^0.0.9
|
||||||
fluttertagger: ^2.3.1
|
fluttertagger: ^2.3.1
|
||||||
|
flutter_secure_storage: ^10.0.0
|
||||||
dynamic_polls: ^0.0.6
|
dynamic_polls: ^0.0.6
|
||||||
flutter_hooks: ^0.21.3+1
|
flutter_hooks: ^0.21.3+1
|
||||||
cross_cache: ^1.1.0
|
cross_cache: ^1.1.0
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include <dynamic_system_colors/dynamic_color_plugin_c_api.h>
|
#include <dynamic_system_colors/dynamic_color_plugin_c_api.h>
|
||||||
#include <file_selector_windows/file_selector_windows.h>
|
#include <file_selector_windows/file_selector_windows.h>
|
||||||
|
#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
|
||||||
#include <screen_retriever_windows/screen_retriever_windows_plugin_c_api.h>
|
#include <screen_retriever_windows/screen_retriever_windows_plugin_c_api.h>
|
||||||
#include <url_launcher_windows/url_launcher_windows.h>
|
#include <url_launcher_windows/url_launcher_windows.h>
|
||||||
#include <window_manager/window_manager_plugin.h>
|
#include <window_manager/window_manager_plugin.h>
|
||||||
|
|
@ -18,6 +19,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
registry->GetRegistrarForPlugin("DynamicColorPluginCApi"));
|
registry->GetRegistrarForPlugin("DynamicColorPluginCApi"));
|
||||||
FileSelectorWindowsRegisterWithRegistrar(
|
FileSelectorWindowsRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("FileSelectorWindows"));
|
registry->GetRegistrarForPlugin("FileSelectorWindows"));
|
||||||
|
FlutterSecureStorageWindowsPluginRegisterWithRegistrar(
|
||||||
|
registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));
|
||||||
ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar(
|
ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("ScreenRetrieverWindowsPluginCApi"));
|
registry->GetRegistrarForPlugin("ScreenRetrieverWindowsPluginCApi"));
|
||||||
UrlLauncherWindowsRegisterWithRegistrar(
|
UrlLauncherWindowsRegisterWithRegistrar(
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
dynamic_system_colors
|
dynamic_system_colors
|
||||||
file_selector_windows
|
file_selector_windows
|
||||||
|
flutter_secure_storage_windows
|
||||||
screen_retriever_windows
|
screen_retriever_windows
|
||||||
url_launcher_windows
|
url_launcher_windows
|
||||||
window_manager
|
window_manager
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue