Compare commits

...
Sign in to create a new pull request.

4 commits

11 changed files with 20 additions and 142 deletions

View file

@ -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 - [ ] Matrix.to link: I just need to fix my regex, I should do this next.
- [ ] 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
## Development ## Build Instructions
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, Rust, the libsecret dev package for your distro (must be in `PKG_CONFIG_PATH`), and sqlite (must be in `LD_LIBRARY_PATH`). - Without Nix: Install Flutter, Go, Olm, Git, Clang, and GLibc.
#### Windows / MacOS #### Windows / MacOS
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. 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.
### ### Set up Flutter
Get dependencies: Get dependencies:
@ -136,6 +136,18 @@ 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

View file

@ -45,17 +45,11 @@
olm olm
git git
clang clang
(flutter.override { extraPkgConfigPackages = [ pkgs.libsecret ]; }) flutter
(pkgs.writeShellScriptBin "rustup" (builtins.readFile ./nix/fake-rustup.sh))
]; ];
env = { env = {
LD_LIBRARY_PATH = "${ LD_LIBRARY_PATH = "./build/native_assets/linux";
pkgs.lib.makeLibraryPath ([
pkgs.sqlite
])
}:./build/native_assets/linux";
CPATH = lib.makeSearchPath "include" [ pkgs.glibc.dev ]; CPATH = lib.makeSearchPath "include" [ pkgs.glibc.dev ];
}; };
}; };

View file

@ -1,19 +0,0 @@
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,
);
}

View file

@ -1,18 +1,11 @@
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 Scaffold( return Placeholder();
appBar: AppBar(title: Text("Settings")),
body: ElevatedButton(
onPressed: ref.watch(SecureStorageController.provider.notifier).clear,
child: Text("Log out"),
),
);
} }
} }

View file

@ -8,7 +8,6 @@
#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>
@ -21,9 +20,6 @@ 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);

View file

@ -5,7 +5,6 @@
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

View file

@ -1,35 +0,0 @@
#!/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

View file

@ -533,54 +533,6 @@ 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:
@ -928,14 +880,6 @@ 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:

View file

@ -59,9 +59,7 @@ 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

View file

@ -8,7 +8,6 @@
#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>
@ -19,8 +18,6 @@ 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(

View file

@ -5,7 +5,6 @@
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