mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-22 02:24:30 +00:00
desktop tor one time dialog added and hidden dev settings enabled for desktop
This commit is contained in:
parent
157901e33d
commit
7155646f57
3 changed files with 92 additions and 13 deletions
|
@ -12,15 +12,19 @@ import 'dart:async';
|
|||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:stackwallet/db/hive/db.dart';
|
||||
import 'package:stackwallet/notifications/show_flush_bar.dart';
|
||||
import 'package:stackwallet/providers/global/debug_service_provider.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/utilities/util.dart';
|
||||
import 'package:stackwallet/widgets/background.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
import 'package:stackwallet/widgets/onetime_popups/tor_has_been_add_dialog.dart';
|
||||
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||
|
||||
|
@ -35,7 +39,27 @@ class HiddenSettings extends StatelessWidget {
|
|||
child: Scaffold(
|
||||
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
|
||||
appBar: AppBar(
|
||||
leading: Container(),
|
||||
leading: Util.isDesktop
|
||||
? Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: AppBarIconButton(
|
||||
size: 32,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFieldDefaultBG,
|
||||
shadows: const [],
|
||||
icon: SvgPicture.asset(
|
||||
Assets.svg.arrowLeft,
|
||||
width: 18,
|
||||
height: 18,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.topNavIconPrimary,
|
||||
),
|
||||
onPressed: Navigator.of(context).pop,
|
||||
),
|
||||
)
|
||||
: Container(),
|
||||
title: Text(
|
||||
"Dev options",
|
||||
style: STextStyles.navBarTitle(context),
|
||||
|
|
|
@ -13,11 +13,13 @@ import 'dart:io';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:stackwallet/pages/settings_views/global_settings_view/hidden_settings.dart';
|
||||
import 'package:stackwallet/pages/wallets_view/sub_widgets/empty_wallets.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/my_stack_view/my_wallets.dart';
|
||||
import 'package:stackwallet/providers/global/wallets_provider.dart';
|
||||
import 'package:stackwallet/themes/theme_providers.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/widgets/animated_widgets/rotate_icon.dart';
|
||||
import 'package:stackwallet/widgets/background.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
|
||||
|
||||
|
@ -52,27 +54,77 @@ class _MyStackViewState extends ConsumerState<MyStackView> {
|
|||
}
|
||||
}
|
||||
|
||||
class DesktopMyStackTitle extends ConsumerWidget {
|
||||
const DesktopMyStackTitle({Key? key}) : super(key: key);
|
||||
class DesktopMyStackTitle extends ConsumerStatefulWidget {
|
||||
const DesktopMyStackTitle({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
ConsumerState<DesktopMyStackTitle> createState() =>
|
||||
_DesktopMyStackTitleState();
|
||||
}
|
||||
|
||||
class _DesktopMyStackTitleState extends ConsumerState<DesktopMyStackTitle> {
|
||||
late final RotateIconController _rotateIconController;
|
||||
|
||||
DateTime _hiddenTime = DateTime.now();
|
||||
int _hiddenCount = 0;
|
||||
|
||||
void _hiddenOptions() {
|
||||
_rotateIconController.reset?.call();
|
||||
_rotateIconController.forward?.call();
|
||||
if (_hiddenCount == 5) {
|
||||
Navigator.of(context).pushNamed(HiddenSettings.routeName);
|
||||
}
|
||||
final now = DateTime.now();
|
||||
const timeout = Duration(seconds: 1);
|
||||
if (now.difference(_hiddenTime) < timeout) {
|
||||
_hiddenCount++;
|
||||
} else {
|
||||
_hiddenCount = 0;
|
||||
}
|
||||
_hiddenTime = now;
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_rotateIconController = RotateIconController();
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
dispose() {
|
||||
_rotateIconController.forward = null;
|
||||
_rotateIconController.reverse = null;
|
||||
_rotateIconController.reset = null;
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 24,
|
||||
),
|
||||
SizedBox(
|
||||
width: 32,
|
||||
height: 32,
|
||||
child: SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.stackIcon,
|
||||
GestureDetector(
|
||||
onTap: _hiddenOptions,
|
||||
child: RotateIcon(
|
||||
icon: SizedBox(
|
||||
width: 32,
|
||||
height: 32,
|
||||
child: SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.stackIcon,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
curve: Curves.easeInOutCubic,
|
||||
rotationPercent: 1.0,
|
||||
controller: _rotateIconController,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
|
|
|
@ -75,7 +75,10 @@ class _TorHasBeenAddedDialogState extends State<_TorHasBeenAddedDialog> {
|
|||
),
|
||||
),
|
||||
DesktopDialogCloseButton(
|
||||
onPressedOverride: setDoNotShowAgain,
|
||||
onPressedOverride: () {
|
||||
setDoNotShowAgain();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue