Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
ref
.read(localeServiceChangeNotifierProvider.notifier)
.loadLocale(notify: false);
ref.read(localeServiceChangeNotifierProvider.notifier).follow();

WidgetsBinding.instance.addPostFrameCallback((_) async {
//Add themes path to provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
postfix = "days";
} else {
// if greater than a week return the actual date
return DateFormat.yMMMMd(
ref.read(localeServiceChangeNotifierProvider).locale,
).format(time);
return DateFormat.yMMMMd('en_US').format(time);
}

if (value == 1) {
Expand All @@ -95,25 +93,25 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
title: "Enable Auto Backup",
message: "To enable Auto Backup, you need to create a backup file.",
leftButton: TextButton(
style: Theme.of(
context,
).extension<StackColors>()!.getSecondaryEnabledButtonStyle(context),
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Back",
style: STextStyles.button(context).copyWith(
color: Theme.of(
context,
).extension<StackColors>()!.accentColorDark,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
),
),
onPressed: () {
Navigator.of(context).pop();
},
),
rightButton: TextButton(
style: Theme.of(
context,
).extension<StackColors>()!.getPrimaryEnabledButtonStyle(context),
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonStyle(context),
child: Text("Continue", style: STextStyles.button(context)),
onPressed: () {
Navigator.of(context).pop(true);
Expand All @@ -124,15 +122,15 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
);
if (mounted) {
if (result is bool && result) {
Navigator.of(context).pushNamed(CreateAutoBackupView.routeName).then((
_,
) {
// set toggle to correct state
if (_toggle !=
ref.read(prefsChangeNotifierProvider).isAutoBackupEnabled) {
toggleController.activate?.call();
}
});
Navigator.of(context)
.pushNamed(CreateAutoBackupView.routeName)
.then((_) {
// set toggle to correct state
if (_toggle !=
ref.read(prefsChangeNotifierProvider).isAutoBackupEnabled) {
toggleController.activate?.call();
}
});
} else {
toggleController.activate?.call();
}
Expand All @@ -147,28 +145,27 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
builder: (context) {
return StackDialog(
title: "Disable Auto Backup",
message:
"You are turning off Auto Backup. You can turn it back on at any time. Your previous Auto Backup file will not be deleted. Remember to backup your wallets manually so you don't lose important information.",
message: "You are turning off Auto Backup. You can turn it back on at any time. Your previous Auto Backup file will not be deleted. Remember to backup your wallets manually so you don't lose important information.",
leftButton: TextButton(
style: Theme.of(
context,
).extension<StackColors>()!.getSecondaryEnabledButtonStyle(context),
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonStyle(context),
child: Text(
"Back",
style: STextStyles.button(context).copyWith(
color: Theme.of(
context,
).extension<StackColors>()!.accentColorDark,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
),
),
onPressed: () {
Navigator.of(context).pop();
},
),
rightButton: TextButton(
style: Theme.of(
context,
).extension<StackColors>()!.getPrimaryEnabledButtonStyle(context),
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonStyle(context),
child: Text("Disable", style: STextStyles.button(context)),
onPressed: () {
Navigator.of(context).pop(true);
Expand All @@ -180,9 +177,8 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
if (mounted) {
if (result is bool && result) {
ref.read(prefsChangeNotifierProvider).isAutoBackupEnabled = false;
Navigator.of(
context,
).popUntil(ModalRoute.withName(AutoBackupView.routeName));
Navigator.of(context)
.popUntil(ModalRoute.withName(AutoBackupView.routeName));
} else {
toggleController.activate?.call();
}
Expand Down Expand Up @@ -432,9 +428,10 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
controller: frequencyController,
enabled: false,
style: STextStyles.field(context).copyWith(
color: Theme.of(
context,
).extension<StackColors>()!.textDark.withOpacity(0.5),
color: Theme.of(context)
.extension<StackColors>()!
.textDark
.withOpacity(0.5),
),
toolbarOptions: const ToolbarOptions(
copy: true,
Expand All @@ -448,9 +445,8 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
child: CustomTextButton(
text: "Edit Auto Backup",
onTap: () async {
Navigator.of(
context,
).pushNamed(EditAutoBackupView.routeName);
Navigator.of(context)
.pushNamed(EditAutoBackupView.routeName);
},
),
),
Expand Down
113 changes: 57 additions & 56 deletions lib/pages_desktop_specific/my_stack_view/wallet_summary_table.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,8 @@ class _WalletTableState extends ConsumerState<WalletSummaryTable> {

return ConditionalParent(
condition: index + 1 == walletsByCoin.length,
builder:
(child) => Padding(
padding: const EdgeInsets.only(bottom: 16),
child: child,
),
builder: (child) =>
Padding(padding: const EdgeInsets.only(bottom: 16), child: child),
child: DesktopWalletSummaryRow(
key: Key("DesktopWalletSummaryRow_key_${coin.identifier}"),
coin: coin,
Expand Down Expand Up @@ -174,41 +171,40 @@ class _DesktopWalletSummaryRowState
if (mounted) {
await showDialog<void>(
context: context,
builder:
(_) => DesktopDialog(
maxHeight: 600,
maxWidth: 700,
child: Column(
builder: (_) => DesktopDialog(
maxHeight: 600,
maxWidth: 700,
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.only(left: 32),
child: Text(
"${widget.coin.prettyName} (${widget.coin.ticker}) wallets",
style: STextStyles.desktopH3(context),
),
),
const DesktopDialogCloseButton(),
],
),
Expanded(
child: Padding(
padding: const EdgeInsets.only(
left: 32,
right: 32,
bottom: 32,
),
child: WalletsOverview(
coin: widget.coin,
navigatorState: Navigator.of(context),
),
Padding(
padding: const EdgeInsets.only(left: 32),
child: Text(
"${widget.coin.prettyName} (${widget.coin.ticker}) wallets",
style: STextStyles.desktopH3(context),
),
),
const DesktopDialogCloseButton(),
],
),
),
Expanded(
child: Padding(
padding: const EdgeInsets.only(
left: 32,
right: 32,
bottom: 32,
),
child: WalletsOverview(
coin: widget.coin,
navigatorState: Navigator.of(context),
),
),
),
],
),
),
);
}
} finally {
Expand All @@ -228,8 +224,9 @@ class _DesktopWalletSummaryRowState
child: RoundedWhiteContainer(
padding: const EdgeInsets.all(20),
hoverColor: Colors.transparent,
onPressed:
goStraightIntoWallet ? _onPressedSingleWalletDesktop : _onPressed,
onPressed: goStraightIntoWallet
? _onPressedSingleWalletDesktop
: _onPressed,
child: Row(
children: [
Expanded(
Expand All @@ -245,8 +242,9 @@ class _DesktopWalletSummaryRowState
Text(
widget.coin.prettyName,
style: STextStyles.desktopTextExtraSmall(context).copyWith(
color:
Theme.of(context).extension<StackColors>()!.textDark,
color: Theme.of(context)
.extension<StackColors>()!
.textDark,
),
),
],
Expand All @@ -259,8 +257,9 @@ class _DesktopWalletSummaryRowState
? "${widget.walletCount} wallet"
: "${widget.walletCount} wallets",
style: STextStyles.desktopTextExtraSmall(context).copyWith(
color:
Theme.of(context).extension<StackColors>()!.textSubtitle1,
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle1,
),
),
),
Expand Down Expand Up @@ -288,21 +287,24 @@ class TablePriceInfo extends ConsumerWidget {
prefsChangeNotifierProvider.select((value) => value.currency),
);

final priceString = Amount.fromDecimal(
price.value,
fractionDigits: 2,
).fiatString(
locale: ref.watch(localeServiceChangeNotifierProvider.notifier).locale,
);
final priceString = Amount.fromDecimal(price.value, fractionDigits: 2)
.fiatString(
locale: ref.watch(
localeServiceChangeNotifierProvider.select((value) => value.locale),
),
);

var percentChangedColor =
Theme.of(context).extension<StackColors>()!.textDark;
var percentChangedColor = Theme.of(context)
.extension<StackColors>()!
.textDark;
if (price.change24h > 0) {
percentChangedColor =
Theme.of(context).extension<StackColors>()!.accentColorGreen;
percentChangedColor = Theme.of(context)
.extension<StackColors>()!
.accentColorGreen;
} else if (price.change24h < 0) {
percentChangedColor =
Theme.of(context).extension<StackColors>()!.accentColorRed;
percentChangedColor = Theme.of(context)
.extension<StackColors>()!
.accentColorRed;
}

return Row(
Expand All @@ -316,9 +318,8 @@ class TablePriceInfo extends ConsumerWidget {
),
Text(
"${price.change24h.toStringAsFixed(2)}%",
style: STextStyles.desktopTextExtraSmall(
context,
).copyWith(color: percentChangedColor),
style: STextStyles.desktopTextExtraSmall(context)
.copyWith(color: percentChangedColor),
),
],
);
Expand Down
Loading
Loading