Merge pull request #740 from cypherstack/ui

Make settings menu, advanced settings view, and DebugInfoDialog scrollable (if needed) and capitalize certain Firo terms
This commit is contained in:
Diego Salazar 2024-02-06 20:50:50 -07:00 committed by GitHub
commit 951d19a37a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 296 additions and 285 deletions

View file

@ -209,7 +209,7 @@ class _FiroRescanRecoveryErrorViewState
children: [ children: [
if (!Util.isDesktop) const Spacer(), if (!Util.isDesktop) const Spacer(),
Text( Text(
"Failed to rescan firo wallet", "Failed to rescan Firo wallet",
style: STextStyles.pageTitleH2(context), style: STextStyles.pageTitleH2(context),
), ),
Util.isDesktop Util.isDesktop

View file

@ -178,7 +178,7 @@ class WalletBalanceToggleSheet extends ConsumerWidget {
), ),
if (balanceSecondary != null) if (balanceSecondary != null)
BalanceSelector( BalanceSelector(
title: "Available lelantus balance", title: "Available Lelantus balance",
coin: coin, coin: coin,
balance: balanceSecondary.spendable, balance: balanceSecondary.spendable,
onPressed: () { onPressed: () {
@ -204,7 +204,7 @@ class WalletBalanceToggleSheet extends ConsumerWidget {
), ),
if (balanceSecondary != null) if (balanceSecondary != null)
BalanceSelector( BalanceSelector(
title: "Full lelantus balance", title: "Full Lelantus balance",
coin: coin, coin: coin,
balance: balanceSecondary.total, balance: balanceSecondary.total,
onPressed: () { onPressed: () {
@ -230,7 +230,7 @@ class WalletBalanceToggleSheet extends ConsumerWidget {
), ),
if (balanceTertiary != null) if (balanceTertiary != null)
BalanceSelector( BalanceSelector(
title: "Available spark balance", title: "Available Spark balance",
coin: coin, coin: coin,
balance: balanceTertiary.spendable, balance: balanceTertiary.spendable,
onPressed: () { onPressed: () {
@ -256,7 +256,7 @@ class WalletBalanceToggleSheet extends ConsumerWidget {
), ),
if (balanceTertiary != null) if (balanceTertiary != null)
BalanceSelector( BalanceSelector(
title: "Full spark balance", title: "Full Spark balance",
coin: coin, coin: coin,
balance: balanceTertiary.total, balance: balanceTertiary.total,
onPressed: () { onPressed: () {

View file

@ -105,7 +105,12 @@ class _DesktopSettingsViewState extends ConsumerState<DesktopSettingsView> {
children: [ children: [
const Padding( const Padding(
padding: EdgeInsets.all(15.0), padding: EdgeInsets.all(15.0),
child: SettingsMenu(), child: Align(
alignment: Alignment.topLeft,
child: SingleChildScrollView(
child: SettingsMenu(),
),
),
), ),
Expanded( Expanded(
child: contentViews[ child: contentViews[

View file

@ -36,305 +36,308 @@ class _AdvancedSettings extends ConsumerState<AdvancedSettings> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
debugPrint("BUILD: $runtimeType"); debugPrint("BUILD: $runtimeType");
return Column( return SingleChildScrollView(
children: [ child: Column(
Padding( children: [
padding: const EdgeInsets.only( Padding(
right: 30, padding: const EdgeInsets.only(
), right: 30,
child: RoundedWhiteContainer( ),
radiusMultiplier: 2, child: RoundedWhiteContainer(
child: Column( radiusMultiplier: 2,
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Padding( children: [
padding: const EdgeInsets.all(8.0), Padding(
child: SvgPicture.asset( padding: const EdgeInsets.all(8.0),
Assets.svg.circleSliders, child: SvgPicture.asset(
width: 48, Assets.svg.circleSliders,
height: 48, width: 48,
height: 48,
),
), ),
), Column(
Column( crossAxisAlignment: CrossAxisAlignment.stretch,
crossAxisAlignment: CrossAxisAlignment.stretch, children: [
children: [ Padding(
Padding( padding: const EdgeInsets.all(10),
padding: const EdgeInsets.all(10), child: RichText(
child: RichText( textAlign: TextAlign.start,
textAlign: TextAlign.start, text: TextSpan(
text: TextSpan( children: [
children: [ TextSpan(
TextSpan( text: "Advanced",
text: "Advanced", style: STextStyles.desktopTextSmall(context),
style: STextStyles.desktopTextSmall(context), ),
), TextSpan(
TextSpan( text:
text: "\n\nConfigure these settings only if you know what you are doing!",
"\n\nConfigure these settings only if you know what you are doing!", style: STextStyles.desktopTextExtraExtraSmall(
style: STextStyles.desktopTextExtraExtraSmall( context),
context), ),
), ],
], ),
), ),
), ),
), const Padding(
const Padding( padding: EdgeInsets.all(10.0),
padding: EdgeInsets.all(10.0), child: Divider(
child: Divider( thickness: 0.5,
thickness: 0.5, ),
), ),
), Padding(
Padding(
padding: const EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Toggle testnet coins",
style: STextStyles.desktopTextExtraSmall(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark),
textAlign: TextAlign.left,
),
SizedBox(
height: 20,
width: 40,
child: DraggableSwitchButton(
isOn: ref.watch(
prefsChangeNotifierProvider
.select((value) => value.showTestNetCoins),
),
onValueChanged: (newValue) {
ref
.read(prefsChangeNotifierProvider)
.showTestNetCoins = newValue;
},
),
),
],
),
),
const Padding(
padding: EdgeInsets.all(10.0),
child: Divider(
thickness: 0.5,
),
),
Padding(
padding: const EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Enable coin control",
style: STextStyles.desktopTextExtraSmall(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark),
textAlign: TextAlign.left,
),
SizedBox(
height: 20,
width: 40,
child: DraggableSwitchButton(
isOn: ref.watch(
prefsChangeNotifierProvider
.select((value) => value.enableCoinControl),
),
onValueChanged: (newValue) {
ref
.read(prefsChangeNotifierProvider)
.enableCoinControl = newValue;
},
),
),
],
),
),
const Padding(
padding: EdgeInsets.all(10.0),
child: Divider(
thickness: 0.5,
),
),
/// TODO: Make a dialog popup
Consumer(builder: (_, ref, __) {
final externalCalls = ref.watch(
prefsChangeNotifierProvider
.select((value) => value.externalCalls),
);
return Padding(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Column( Text(
crossAxisAlignment: CrossAxisAlignment.start, "Toggle testnet coins",
children: [ style: STextStyles.desktopTextExtraSmall(context)
Text( .copyWith(
"Stack Experience", color: Theme.of(context)
style: .extension<StackColors>()!
STextStyles.desktopTextExtraSmall(context) .textDark),
.copyWith( textAlign: TextAlign.left,
color: Theme.of(context) ),
.extension<StackColors>()! SizedBox(
.textDark), height: 20,
textAlign: TextAlign.left, width: 40,
), child: DraggableSwitchButton(
Text( isOn: ref.watch(
externalCalls ? "Easy crypto" : "Incognito", prefsChangeNotifierProvider.select(
style: STextStyles.desktopTextExtraExtraSmall( (value) => value.showTestNetCoins),
context), ),
), onValueChanged: (newValue) {
], ref
.read(prefsChangeNotifierProvider)
.showTestNetCoins = newValue;
},
),
), ),
PrimaryButton(
label: "Change",
buttonHeight: ButtonHeight.xs,
width: 101,
onPressed: () async {
await showDialog<dynamic>(
context: context,
useSafeArea: false,
barrierDismissible: true,
builder: (context) {
return const StackPrivacyDialog();
},
);
},
)
], ],
), ),
);
}),
],
),
const Padding(
padding: EdgeInsets.all(10.0),
child: Divider(
thickness: 0.5,
),
),
Padding(
padding: const EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Block explorers",
style: STextStyles.desktopTextExtraSmall(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark),
textAlign: TextAlign.left,
), ),
PrimaryButton( const Padding(
buttonHeight: ButtonHeight.xs, padding: EdgeInsets.all(10.0),
label: "Edit", child: Divider(
width: 101, thickness: 0.5,
onPressed: () async { ),
await showDialog<dynamic>(
context: context,
useSafeArea: false,
barrierDismissible: true,
builder: (context) {
return const DesktopManageBlockExplorersDialog();
},
);
},
), ),
Padding(
padding: const EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Enable coin control",
style: STextStyles.desktopTextExtraSmall(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark),
textAlign: TextAlign.left,
),
SizedBox(
height: 20,
width: 40,
child: DraggableSwitchButton(
isOn: ref.watch(
prefsChangeNotifierProvider.select(
(value) => value.enableCoinControl),
),
onValueChanged: (newValue) {
ref
.read(prefsChangeNotifierProvider)
.enableCoinControl = newValue;
},
),
),
],
),
),
const Padding(
padding: EdgeInsets.all(10.0),
child: Divider(
thickness: 0.5,
),
),
/// TODO: Make a dialog popup
Consumer(builder: (_, ref, __) {
final externalCalls = ref.watch(
prefsChangeNotifierProvider
.select((value) => value.externalCalls),
);
return Padding(
padding: const EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Stack Experience",
style: STextStyles.desktopTextExtraSmall(
context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark),
textAlign: TextAlign.left,
),
Text(
externalCalls ? "Easy crypto" : "Incognito",
style:
STextStyles.desktopTextExtraExtraSmall(
context),
),
],
),
PrimaryButton(
label: "Change",
buttonHeight: ButtonHeight.xs,
width: 101,
onPressed: () async {
await showDialog<dynamic>(
context: context,
useSafeArea: false,
barrierDismissible: true,
builder: (context) {
return const StackPrivacyDialog();
},
);
},
)
],
),
);
}),
], ],
), ),
), const Padding(
const Padding( padding: EdgeInsets.all(10.0),
padding: EdgeInsets.all(10.0), child: Divider(
child: Divider( thickness: 0.5,
thickness: 0.5, ),
), ),
), Padding(
Padding( padding: const EdgeInsets.all(10),
padding: const EdgeInsets.all(10), child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
children: [ Text(
Text( "Block explorers",
"Units", style: STextStyles.desktopTextExtraSmall(context)
style: STextStyles.desktopTextExtraSmall(context) .copyWith(
.copyWith( color: Theme.of(context)
color: Theme.of(context) .extension<StackColors>()!
.extension<StackColors>()! .textDark),
.textDark), textAlign: TextAlign.left,
textAlign: TextAlign.left, ),
), PrimaryButton(
PrimaryButton( buttonHeight: ButtonHeight.xs,
buttonHeight: ButtonHeight.xs, label: "Edit",
label: "Edit", width: 101,
width: 101, onPressed: () async {
onPressed: () async { await showDialog<dynamic>(
await showDialog<dynamic>( context: context,
context: context, useSafeArea: false,
useSafeArea: false, barrierDismissible: true,
barrierDismissible: true, builder: (context) {
builder: (context) { return const DesktopManageBlockExplorersDialog();
return const ManageCoinUnitsView(); },
}, );
); },
}, ),
), ],
], ),
), ),
), const Padding(
const Padding( padding: EdgeInsets.all(10.0),
padding: EdgeInsets.all(10.0), child: Divider(
child: Divider( thickness: 0.5,
thickness: 0.5, ),
), ),
), Padding(
Padding( padding: const EdgeInsets.all(10),
padding: const EdgeInsets.all(10), child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
children: [ Text(
Text( "Units",
"Debug info", style: STextStyles.desktopTextExtraSmall(context)
style: STextStyles.desktopTextExtraSmall(context) .copyWith(
.copyWith( color: Theme.of(context)
color: Theme.of(context) .extension<StackColors>()!
.extension<StackColors>()! .textDark),
.textDark), textAlign: TextAlign.left,
textAlign: TextAlign.left, ),
), PrimaryButton(
PrimaryButton( buttonHeight: ButtonHeight.xs,
buttonHeight: ButtonHeight.xs, label: "Edit",
label: "Show logs", width: 101,
width: 101, onPressed: () async {
onPressed: () async { await showDialog<dynamic>(
await showDialog<dynamic>( context: context,
context: context, useSafeArea: false,
useSafeArea: false, barrierDismissible: true,
barrierDismissible: true, builder: (context) {
builder: (context) { return const ManageCoinUnitsView();
return const DebugInfoDialog(); },
}, );
); },
}, ),
), ],
], ),
), ),
), const Padding(
const SizedBox( padding: EdgeInsets.all(10.0),
height: 10, child: Divider(
), thickness: 0.5,
], ),
),
Padding(
padding: const EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Debug info",
style: STextStyles.desktopTextExtraSmall(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark),
textAlign: TextAlign.left,
),
PrimaryButton(
buttonHeight: ButtonHeight.xs,
label: "Show logs",
width: 101,
onPressed: () async {
await showDialog<dynamic>(
context: context,
useSafeArea: false,
barrierDismissible: true,
builder: (context) {
return const DebugInfoDialog();
},
);
},
),
],
),
),
const SizedBox(
height: 10,
),
],
),
), ),
), ),
), ],
], ),
); );
} }
} }

View file

@ -98,7 +98,10 @@ class _DebugInfoDialog extends ConsumerState<DebugInfoDialog> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return DesktopDialog( return DesktopDialog(
maxHeight: 850, // Max height of 850 unless the screen is smaller than that.
maxHeight: MediaQuery.of(context).size.height < 850
? MediaQuery.of(context).size.height
: 850,
maxWidth: 600, maxWidth: 600,
child: Column( child: Column(
children: [ children: [