started nodes dialog popup

This commit is contained in:
ryleedavis 2022-10-26 16:07:37 -06:00
parent ab5190562d
commit b4e7e219a4
3 changed files with 141 additions and 70 deletions

View file

@ -7,7 +7,10 @@ import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
import 'package:tuple/tuple.dart'; import 'package:tuple/tuple.dart';
class CoinNodesView extends ConsumerStatefulWidget { class CoinNodesView extends ConsumerStatefulWidget {
@ -37,6 +40,75 @@ class _CoinNodesViewState extends ConsumerState<CoinNodesView> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (Util.isDesktop) {
return DesktopDialog(
child: Column(
children: [
Row(
children: [
const SizedBox(
width: 32,
),
SvgPicture.asset(
Assets.svg.iconFor(coin: widget.coin),
width: 24,
height: 24,
),
const SizedBox(
width: 12,
),
Text(
"${widget.coin.prettyName} nodes",
style: STextStyles.desktopH3(context),
textAlign: TextAlign.center,
),
Expanded(
child: const DesktopDialogCloseButton(),
),
],
),
Padding(
padding: EdgeInsets.only(
left: 32,
right: 32,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"${widget.coin.prettyName} nodes",
style: STextStyles.desktopTextExtraSmall(context).copyWith(
color:
Theme.of(context).extension<StackColors>()!.textDark3,
),
textAlign: TextAlign.left,
),
RichText(
text: TextSpan(
text: 'Add new nodes',
style:
STextStyles.desktopTextExtraSmall(context).copyWith(
color: Colors.blueAccent,
),
),
),
],
),
),
const SizedBox(
width: 12,
),
Padding(
padding: const EdgeInsets.all(20),
child: NodesList(
coin: widget.coin,
popBackToRoute: CoinNodesView.routeName,
),
),
],
),
);
} else {
return Scaffold( return Scaffold(
backgroundColor: Theme.of(context).extension<StackColors>()!.background, backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar( appBar: AppBar(
@ -103,3 +175,4 @@ class _CoinNodesViewState extends ConsumerState<CoinNodesView> {
); );
} }
} }
}

View file

@ -5,12 +5,13 @@ import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/providers/global/node_service_provider.dart'; import 'package:stackwallet/providers/global/node_service_provider.dart';
import 'package:stackwallet/providers/global/prefs_provider.dart'; import 'package:stackwallet/providers/global/prefs_provider.dart';
import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart';
import '../../../pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart';
import '../../../utilities/constants.dart';
class NodesSettings extends ConsumerStatefulWidget { class NodesSettings extends ConsumerStatefulWidget {
const NodesSettings({Key? key}) : super(key: key); const NodesSettings({Key? key}) : super(key: key);
@ -37,9 +38,6 @@ class _NodesSettings extends ConsumerState<NodesSettings> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double deviceWidth(BuildContext context) =>
MediaQuery.of(context).size.width;
bool showTestNet = ref.watch( bool showTestNet = ref.watch(
prefsChangeNotifierProvider.select((value) => value.showTestNetCoins), prefsChangeNotifierProvider.select((value) => value.showTestNetCoins),
); );
@ -108,18 +106,18 @@ class _NodesSettings extends ConsumerState<NodesSettings> {
borderRadius: BorderRadius.circular( borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius, Constants.size.circularBorderRadius,
), ),
side: BorderSide( // side: BorderSide(
color: Theme.of(context) // color: Theme.of(context)
.extension<StackColors>()! // .extension<StackColors>()!
.shadow), // .shadow),
), ),
materialTapTargetSize: materialTapTargetSize:
MaterialTapTargetSize.shrinkWrap, MaterialTapTargetSize.shrinkWrap,
onPressed: () { onPressed: () {
// Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
// CoinNodesView.routeName, CoinNodesView.routeName,
// arguments: coin, arguments: coin,
// ); );
}, },
child: Padding( child: Padding(
padding: const EdgeInsets.all( padding: const EdgeInsets.all(