From 2e5a5e35a0c57455831225a1c2bd186a46f66535 Mon Sep 17 00:00:00 2001 From: ryleedavis Date: Wed, 2 Nov 2022 10:27:07 -0600 Subject: [PATCH] import changes --- .../advanced_settings/debug_info_dialog.dart | 0 .../advanced_settings/advanced_settings.dart | 0 .../advanced_settings/debug_info_dialog.dart | 188 ++++++++++++++++++ .../stack_privacy_dialog.dart | 19 +- 4 files changed, 197 insertions(+), 10 deletions(-) delete mode 100644 lib/pages_desktop_specific/home/advanced_settings/debug_info_dialog.dart rename lib/pages_desktop_specific/home/{ => settings_menu}/advanced_settings/advanced_settings.dart (100%) create mode 100644 lib/pages_desktop_specific/home/settings_menu/advanced_settings/debug_info_dialog.dart rename lib/pages_desktop_specific/home/{ => settings_menu}/advanced_settings/stack_privacy_dialog.dart (96%) diff --git a/lib/pages_desktop_specific/home/advanced_settings/debug_info_dialog.dart b/lib/pages_desktop_specific/home/advanced_settings/debug_info_dialog.dart deleted file mode 100644 index e69de29bb..000000000 diff --git a/lib/pages_desktop_specific/home/advanced_settings/advanced_settings.dart b/lib/pages_desktop_specific/home/settings_menu/advanced_settings/advanced_settings.dart similarity index 100% rename from lib/pages_desktop_specific/home/advanced_settings/advanced_settings.dart rename to lib/pages_desktop_specific/home/settings_menu/advanced_settings/advanced_settings.dart diff --git a/lib/pages_desktop_specific/home/settings_menu/advanced_settings/debug_info_dialog.dart b/lib/pages_desktop_specific/home/settings_menu/advanced_settings/debug_info_dialog.dart new file mode 100644 index 000000000..342d9180a --- /dev/null +++ b/lib/pages_desktop_specific/home/settings_menu/advanced_settings/debug_info_dialog.dart @@ -0,0 +1,188 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:stackwallet/models/isar/models/log.dart'; +import 'package:stackwallet/utilities/constants.dart'; +import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/widgets/desktop/desktop_dialog.dart'; +import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart'; +import 'package:stackwallet/widgets/desktop/primary_button.dart'; +import 'package:stackwallet/widgets/desktop/secondary_button.dart'; + +// import '../../../utilities/assets.dart'; +// import '../../../utilities/util.dart'; +// import '../../../widgets/icon_widgets/x_icon.dart'; +// import '../../../widgets/stack_text_field.dart'; +// import '../../../widgets/textfield_icon_button.dart'; + +class DebugInfoDialog extends StatefulWidget { + const DebugInfoDialog({Key? key}) : super(key: key); + + @override + State createState() => _DebugInfoDialog(); +} + +class _DebugInfoDialog extends State { + final _searchController = TextEditingController(); + final _searchFocusNode = FocusNode(); + + final scrollController = ScrollController(); + + String _searchTerm = ""; + + List filtered(List unfiltered, String filter) { + if (filter == "") { + return unfiltered; + } + return unfiltered + .where( + (e) => (e.toString().toLowerCase().contains(filter.toLowerCase()))) + .toList(); + } + + BorderRadius? _borderRadius(int index, int listLength) { + if (index == 0 && listLength == 1) { + return BorderRadius.circular( + Constants.size.circularBorderRadius, + ); + } else if (index == 0) { + return BorderRadius.vertical( + bottom: Radius.circular( + Constants.size.circularBorderRadius, + ), + ); + } else if (index == listLength - 1) { + return BorderRadius.vertical( + top: Radius.circular( + Constants.size.circularBorderRadius, + ), + ); + } + return null; + } + + @override + void initState() { + // ref.read(debugServiceProvider).updateRecentLogs(); + super.initState(); + } + + @override + void dispose() { + _searchController.dispose(); + scrollController.dispose(); + _searchFocusNode.dispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return DesktopDialog( + maxHeight: 800, + maxWidth: 600, + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.all(32), + child: Text( + "Debug info", + style: STextStyles.desktopH3(context), + textAlign: TextAlign.center, + ), + ), + const DesktopDialogCloseButton(), + ], + ), + Row( + children: [ + // ClipRRect( + // borderRadius: BorderRadius.circular( + // Constants.size.circularBorderRadius, + // ), + // child: TextField( + // key: const Key("desktopSettingDebugInfo"), + // autocorrect: Util.isDesktop ? false : true, + // enableSuggestions: Util.isDesktop ? false : true, + // controller: _searchController, + // focusNode: _searchFocusNode, + // // onChanged: (newString) { + // // setState(() => _searchTerm = newString); + // // }, + // style: STextStyles.field(context), + // decoration: standardInputDecoration( + // "Search", + // _searchFocusNode, + // context, + // ).copyWith( + // prefixIcon: Padding( + // padding: const EdgeInsets.symmetric( + // horizontal: 10, + // vertical: 16, + // ), + // child: SvgPicture.asset( + // Assets.svg.search, + // width: 16, + // height: 16, + // ), + // ), + // suffixIcon: _searchController.text.isNotEmpty + // ? Padding( + // padding: const EdgeInsets.only(right: 0), + // child: UnconstrainedBox( + // child: Row( + // children: [ + // TextFieldIconButton( + // child: const XIcon(), + // onTap: () async { + // setState(() { + // _searchController.text = ""; + // _searchTerm = ""; + // }); + // }, + // ), + // ], + // ), + // ), + // ) + // : null, + // ), + // ), + // ), + ], + ), + // Column( + // children: [ + // + // ], + // ), + const Spacer(), + Padding( + padding: const EdgeInsets.all(32), + child: Row( + children: [ + Expanded( + child: SecondaryButton( + label: "Clear logs", + onPressed: () {}, + ), + ), + const SizedBox( + width: 16, + ), + Expanded( + child: PrimaryButton( + label: "Save logs to file", + onPressed: () {}, + ), + ) + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages_desktop_specific/home/advanced_settings/stack_privacy_dialog.dart b/lib/pages_desktop_specific/home/settings_menu/advanced_settings/stack_privacy_dialog.dart similarity index 96% rename from lib/pages_desktop_specific/home/advanced_settings/stack_privacy_dialog.dart rename to lib/pages_desktop_specific/home/settings_menu/advanced_settings/stack_privacy_dialog.dart index 8e385fd37..32c20c010 100644 --- a/lib/pages_desktop_specific/home/advanced_settings/stack_privacy_dialog.dart +++ b/lib/pages_desktop_specific/home/settings_menu/advanced_settings/stack_privacy_dialog.dart @@ -3,21 +3,20 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; +import 'package:stackwallet/hive/db.dart'; +import 'package:stackwallet/providers/global/prefs_provider.dart'; +import 'package:stackwallet/providers/global/price_provider.dart'; +import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart'; +import 'package:stackwallet/utilities/assets.dart'; +import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_colors.dart'; +import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart'; import 'package:stackwallet/widgets/desktop/primary_button.dart'; import 'package:stackwallet/widgets/desktop/secondary_button.dart'; - -import '../../../hive/db.dart'; -import '../../../providers/global/prefs_provider.dart'; -import '../../../providers/global/price_provider.dart'; -import '../../../services/exchange/exchange_data_loading_service.dart'; -import '../../../utilities/assets.dart'; -import '../../../utilities/constants.dart'; -import '../../../utilities/theme/stack_colors.dart'; -import '../../../utilities/util.dart'; -import '../../../widgets/rounded_white_container.dart'; +import 'package:stackwallet/widgets/rounded_white_container.dart'; class StackPrivacyDialog extends ConsumerStatefulWidget { const StackPrivacyDialog({Key? key}) : super(key: key);