mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
Fix some colors (#2293)
* Fix some colors * fix(theme-updates): Modify condition for theme border style display when hasUnderlineBorder is true * fix(themes-updates): Adjust switch colors and modify payjoin hint text * fix: Crash report relating to success image display on successful exchange * fix(theme-updates): Adjust animated text max width to prevent overflows * fix(theme-updates): Adjust fee picker styling * fix(themes-updates): Remove text overflow on welcome screen animation --------- Co-authored-by: Blazebrain <davidadegoke16@gmail.com>
This commit is contained in:
parent
90aee053cd
commit
78bb170533
43 changed files with 275 additions and 227 deletions
|
@ -247,9 +247,11 @@ class CryptoBalanceWidget extends StatelessWidget {
|
|||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Icon(Icons.help_outline,
|
||||
size: 16,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant),
|
||||
child: Icon(
|
||||
Icons.help_outline,
|
||||
size: 16,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
@ -257,7 +259,7 @@ class CryptoBalanceWidget extends StatelessWidget {
|
|||
Observer(
|
||||
builder: (_) => StandardSwitch(
|
||||
value: dashboardViewModel.silentPaymentsScanningActive,
|
||||
onTaped: () => _toggleSilentPaymentsScanning(context),
|
||||
onTapped: () => _toggleSilentPaymentsScanning(context),
|
||||
),
|
||||
)
|
||||
],
|
||||
|
@ -333,13 +335,25 @@ class CryptoBalanceWidget extends StatelessWidget {
|
|||
Uri.parse("https://docs.cakewallet.com/cryptos/bitcoin/#payjoin"),
|
||||
mode: LaunchMode.externalApplication,
|
||||
),
|
||||
child: Text(
|
||||
S.of(context).learn_more,
|
||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
S.of(context).what_is_payjoin,
|
||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
height: 1,
|
||||
),
|
||||
softWrap: true,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Icon(
|
||||
Icons.help_outline,
|
||||
size: 16,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
height: 1,
|
||||
),
|
||||
softWrap: true,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
image: 'assets/images/payjoin.png',
|
||||
|
|
|
@ -37,7 +37,7 @@ class MobileExchangeCardsSection extends StatelessWidget {
|
|||
bottomLeft: Radius.circular(24),
|
||||
bottomRight: Radius.circular(24),
|
||||
),
|
||||
color: Theme.of(context).colorScheme.surfaceContainerLow,
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||
),
|
||||
padding: EdgeInsets.fromLTRB(24, 105, 24, 24),
|
||||
child: Column(
|
||||
|
|
|
@ -210,127 +210,133 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
|
|||
return;
|
||||
}
|
||||
|
||||
_exchangeStateReaction = reaction((_) => this.widget.exchangeTradeViewModel.sendViewModel.state,
|
||||
(ExecutionState state) async {
|
||||
if (dialogContext != null && dialogContext?.mounted == true) {
|
||||
Navigator.of(dialogContext!).pop();
|
||||
}
|
||||
|
||||
if (state is! IsExecutingState &&
|
||||
loadingBottomSheetContext != null &&
|
||||
loadingBottomSheetContext!.mounted) {
|
||||
Navigator.of(loadingBottomSheetContext!).pop();
|
||||
}
|
||||
|
||||
if (state is FailureState) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
showPopUp<void>(
|
||||
context: context,
|
||||
builder: (BuildContext popupContext) {
|
||||
return AlertWithOneAction(
|
||||
key: ValueKey('exchange_trade_page_send_failure_dialog_key'),
|
||||
buttonKey: ValueKey('exchange_trade_page_send_failure_dialog_button_key'),
|
||||
alertTitle: S.of(popupContext).error,
|
||||
alertContent: state.error,
|
||||
buttonText: S.of(popupContext).ok,
|
||||
buttonAction: () => Navigator.of(popupContext).pop());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (state is IsExecutingState) {
|
||||
// wait a bit to avoid showing the loading dialog if transaction is failed
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
final currentState = widget.exchangeTradeViewModel.sendViewModel.state;
|
||||
if (currentState is ExecutedSuccessfullyState || currentState is FailureState) {
|
||||
return;
|
||||
_exchangeStateReaction = reaction(
|
||||
(_) => this.widget.exchangeTradeViewModel.sendViewModel.state,
|
||||
(ExecutionState state) async {
|
||||
if (dialogContext != null && dialogContext?.mounted == true) {
|
||||
Navigator.of(dialogContext!).pop();
|
||||
}
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (context.mounted) {
|
||||
showModalBottomSheet<void>(
|
||||
context: context,
|
||||
isDismissible: false,
|
||||
builder: (BuildContext context) {
|
||||
loadingBottomSheetContext = context;
|
||||
return LoadingBottomSheet(
|
||||
titleText: S.of(context).generating_transaction,
|
||||
);
|
||||
},
|
||||
);
|
||||
if (state is! IsExecutingState &&
|
||||
loadingBottomSheetContext != null &&
|
||||
loadingBottomSheetContext!.mounted) {
|
||||
Navigator.of(loadingBottomSheetContext!).pop();
|
||||
}
|
||||
|
||||
if (state is FailureState) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
showPopUp<void>(
|
||||
context: context,
|
||||
builder: (BuildContext popupContext) {
|
||||
return AlertWithOneAction(
|
||||
key: ValueKey('exchange_trade_page_send_failure_dialog_key'),
|
||||
buttonKey: ValueKey('exchange_trade_page_send_failure_dialog_button_key'),
|
||||
alertTitle: S.of(popupContext).error,
|
||||
alertContent: state.error,
|
||||
buttonText: S.of(popupContext).ok,
|
||||
buttonAction: () => Navigator.of(popupContext).pop());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (state is IsExecutingState) {
|
||||
// wait a bit to avoid showing the loading dialog if transaction is failed
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
final currentState = widget.exchangeTradeViewModel.sendViewModel.state;
|
||||
if (currentState is ExecutedSuccessfullyState || currentState is FailureState) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (state is ExecutedSuccessfullyState) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (context.mounted) {
|
||||
showModalBottomSheet<void>(
|
||||
context: context,
|
||||
isDismissible: false,
|
||||
isScrollControlled: true,
|
||||
builder: (BuildContext bottomSheetContext) {
|
||||
return ConfirmSendingBottomSheet(
|
||||
key: ValueKey('exchange_trade_page_confirm_sending_bottom_sheet_key'),
|
||||
currentTheme: widget.currentTheme,
|
||||
walletType: widget.exchangeTradeViewModel.sendViewModel.walletType,
|
||||
titleText: S.of(bottomSheetContext).confirm_transaction,
|
||||
titleIconPath:
|
||||
widget.exchangeTradeViewModel.sendViewModel.selectedCryptoCurrency.iconPath,
|
||||
currency: widget.exchangeTradeViewModel.sendViewModel.selectedCryptoCurrency,
|
||||
amount: S.of(bottomSheetContext).send_amount,
|
||||
amountValue: widget
|
||||
.exchangeTradeViewModel.sendViewModel.pendingTransaction!.amountFormatted,
|
||||
fiatAmountValue: widget
|
||||
.exchangeTradeViewModel.sendViewModel.pendingTransactionFiatAmountFormatted,
|
||||
fee: isEVMCompatibleChain(widget.exchangeTradeViewModel.sendViewModel.walletType)
|
||||
? S.of(bottomSheetContext).send_estimated_fee
|
||||
: S.of(bottomSheetContext).send_fee,
|
||||
feeValue:
|
||||
widget.exchangeTradeViewModel.sendViewModel.pendingTransaction!.feeFormatted,
|
||||
feeFiatAmount: widget.exchangeTradeViewModel.sendViewModel
|
||||
.pendingTransactionFeeFiatAmountFormatted,
|
||||
outputs: widget.exchangeTradeViewModel.sendViewModel.outputs,
|
||||
onSlideComplete: () async {
|
||||
Navigator.of(bottomSheetContext).pop();
|
||||
widget.exchangeTradeViewModel.sendViewModel.commitTransaction(context);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (context.mounted) {
|
||||
showModalBottomSheet<void>(
|
||||
context: context,
|
||||
isDismissible: false,
|
||||
builder: (BuildContext context) {
|
||||
loadingBottomSheetContext = context;
|
||||
return LoadingBottomSheet(
|
||||
titleText: S.of(context).generating_transaction,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (state is TransactionCommitted) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
if (!mounted) return;
|
||||
if (state is ExecutedSuccessfullyState) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (context.mounted) {
|
||||
showModalBottomSheet<void>(
|
||||
context: context,
|
||||
isDismissible: false,
|
||||
isScrollControlled: true,
|
||||
builder: (BuildContext bottomSheetContext) {
|
||||
return ConfirmSendingBottomSheet(
|
||||
key: ValueKey('exchange_trade_page_confirm_sending_bottom_sheet_key'),
|
||||
currentTheme: widget.currentTheme,
|
||||
walletType: widget.exchangeTradeViewModel.sendViewModel.walletType,
|
||||
titleText: S.of(bottomSheetContext).confirm_transaction,
|
||||
titleIconPath:
|
||||
widget.exchangeTradeViewModel.sendViewModel.selectedCryptoCurrency.iconPath,
|
||||
currency: widget.exchangeTradeViewModel.sendViewModel.selectedCryptoCurrency,
|
||||
amount: S.of(bottomSheetContext).send_amount,
|
||||
amountValue: widget
|
||||
.exchangeTradeViewModel.sendViewModel.pendingTransaction!.amountFormatted,
|
||||
fiatAmountValue: widget
|
||||
.exchangeTradeViewModel.sendViewModel.pendingTransactionFiatAmountFormatted,
|
||||
fee:
|
||||
isEVMCompatibleChain(widget.exchangeTradeViewModel.sendViewModel.walletType)
|
||||
? S.of(bottomSheetContext).send_estimated_fee
|
||||
: S.of(bottomSheetContext).send_fee,
|
||||
feeValue: widget
|
||||
.exchangeTradeViewModel.sendViewModel.pendingTransaction!.feeFormatted,
|
||||
feeFiatAmount: widget.exchangeTradeViewModel.sendViewModel
|
||||
.pendingTransactionFeeFiatAmountFormatted,
|
||||
outputs: widget.exchangeTradeViewModel.sendViewModel.outputs,
|
||||
onSlideComplete: () async {
|
||||
Navigator.of(bottomSheetContext).pop();
|
||||
widget.exchangeTradeViewModel.sendViewModel.commitTransaction(context);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
await showModalBottomSheet<void>(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
builder: (BuildContext bottomSheetContext) {
|
||||
return InfoBottomSheet(
|
||||
currentTheme: widget.currentTheme,
|
||||
titleText: S.of(bottomSheetContext).transaction_sent,
|
||||
contentImage: 'assets/images/birthday_cake.svg',
|
||||
actionButtonText: S.of(bottomSheetContext).close,
|
||||
actionButtonKey: ValueKey('send_page_sent_dialog_ok_button_key'),
|
||||
actionButton: () {
|
||||
Navigator.of(bottomSheetContext).pop();
|
||||
if (mounted) {
|
||||
Navigator.of(context).pushNamedAndRemoveUntil(
|
||||
Routes.dashboard,
|
||||
(route) => false,
|
||||
);
|
||||
}
|
||||
RequestReviewHandler.requestReview();
|
||||
});
|
||||
if (state is TransactionCommitted) {
|
||||
WidgetsBinding.instance.addPostFrameCallback(
|
||||
(_) async {
|
||||
if (!mounted) return;
|
||||
|
||||
await showModalBottomSheet<void>(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
builder: (BuildContext bottomSheetContext) {
|
||||
return InfoBottomSheet(
|
||||
currentTheme: widget.currentTheme,
|
||||
titleText: S.of(bottomSheetContext).transaction_sent,
|
||||
contentImage: 'assets/images/birthday_cake.png',
|
||||
actionButtonText: S.of(bottomSheetContext).close,
|
||||
actionButtonKey: ValueKey('send_page_sent_dialog_ok_button_key'),
|
||||
actionButton: () {
|
||||
Navigator.of(bottomSheetContext).pop();
|
||||
if (mounted) {
|
||||
Navigator.of(context).pushNamedAndRemoveUntil(
|
||||
Routes.dashboard,
|
||||
(route) => false,
|
||||
);
|
||||
}
|
||||
RequestReviewHandler.requestReview();
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
_effectsInstalled = true;
|
||||
}
|
||||
|
|
|
@ -33,9 +33,9 @@ class ReleaseNotesScreen extends StatelessWidget {
|
|||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(30.0),
|
||||
gradient: LinearGradient(colors: [
|
||||
Theme.of(context).colorScheme.primaryContainer,
|
||||
Theme.of(context).colorScheme.secondaryContainer,
|
||||
], begin: Alignment.centerLeft, end: Alignment.centerRight)),
|
||||
Theme.of(context).colorScheme.surface,
|
||||
Theme.of(context).colorScheme.surfaceContainer,
|
||||
], begin: Alignment.topLeft, end: Alignment.bottomRight)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24.0),
|
||||
child: Stack(
|
||||
|
|
|
@ -18,8 +18,10 @@ class SettingsSwitcherCell extends StandardListRow {
|
|||
final Widget? leading;
|
||||
|
||||
@override
|
||||
Widget buildTrailing(BuildContext context) =>
|
||||
StandardSwitch(value: value, onTaped: () => onValueChange?.call(context, !value));
|
||||
Widget buildTrailing(BuildContext context) => StandardSwitch(
|
||||
value: value,
|
||||
onTapped: () => onValueChange?.call(context, !value),
|
||||
);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -40,8 +42,7 @@ class SettingsSwitcherCell extends StandardListRow {
|
|||
//backgroundColor: MaterialStateProperty.all(Theme.of(context).colorScheme.surfaceContainer),
|
||||
shape: WidgetStateProperty.all(
|
||||
RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10)
|
||||
),
|
||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -57,7 +58,6 @@ class SettingsSwitcherCell extends StandardListRow {
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget? buildLeading(BuildContext context) => leading;
|
||||
}
|
||||
|
|
|
@ -3,10 +3,10 @@ import 'package:flutter/material.dart';
|
|||
|
||||
class UnspentCoinsSwitchRow extends StatelessWidget {
|
||||
UnspentCoinsSwitchRow(
|
||||
{required this.title,
|
||||
required this.switchValue,
|
||||
required this.onSwitchValueChange,
|
||||
this.titleFontSize = 14});
|
||||
{required this.title,
|
||||
required this.switchValue,
|
||||
required this.onSwitchValueChange,
|
||||
this.titleFontSize = 14});
|
||||
|
||||
final String title;
|
||||
final double titleFontSize;
|
||||
|
@ -19,25 +19,29 @@ class UnspentCoinsSwitchRow extends StatelessWidget {
|
|||
width: double.infinity,
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(left: 24, top: 16, bottom: 16, right: 24),
|
||||
padding: const EdgeInsets.only(left: 24, top: 16, bottom: 16, right: 24),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(title,
|
||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||
fontSize: titleFontSize,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant),
|
||||
textAlign: TextAlign.left),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 12),
|
||||
child: StandardSwitch(
|
||||
value: switchValue,
|
||||
onTaped: () => onSwitchValueChange(!switchValue))
|
||||
)
|
||||
]),
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
title,
|
||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||
fontSize: titleFontSize,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 12),
|
||||
child: StandardSwitch(
|
||||
value: switchValue,
|
||||
onTapped: () => onSwitchValueChange(!switchValue),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -164,6 +164,7 @@ class CreatePinWelcomePage extends BasePage {
|
|||
if (!isMoneroOnly)
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
AnimatedTypingText(
|
||||
words: [S.current.payments, S.current.privacy, S.current.security],
|
||||
|
@ -175,7 +176,7 @@ class CreatePinWelcomePage extends BasePage {
|
|||
cursorHeight: 24,
|
||||
cursorWidth: 4,
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
SizedBox(width: 4),
|
||||
Text(
|
||||
S.current.made_easy,
|
||||
style: Theme.of(context).textTheme.titleLarge?.copyWith(
|
||||
|
|
|
@ -33,10 +33,9 @@ class _AnimatedTypingTextState extends State<AnimatedTypingText> with TickerProv
|
|||
|
||||
String _displayText = '';
|
||||
|
||||
double _maxTextWidth = 0;
|
||||
int _currentWordIndex = 0;
|
||||
int _currentCharIndex = 0;
|
||||
|
||||
|
||||
bool _isTyping = true;
|
||||
bool _isPaused = false;
|
||||
bool _isWaitingForPause = false;
|
||||
|
@ -61,10 +60,6 @@ class _AnimatedTypingTextState extends State<AnimatedTypingText> with TickerProv
|
|||
),
|
||||
);
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_calculateMaxTextWidth();
|
||||
});
|
||||
|
||||
_controller.addStatusListener((status) {
|
||||
if (status == AnimationStatus.completed) {
|
||||
_updateText();
|
||||
|
@ -78,24 +73,6 @@ class _AnimatedTypingTextState extends State<AnimatedTypingText> with TickerProv
|
|||
_controller.forward();
|
||||
}
|
||||
|
||||
void _calculateMaxTextWidth() {
|
||||
final textStyle = widget.style ?? DefaultTextStyle.of(context).style;
|
||||
double maxWidth = 0;
|
||||
final textPainter = TextPainter(
|
||||
textDirection: TextDirection.ltr,
|
||||
);
|
||||
for (final word in widget.words) {
|
||||
textPainter.text = TextSpan(text: word, style: textStyle);
|
||||
textPainter.layout();
|
||||
if (textPainter.width > maxWidth) {
|
||||
maxWidth = textPainter.width;
|
||||
}
|
||||
}
|
||||
setState(() {
|
||||
_maxTextWidth = maxWidth;
|
||||
});
|
||||
}
|
||||
|
||||
void _updateText() {
|
||||
if (_isWaitingForPause) return;
|
||||
|
||||
|
@ -157,38 +134,35 @@ class _AnimatedTypingTextState extends State<AnimatedTypingText> with TickerProv
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
width: _maxTextWidth + widget.cursorWidth,
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
// Fixed cursor position
|
||||
Positioned(
|
||||
right: 0,
|
||||
child: AnimatedBuilder(
|
||||
animation: _cursorAnimation,
|
||||
builder: (context, child) {
|
||||
return Opacity(
|
||||
opacity: _cursorAnimation.value,
|
||||
child: Container(
|
||||
width: widget.cursorWidth,
|
||||
height: widget.cursorHeight,
|
||||
color: widget.cursorColor,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
return Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
// Fixed cursor position
|
||||
Positioned(
|
||||
right: 0,
|
||||
child: AnimatedBuilder(
|
||||
animation: _cursorAnimation,
|
||||
builder: (context, child) {
|
||||
return Opacity(
|
||||
opacity: _cursorAnimation.value,
|
||||
child: Container(
|
||||
width: widget.cursorWidth,
|
||||
height: widget.cursorHeight,
|
||||
color: widget.cursorColor,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
// Animated text
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text(
|
||||
_displayText + ' ',
|
||||
style: widget.style,
|
||||
),
|
||||
),
|
||||
// Animated text
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text(
|
||||
_displayText + ' ',
|
||||
style: widget.style,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -135,6 +135,15 @@ class BaseTextFormField extends StatelessWidget {
|
|||
hintText: hasUnderlineBorder ? hintText : null,
|
||||
labelText: !hasUnderlineBorder ? hintText : null,
|
||||
labelStyle: !hasUnderlineBorder ? placeholderTextStyle : null,
|
||||
border: hasUnderlineBorder
|
||||
? UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).colorScheme.outlineVariant,
|
||||
style: borderWidth == 0.0 ? BorderStyle.none : BorderStyle.solid,
|
||||
width: borderWidth,
|
||||
),
|
||||
)
|
||||
: null,
|
||||
focusedBorder: hasUnderlineBorder
|
||||
? UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -156,7 +165,7 @@ class BaseTextFormField extends StatelessWidget {
|
|||
? UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).colorScheme.outlineVariant,
|
||||
style: borderWidth == 1 ? BorderStyle.none : BorderStyle.solid,
|
||||
style: borderWidth == 0.0 ? BorderStyle.none : BorderStyle.solid,
|
||||
width: borderWidth,
|
||||
),
|
||||
)
|
||||
|
|
|
@ -144,7 +144,7 @@ class BlockchainHeightState extends State<BlockchainHeightWidget> {
|
|||
padding: const EdgeInsets.only(right: 8),
|
||||
child: StandardSwitch(
|
||||
value: widget.doSingleScan,
|
||||
onTaped: () => widget.toggleSingleScan?.call(),
|
||||
onTapped: () => widget.toggleSingleScan?.call(),
|
||||
),
|
||||
)
|
||||
],
|
||||
|
|
|
@ -4,6 +4,7 @@ import 'dart:math';
|
|||
|
||||
import 'package:cake_wallet/entities/seed_type.dart';
|
||||
import 'package:cake_wallet/src/widgets/search_bar_widget.dart';
|
||||
import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
|
||||
import 'package:cake_wallet/utils/responsive_layout_util.dart';
|
||||
import 'package:cw_core/transaction_priority.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
@ -157,7 +158,6 @@ class _PickerState<Item> extends State<Picker<Item>> {
|
|||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||
fontSize: 18,
|
||||
|
||||
fontWeight: FontWeight.bold,
|
||||
decoration: TextDecoration.none,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
|
@ -358,7 +358,6 @@ class _PickerState<Item> extends State<Picker<Item>> {
|
|||
tag,
|
||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||
fontSize: 7.0,
|
||||
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
),
|
||||
|
@ -430,7 +429,6 @@ class _PickerState<Item> extends State<Picker<Item>> {
|
|||
softWrap: true,
|
||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||
fontSize: 16,
|
||||
|
||||
fontWeight: FontWeight.w700,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
decoration: TextDecoration.none,
|
||||
|
@ -448,7 +446,6 @@ class _PickerState<Item> extends State<Picker<Item>> {
|
|||
tag,
|
||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||
fontSize: 7.0,
|
||||
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
),
|
||||
|
@ -522,10 +519,16 @@ class _PickerState<Item> extends State<Picker<Item>> {
|
|||
}
|
||||
|
||||
Widget buildSlider({required int index, required bool isActivated}) {
|
||||
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
|
||||
return Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Slider(
|
||||
activeColor: Theme.of(context).colorScheme.primary,
|
||||
inactiveColor: isDarkMode
|
||||
? CustomThemeColors.toggleColorOffStateDark
|
||||
: CustomThemeColors.toggleColorOffStateLight,
|
||||
thumbColor: CustomThemeColors.toggleKnobStateColorLight,
|
||||
value: widget.sliderValue == null || widget.sliderValue! < 1 ? 1 : widget.sliderValue!,
|
||||
onChanged: isActivated ? widget.onSliderChanged : null,
|
||||
min: widget.minValue ?? 1,
|
||||
|
|
|
@ -43,7 +43,7 @@ class _ServicesUpdatesWidgetState extends State<ServicesUpdatesWidget> {
|
|||
child: SvgPicture.asset(
|
||||
"assets/images/notification_icon.svg",
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
width: 30,
|
||||
width: 20,
|
||||
placeholderBuilder: (_) => Icon(Icons.error),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class StandardSwitch extends StatefulWidget {
|
||||
const StandardSwitch({required this.value, required this.onTaped});
|
||||
const StandardSwitch({required this.value, required this.onTapped});
|
||||
|
||||
final bool value;
|
||||
final VoidCallback onTaped;
|
||||
final VoidCallback onTapped;
|
||||
|
||||
@override
|
||||
StandardSwitchState createState() => StandardSwitchState();
|
||||
|
@ -14,10 +14,11 @@ class StandardSwitch extends StatefulWidget {
|
|||
class StandardSwitchState extends State<StandardSwitch> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
|
||||
return Semantics(
|
||||
toggled: widget.value,
|
||||
child: GestureDetector(
|
||||
onTap: widget.onTaped,
|
||||
onTap: widget.onTapped,
|
||||
child: AnimatedContainer(
|
||||
padding: EdgeInsets.only(left: 2.0, right: 2.0),
|
||||
alignment: widget.value ? Alignment.centerRight : Alignment.centerLeft,
|
||||
|
@ -26,8 +27,10 @@ class StandardSwitchState extends State<StandardSwitch> {
|
|||
height: 28,
|
||||
decoration: BoxDecoration(
|
||||
color: widget.value
|
||||
? Theme.of(context).colorScheme.surfaceContainerHighest
|
||||
: Theme.of(context).colorScheme.surfaceContainerLowest,
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: isDarkMode
|
||||
? CustomThemeColors.toggleColorOffStateDark
|
||||
: CustomThemeColors.toggleColorOffStateLight,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(14.0),
|
||||
),
|
||||
|
@ -36,7 +39,9 @@ class StandardSwitchState extends State<StandardSwitch> {
|
|||
width: 24.0,
|
||||
height: 24.0,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
color: isDarkMode
|
||||
? Theme.of(context).colorScheme.surface
|
||||
: CustomThemeColors.toggleKnobStateColorLight,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
|
|
|
@ -38,8 +38,8 @@ class DarkTheme extends MaterialThemeBase {
|
|||
tertiaryContainer: const Color(0xFF1F2832),
|
||||
onTertiaryContainer: const Color(0xFFA8B3C6),
|
||||
error: errorColor,
|
||||
onError: const Color(0xFF690005),
|
||||
errorContainer: const Color(0xFFB71919),
|
||||
onError: const Color(0xFFB71919),
|
||||
errorContainer: const Color(0xFFC53636),
|
||||
onErrorContainer: const Color(0xFFFFDAD6),
|
||||
surface: surfaceColor,
|
||||
onSurface: const Color(0xFFD7E2F7),
|
||||
|
|
|
@ -11,9 +11,13 @@ class CustomThemeColors {
|
|||
|
||||
static const backgroundGradientColorDark = Color(0xFF0F1A36);
|
||||
static const backgroundGradientColorLight = Color(0xFFE7E7FD);
|
||||
|
||||
|
||||
static const cardGradientColorPrimaryDark = Color(0xFF2B3A67);
|
||||
static const cardGradientColorPrimaryLight = Color(0xFFFFFFFF);
|
||||
static const cardGradientColorSecondaryDark = Color(0xFF1C2A4F);
|
||||
static const cardGradientColorSecondaryLight = Color(0xFFF3F3FF);
|
||||
|
||||
static const toggleKnobStateColorLight = Color(0xFFFFFFFF);
|
||||
static const toggleColorOffStateLight = Color(0xFFCACAE7);
|
||||
static const toggleColorOffStateDark = Color(0xFF3A4F88);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue