Skip to content
Draft
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
14 changes: 7 additions & 7 deletions lib/notifications/notification_card_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ class NotificationCardLayout extends StatelessWidget {
final colors = Theme.of(context).extension<StackColors>()!;

final TextStyle titleStyle = isDesktop
? STextStyles.desktopTextExtraExtraSmall(
context,
).copyWith(color: colors.textDark)
? STextStyles.desktopTextExtraExtraSmall(context)
.copyWith(color: colors.textDark)
: STextStyles.titleBold12(context);
final TextStyle subStyle = isDesktop
? STextStyles.desktopTextExtraExtraSmall(
context,
).copyWith(color: colors.textSubtitle1)
? STextStyles.desktopTextExtraExtraSmall(context)
.copyWith(color: colors.textSubtitle1)
: STextStyles.label(context);

return Stack(
Expand Down Expand Up @@ -85,7 +83,9 @@ class NotificationCardLayout extends StatelessWidget {
),
if (read)
Positioned.fill(
child: RoundedContainer(color: colors.background.withOpacity(0.5)),
child: RoundedContainer(
color: colors.background.withValues(alpha: 0.5),
),
),
],
);
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/buy_view/buy_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ class _BuyFormState extends ConsumerState<BuyForm> {
? Theme.of(context)
.extension<StackColors>()!
.currencyListItemBG
.withOpacity(_hovering1 ? 0.3 : 0)
.withValues(alpha: _hovering1 ? 0.3 : 0)
: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
Expand Down Expand Up @@ -946,7 +946,7 @@ class _BuyFormState extends ConsumerState<BuyForm> {
? Theme.of(context)
.extension<StackColors>()!
.currencyListItemBG
.withOpacity(_hovering2 ? 0.3 : 0)
.withValues(alpha: _hovering2 ? 0.3 : 0)
: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
Expand Down
7 changes: 4 additions & 3 deletions lib/pages/buy_view/buy_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ class _BuyViewState extends ConsumerState<BuyView> {
),
if (torEnabled)
Container(
color: Theme.of(
context,
).extension<StackColors>()!.overlay.withOpacity(0.7),
color: Theme.of(context)
.extension<StackColors>()!
.overlay
.withValues(alpha: 0.7),
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: const StackDialog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class _ExchangeCurrencySelectionViewState
color: Theme.of(context)
.extension<StackColors>()!
.overlay
.withOpacity(0.6),
.withValues(alpha: 0.6),
child: const CustomLoadingOverlay(
message: "Loading currencies",
eventBus: null,
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/exchange_view/exchange_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
color: Theme.of(context)
.extension<StackColors>()!
.overlay
.withOpacity(0.6),
.withValues(alpha: 0.6),
child: const CustomLoadingOverlay(
message: "Updating exchange rate",
eventBus: null,
Expand Down
56 changes: 28 additions & 28 deletions lib/pages/exchange_view/exchange_loading_overlay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ import '../../widgets/custom_loading_overlay.dart';
import '../../widgets/stack_dialog.dart';

class ExchangeLoadingOverlayView extends ConsumerStatefulWidget {
const ExchangeLoadingOverlayView({
super.key,
required this.unawaitedLoad,
});
const ExchangeLoadingOverlayView({super.key, required this.unawaitedLoad});

final VoidCallback unawaitedLoad;

Expand All @@ -39,10 +36,12 @@ class _ExchangeLoadingOverlayViewState

@override
void initState() {
_statusEst =
ref.read(changeNowEstimatedInitialLoadStatusStateProvider.state).state;
_statusFixed =
ref.read(changeNowFixedInitialLoadStatusStateProvider.state).state;
_statusEst = ref
.read(changeNowEstimatedInitialLoadStatusStateProvider.state)
.state;
_statusFixed = ref
.read(changeNowFixedInitialLoadStatusStateProvider.state)
.state;

super.initState();
}
Expand All @@ -52,24 +51,26 @@ class _ExchangeLoadingOverlayViewState
debugPrint("BUILD: $runtimeType");

ref.listen(
changeNowEstimatedInitialLoadStatusStateProvider
.select((value) => value), (previous, next) {
if (next is ChangeNowLoadStatus) {
setState(() {
_statusEst = next;
});
}
});
changeNowEstimatedInitialLoadStatusStateProvider.select((value) => value),
(previous, next) {
if (next is ChangeNowLoadStatus) {
setState(() {
_statusEst = next;
});
}
},
);

ref.listen(
changeNowFixedInitialLoadStatusStateProvider.select((value) => value),
(previous, next) {
if (next is ChangeNowLoadStatus) {
setState(() {
_statusFixed = next;
});
}
});
changeNowFixedInitialLoadStatusStateProvider.select((value) => value),
(previous, next) {
if (next is ChangeNowLoadStatus) {
setState(() {
_statusFixed = next;
});
}
},
);

return Stack(
children: [
Expand All @@ -79,7 +80,7 @@ class _ExchangeLoadingOverlayViewState
color: Theme.of(context)
.extension<StackColors>()!
.overlay
.withOpacity(0.7),
.withValues(alpha: 0.7),
child: const CustomLoadingOverlay(
message: "Loading Exchange data",
eventBus: null,
Expand All @@ -93,14 +94,13 @@ class _ExchangeLoadingOverlayViewState
color: Theme.of(context)
.extension<StackColors>()!
.overlay
.withOpacity(0.7),
.withValues(alpha: 0.7),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
StackDialog(
title: "Failed to fetch Exchange data",
message:
"Exchange requires a working internet connection. Tap OK to try fetching again.",
message: "Exchange requires a working internet connection. Tap OK to try fetching again.",
rightButton: TextButton(
style: Theme.of(context)
.extension<StackColors>()!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class _Step3ViewState extends ConsumerState<Step3View> {
color: Theme.of(context)
.extension<StackColors>()!
.overlay
.withOpacity(0.6),
.withValues(alpha: 0.6),
child: const CustomLoadingOverlay(
message: "Creating a trade",
eventBus: null,
Expand Down
39 changes: 18 additions & 21 deletions lib/pages/exchange_view/exchange_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
children: [
child,
Material(
color: Theme.of(
context,
).extension<StackColors>()!.overlay.withOpacity(0.6),
color: Theme.of(context)
.extension<StackColors>()!
.overlay
.withValues(alpha: 0.6),
child: const CustomLoadingOverlay(
message: "Updating exchange data",
subMessage: "This could take a few minutes",
Expand Down Expand Up @@ -151,10 +152,9 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
Text(
"Trades",
style: STextStyles.itemSubtitle(context).copyWith(
color:
Theme.of(
context,
).extension<StackColors>()!.textDark3,
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
),
),
const SizedBox(height: 12),
Expand All @@ -173,10 +173,9 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
onTap: () async {
final String tradeId = trades[index].tradeId;

final lookup =
ref
.read(tradeSentFromStackLookupProvider)
.all;
final lookup = ref
.read(tradeSentFromStackLookupProvider)
.all;

//todo: check if print needed
// debugPrint("ALL: $lookup");
Expand All @@ -198,12 +197,11 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
//todo: check if print needed
// debugPrint("name: ${manager.walletName}");

final tx =
await MainDB.instance
.getTransactions(walletIds.first)
.filter()
.txidEqualTo(txid)
.findFirst();
final tx = await MainDB.instance
.getTransactions(walletIds.first)
.filter()
.txidEqualTo(txid)
.findFirst();

if (mounted) {
unawaited(
Expand Down Expand Up @@ -242,10 +240,9 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
padding: const EdgeInsets.symmetric(horizontal: 4),
child: Container(
decoration: BoxDecoration(
color:
Theme.of(
context,
).extension<StackColors>()!.popupBG,
color: Theme.of(context)
.extension<StackColors>()!
.popupBG,
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/exchange_view/send_from_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ class _SendFromCardState extends ConsumerState<SendFromCard> {
children: [
Container(
decoration: BoxDecoration(
color: ref.watch(pCoinColor(coin)).withOpacity(0.5),
color: ref.watch(pCoinColor(coin)).withValues(alpha: 0.5),
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
Expand Down
12 changes: 7 additions & 5 deletions lib/pages/exchange_view/wallet_initiated_exchange_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ class _WalletInitiatedExchangeViewState
children: [
child,
Material(
color: Theme.of(
context,
).extension<StackColors>()!.overlay.withOpacity(0.6),
color: Theme.of(context)
.extension<StackColors>()!
.overlay
.withValues(alpha: 0.6),
child: const CustomLoadingOverlay(
message: "Updating exchange data",
subMessage: "This could take a few minutes",
Expand All @@ -125,8 +126,9 @@ class _WalletInitiatedExchangeViewState
},
child: Background(
child: Scaffold(
backgroundColor:
Theme.of(context).extension<StackColors>()!.background,
backgroundColor: Theme.of(context)
.extension<StackColors>()!
.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
Expand Down
38 changes: 15 additions & 23 deletions lib/pages/paynym/subwidgets/paynym_card_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

import '../../../models/paynym/paynym_account_lite.dart';
import '../dialogs/paynym_details_popup.dart';
import 'paynym_bot.dart';
Expand Down Expand Up @@ -44,16 +45,17 @@ class _PaynymCardButtonState extends ConsumerState<PaynymCardButton> {
padding: const EdgeInsets.all(4),
child: RoundedContainer(
padding: const EdgeInsets.all(0),
color: isDesktop &&
color:
isDesktop &&
ref
.watch(selectedPaynymDetailsItemProvider.state)
.state
?.nymId ==
widget.accountLite.nymId
? Theme.of(context)
.extension<StackColors>()!
.accentColorDark
.withOpacity(0.08)
.extension<StackColors>()!
.accentColorDark
.withValues(alpha: 0.08)
: Colors.transparent,
child: RawMaterialButton(
padding: const EdgeInsets.all(0),
Expand All @@ -79,20 +81,12 @@ class _PaynymCardButtonState extends ConsumerState<PaynymCardButton> {
},
child: Padding(
padding: isDesktop
? const EdgeInsets.symmetric(
vertical: 8,
horizontal: 12,
)
? const EdgeInsets.symmetric(vertical: 8, horizontal: 12)
: const EdgeInsets.all(8.0),
child: Row(
children: [
PayNymBot(
size: 36,
paymentCodeString: widget.accountLite.code,
),
const SizedBox(
width: 12,
),
PayNymBot(size: 36, paymentCodeString: widget.accountLite.code),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
Expand All @@ -101,16 +95,14 @@ class _PaynymCardButtonState extends ConsumerState<PaynymCardButton> {
widget.accountLite.nymName,
style: isDesktop
? STextStyles.desktopTextExtraExtraSmall(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textFieldActiveText,
)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textFieldActiveText,
)
: STextStyles.w500_14(context),
),
const SizedBox(
height: 2,
),
const SizedBox(height: 2),
Text(
Format.shorten(widget.accountLite.code, 12, 5),
style: isDesktop
Expand Down
Loading
Loading