forked from Henry-Hiles/nexus
Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
5c4135ddb1 |
|||
|
4e94b4a3bb |
|||
|
c44a8cddc3 |
|||
|
06a25b89e6 |
11 changed files with 20 additions and 173 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] Plain text
|
||||
- [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
|
||||
- [ ] Exploring
|
||||
- [x] Leaving
|
||||
|
|
@ -108,7 +108,7 @@ A simple and user-friendly Matrix client made with Flutter and the Matrix Dart S
|
|||
- [ ] About
|
||||
- [x] Log Out
|
||||
|
||||
## Development
|
||||
## Build Instructions
|
||||
|
||||
First, clone and open the repo:
|
||||
|
||||
|
|
@ -122,13 +122,13 @@ cd nexus
|
|||
#### Linux
|
||||
|
||||
- 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
|
||||
|
||||
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:
|
||||
|
||||
|
|
@ -136,6 +136,18 @@ Get dependencies:
|
|||
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:
|
||||
|
||||
```sh
|
||||
|
|
|
|||
41
flake.nix
41
flake.nix
|
|
@ -29,22 +29,6 @@
|
|||
...
|
||||
}:
|
||||
|
||||
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 {
|
||||
inherit system;
|
||||
|
|
@ -61,35 +45,14 @@
|
|||
olm
|
||||
git
|
||||
clang
|
||||
usedFlutter
|
||||
|
||||
(pkgs.writeShellScriptBin "rustup" (builtins.readFile ./nix/fake-rustup.sh))
|
||||
flutter
|
||||
];
|
||||
|
||||
env = {
|
||||
LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}:./build/native_assets/linux";
|
||||
LD_LIBRARY_PATH = "./build/native_assets/linux";
|
||||
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
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
);
|
||||
}
|
||||
|
|
@ -1,18 +1,11 @@
|
|||
import "package:flutter/material.dart";
|
||||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||
import "package:nexus/controllers/secure_storage_controller.dart";
|
||||
|
||||
class SettingsPage extends ConsumerWidget {
|
||||
const SettingsPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text("Settings")),
|
||||
body: ElevatedButton(
|
||||
onPressed: ref.watch(SecureStorageController.provider.notifier).clear,
|
||||
child: Text("Log out"),
|
||||
),
|
||||
);
|
||||
return Placeholder();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
#include <dynamic_system_colors/dynamic_color_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 <url_launcher_linux/url_launcher_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 =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
|
||||
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 =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverLinuxPlugin");
|
||||
screen_retriever_linux_plugin_register_with_registrar(screen_retriever_linux_registrar);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
dynamic_system_colors
|
||||
file_selector_linux
|
||||
flutter_secure_storage_linux
|
||||
screen_retriever_linux
|
||||
url_launcher_linux
|
||||
window_manager
|
||||
|
|
|
|||
|
|
@ -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
|
||||
56
pubspec.lock
56
pubspec.lock
|
|
@ -533,54 +533,6 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
@ -928,14 +880,6 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
|||
|
|
@ -59,9 +59,7 @@ dependencies:
|
|||
flutter_svg: ^2.2.2
|
||||
json_annotation: ^4.9.0
|
||||
shared_preferences: ^2.5.3
|
||||
mention_tag_text_field: ^0.0.9
|
||||
fluttertagger: ^2.3.1
|
||||
flutter_secure_storage: ^10.0.0
|
||||
dynamic_polls: ^0.0.6
|
||||
flutter_hooks: ^0.21.3+1
|
||||
cross_cache: ^1.1.0
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
#include <dynamic_system_colors/dynamic_color_plugin_c_api.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 <url_launcher_windows/url_launcher_windows.h>
|
||||
#include <window_manager/window_manager_plugin.h>
|
||||
|
|
@ -19,8 +18,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
|
|||
registry->GetRegistrarForPlugin("DynamicColorPluginCApi"));
|
||||
FileSelectorWindowsRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("FileSelectorWindows"));
|
||||
FlutterSecureStorageWindowsPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));
|
||||
ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("ScreenRetrieverWindowsPluginCApi"));
|
||||
UrlLauncherWindowsRegisterWithRegistrar(
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
dynamic_system_colors
|
||||
file_selector_windows
|
||||
flutter_secure_storage_windows
|
||||
screen_retriever_windows
|
||||
url_launcher_windows
|
||||
window_manager
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue