From 6bf7777b0401b4ea4c7a1921beb6de278511c4a0 Mon Sep 17 00:00:00 2001 From: zoe Date: Sun, 14 Aug 2022 13:51:25 +0200 Subject: [PATCH] remove phoenix for being fucked up and evil --- lib/i18n/en.json | 3 ++- lib/main.dart | 1 - lib/pages/settings/account.dart | 32 ++++++++++++++++++++++++++------ pubspec.lock | 7 ------- pubspec.yaml | 1 - 5 files changed, 28 insertions(+), 16 deletions(-) diff --git a/lib/i18n/en.json b/lib/i18n/en.json index 43dde3a..c5e958a 100644 --- a/lib/i18n/en.json +++ b/lib/i18n/en.json @@ -21,6 +21,7 @@ "post-options": "post options", "reblogged-by": "reblogged by:", "post-batch-size": "post batch size", - "post-batch-size-description": "how many posts to load at a time\nfor slower internet or if you're not sure what to do use a low value (the default in most places is 20)" + "post-batch-size-description": "how many posts to load at a time\nfor slower internet or if you're not sure what to do use a low value (the default in most places is 20)", + "app-settings": "app settings" } \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index c87155d..21af6f2 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:flutter_phoenix/flutter_phoenix.dart'; import 'package:intl/intl.dart'; import 'package:localization/localization.dart'; import 'package:loris/partials/main_scaffold.dart'; diff --git a/lib/pages/settings/account.dart b/lib/pages/settings/account.dart index 0463425..0ededfe 100644 --- a/lib/pages/settings/account.dart +++ b/lib/pages/settings/account.dart @@ -12,7 +12,9 @@ class AccountSettings extends StatelessWidget { children.add( LogoutButton(identity: global.settings!.identities.keys.toList()[i])); } - return Row( + children.add(const NewAccountButton()); + return Column( + crossAxisAlignment: CrossAxisAlignment.start, children: children, ); } @@ -31,16 +33,34 @@ class LogoutButton extends StatelessWidget { children: [ SelectableText(identity), TextButton.icon( - onPressed: () { - logout(context, identity); - }, - icon: const Icon(Icons.logout), - label: Text("logout".i18n())) + onPressed: () { + logout(context, identity); + }, + icon: const Icon(Icons.logout), + label: Text( + "logout".i18n(), + ), + ), ], ); } } +class NewAccountButton extends StatelessWidget { + const NewAccountButton({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return TextButton.icon( + onPressed: (() => addNewIdentity(context)), + icon: const Icon(Icons.person_add), + label: Text( + "add-account".i18n(), + ), + ); + } +} + void addNewIdentity(context) { Navigator.of(context).pushReplacementNamed("/login"); } diff --git a/pubspec.lock b/pubspec.lock index ae0ba78..09cdee0 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -102,13 +102,6 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_phoenix: - dependency: "direct main" - description: - name: flutter_phoenix - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" flutter_test: dependency: "direct dev" description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index 8a2d9d0..66a7a0e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -44,7 +44,6 @@ dependencies: shelf: ^1.3.1 html: ^0.15.0 web_socket_channel: ^2.2.0 - flutter_phoenix: ^1.0.0 dev_dependencies: flutter_test: