mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-05-24 23:32:13 +00:00
remove unwrap and fix go back not working
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
This commit is contained in:
parent
8898395d72
commit
dc044ee0d2
4 changed files with 3 additions and 55 deletions
|
|
@ -2,7 +2,6 @@ import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:twonly/locator.dart';
|
|
||||||
import 'package:twonly/src/constants/routes.keys.dart';
|
import 'package:twonly/src/constants/routes.keys.dart';
|
||||||
import 'package:twonly/src/services/backup/common.backup.dart';
|
import 'package:twonly/src/services/backup/common.backup.dart';
|
||||||
import 'package:twonly/src/services/user.service.dart';
|
import 'package:twonly/src/services/user.service.dart';
|
||||||
|
|
@ -24,19 +23,6 @@ class _BackupSetupPageState extends State<BackupSetupPage> {
|
||||||
final TextEditingController passwordCtrl = TextEditingController();
|
final TextEditingController passwordCtrl = TextEditingController();
|
||||||
final TextEditingController repeatedPasswordCtrl = TextEditingController();
|
final TextEditingController repeatedPasswordCtrl = TextEditingController();
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
||||||
if (userService.currentUser.twonlySafeBackup != null) {
|
|
||||||
// twonly safe is already configured...
|
|
||||||
UserService.update((user) {
|
|
||||||
user.currentSetupPage = SetupPages.backup.next()?.name;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<bool> onPressedEnableTwonlySafe() async {
|
Future<bool> onPressedEnableTwonlySafe() async {
|
||||||
setState(() {
|
setState(() {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:lottie/lottie.dart';
|
import 'package:lottie/lottie.dart';
|
||||||
import 'package:twonly/locator.dart';
|
import 'package:twonly/locator.dart';
|
||||||
import 'package:twonly/src/services/user.service.dart';
|
|
||||||
import 'package:twonly/src/utils/misc.dart';
|
import 'package:twonly/src/utils/misc.dart';
|
||||||
import 'package:twonly/src/visual/views/onboarding/setup.view.dart';
|
|
||||||
import 'package:twonly/src/visual/views/onboarding/setup/components/next_button.comp.dart';
|
import 'package:twonly/src/visual/views/onboarding/setup/components/next_button.comp.dart';
|
||||||
import 'package:twonly/src/visual/views/settings/privacy/user_discovery/components/user_discovery_setup.comp.dart';
|
import 'package:twonly/src/visual/views/settings/privacy/user_discovery/components/user_discovery_setup.comp.dart';
|
||||||
|
|
||||||
|
|
@ -19,21 +17,6 @@ class LetYourFriendsFindYou extends StatefulWidget {
|
||||||
class _LetYourFriendsFindYouState extends State<LetYourFriendsFindYou> {
|
class _LetYourFriendsFindYouState extends State<LetYourFriendsFindYou> {
|
||||||
bool _isLoading = false;
|
bool _isLoading = false;
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
||||||
if (userService.currentUser.isUserDiscoveryEnabled &&
|
|
||||||
userService.currentUser.userDiscoverySharePromotion) {
|
|
||||||
// feature is already configured...
|
|
||||||
UserService.update((user) {
|
|
||||||
user.currentSetupPage = SetupPages.letYourFriendsFindYou.next()?.name;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Center(
|
return Center(
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:twonly/locator.dart';
|
|
||||||
import 'package:twonly/src/services/user.service.dart';
|
|
||||||
import 'package:twonly/src/visual/views/onboarding/setup.view.dart';
|
|
||||||
import 'package:twonly/src/visual/views/onboarding/setup/components/next_button.comp.dart';
|
import 'package:twonly/src/visual/views/onboarding/setup/components/next_button.comp.dart';
|
||||||
import 'package:twonly/src/visual/views/settings/privacy/user_discovery/components/user_discovery_setup.comp.dart';
|
import 'package:twonly/src/visual/views/settings/privacy/user_discovery/components/user_discovery_setup.comp.dart';
|
||||||
|
|
||||||
|
|
@ -16,20 +13,6 @@ class ShareYourFriendsSetupPage extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ShareYourFriendsSetupPageState extends State<ShareYourFriendsSetupPage> {
|
class _ShareYourFriendsSetupPageState extends State<ShareYourFriendsSetupPage> {
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
||||||
if (userService.currentUser.isUserDiscoveryEnabled) {
|
|
||||||
// feature is already configured...
|
|
||||||
UserService.update((user) {
|
|
||||||
user.currentSetupPage = SetupPages.shareYourFriends.next()?.name;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Center(
|
return Center(
|
||||||
|
|
@ -41,11 +24,7 @@ class _ShareYourFriendsSetupPageState extends State<ShareYourFriendsSetupPage> {
|
||||||
showOnlySpecificPage: UserDiscoveryPages.shareYourFriends,
|
showOnlySpecificPage: UserDiscoveryPages.shareYourFriends,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 60),
|
const SizedBox(height: 60),
|
||||||
const NextButtonComp(
|
const NextButtonComp(),
|
||||||
// onPressed: () async {
|
|
||||||
// return !(await widget.state.initializeOrUpdate());
|
|
||||||
// },
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ impl UserDiscoveryUtils for UserDiscoveryUtilsFlutter {
|
||||||
|
|
||||||
impl UserDiscoveryStore for UserDiscoveryStoreFlutter {
|
impl UserDiscoveryStore for UserDiscoveryStoreFlutter {
|
||||||
async fn get_config(&self) -> Result<String> {
|
async fn get_config(&self) -> Result<String> {
|
||||||
let ws = get_twonly_flutter().unwrap();
|
let ws = get_twonly_flutter()?;
|
||||||
let config_path =
|
let config_path =
|
||||||
PathBuf::from(&ws.config.data_directory).join("user_discovery_config.json");
|
PathBuf::from(&ws.config.data_directory).join("user_discovery_config.json");
|
||||||
|
|
||||||
|
|
@ -59,7 +59,7 @@ impl UserDiscoveryStore for UserDiscoveryStoreFlutter {
|
||||||
|
|
||||||
async fn update_config(&self, update: String) -> Result<()> {
|
async fn update_config(&self, update: String) -> Result<()> {
|
||||||
tracing::debug!("Updating configuration file.");
|
tracing::debug!("Updating configuration file.");
|
||||||
let ws = get_twonly_flutter().unwrap();
|
let ws = get_twonly_flutter()?;
|
||||||
let config_path =
|
let config_path =
|
||||||
PathBuf::from(&ws.config.data_directory).join("user_discovery_config.json");
|
PathBuf::from(&ws.config.data_directory).join("user_discovery_config.json");
|
||||||
std::fs::write(config_path, &update)?;
|
std::fs::write(config_path, &update)?;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue