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: [
if (!Util.isDesktop) const Spacer(),
Text(
"Failed to rescan firo wallet",
"Failed to rescan Firo wallet",
style: STextStyles.pageTitleH2(context),
),
Util.isDesktop

View file

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

View file

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

View file

@ -36,305 +36,308 @@ class _AdvancedSettings extends ConsumerState<AdvancedSettings> {
@override
Widget build(BuildContext context) {
debugPrint("BUILD: $runtimeType");
return Column(
children: [
Padding(
padding: const EdgeInsets.only(
right: 30,
),
child: RoundedWhiteContainer(
radiusMultiplier: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: SvgPicture.asset(
Assets.svg.circleSliders,
width: 48,
height: 48,
return SingleChildScrollView(
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(
right: 30,
),
child: RoundedWhiteContainer(
radiusMultiplier: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: SvgPicture.asset(
Assets.svg.circleSliders,
width: 48,
height: 48,
),
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Padding(
padding: const EdgeInsets.all(10),
child: RichText(
textAlign: TextAlign.start,
text: TextSpan(
children: [
TextSpan(
text: "Advanced",
style: STextStyles.desktopTextSmall(context),
),
TextSpan(
text:
"\n\nConfigure these settings only if you know what you are doing!",
style: STextStyles.desktopTextExtraExtraSmall(
context),
),
],
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Padding(
padding: const EdgeInsets.all(10),
child: RichText(
textAlign: TextAlign.start,
text: TextSpan(
children: [
TextSpan(
text: "Advanced",
style: STextStyles.desktopTextSmall(context),
),
TextSpan(
text:
"\n\nConfigure these settings only if you know what you are doing!",
style: STextStyles.desktopTextExtraExtraSmall(
context),
),
],
),
),
),
),
const Padding(
padding: EdgeInsets.all(10.0),
child: Divider(
thickness: 0.5,
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(
"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(
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),
),
],
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;
},
),
),
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(
buttonHeight: ButtonHeight.xs,
label: "Edit",
width: 101,
onPressed: () async {
await showDialog<dynamic>(
context: context,
useSafeArea: false,
barrierDismissible: true,
builder: (context) {
return const DesktopManageBlockExplorersDialog();
},
);
},
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),
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(
padding: EdgeInsets.all(10.0),
child: Divider(
thickness: 0.5,
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(
"Units",
style: STextStyles.desktopTextExtraSmall(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark),
textAlign: TextAlign.left,
),
PrimaryButton(
buttonHeight: ButtonHeight.xs,
label: "Edit",
width: 101,
onPressed: () async {
await showDialog<dynamic>(
context: context,
useSafeArea: false,
barrierDismissible: true,
builder: (context) {
return const ManageCoinUnitsView();
},
);
},
),
],
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(
buttonHeight: ButtonHeight.xs,
label: "Edit",
width: 101,
onPressed: () async {
await showDialog<dynamic>(
context: context,
useSafeArea: false,
barrierDismissible: true,
builder: (context) {
return const DesktopManageBlockExplorersDialog();
},
);
},
),
],
),
),
),
const Padding(
padding: EdgeInsets.all(10.0),
child: Divider(
thickness: 0.5,
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(
"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();
},
);
},
),
],
Padding(
padding: const EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Units",
style: STextStyles.desktopTextExtraSmall(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark),
textAlign: TextAlign.left,
),
PrimaryButton(
buttonHeight: ButtonHeight.xs,
label: "Edit",
width: 101,
onPressed: () async {
await showDialog<dynamic>(
context: context,
useSafeArea: false,
barrierDismissible: true,
builder: (context) {
return const ManageCoinUnitsView();
},
);
},
),
],
),
),
),
const SizedBox(
height: 10,
),
],
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(
"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
Widget build(BuildContext context) {
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,
child: Column(
children: [