diff --git a/lib/_ui/alert.dart b/lib/_ui/alert.dart index a0ea5406..33aa0e97 100644 --- a/lib/_ui/alert.dart +++ b/lib/_ui/alert.dart @@ -25,7 +25,6 @@ class BBAlert extends StatelessWidget { static Future _openPopUp(BuildContext context, AlertData alertData) { return showGeneralDialog( barrierLabel: 'showGeneralDialog', - barrierDismissible: false, transitionDuration: const Duration(milliseconds: 600), context: context, pageBuilder: (context, _, __) { @@ -172,13 +171,13 @@ class BBAlert extends StatelessWidget { child: SizedBox( width: width, child: AlertDialog( - backgroundColor: context.colour.background, + backgroundColor: context.colour.primaryContainer, title: title != null ? BBText.titleLarge(title ?? '') : Container(), content: BBText.error(text), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(32)), actions: buttons, - surfaceTintColor: context.colour.background, + surfaceTintColor: context.colour.primaryContainer, ), ), ); diff --git a/lib/_ui/app_bar.dart b/lib/_ui/app_bar.dart index 3d891233..de2f6d02 100644 --- a/lib/_ui/app_bar.dart +++ b/lib/_ui/app_bar.dart @@ -16,7 +16,7 @@ class BBAppBar extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - color: context.colour.background, + color: context.colour.primaryContainer, height: double.infinity, child: Row( crossAxisAlignment: CrossAxisAlignment.end, @@ -28,7 +28,7 @@ class BBAppBar extends StatelessWidget { icon: const FaIcon(FontAwesomeIcons.angleLeft), padding: EdgeInsets.zero, onPressed: onBack, - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ).animate(delay: 100.ms).fadeIn(), ), ], diff --git a/lib/_ui/atoms/bb_form_field.dart b/lib/_ui/atoms/bb_form_field.dart index d9ddee0c..3facea46 100644 --- a/lib/_ui/atoms/bb_form_field.dart +++ b/lib/_ui/atoms/bb_form_field.dart @@ -29,7 +29,7 @@ class BBFormField extends StatelessWidget { Widget build(BuildContext context) { final borderColor = selected ? context.colour.primary - : context.colour.onBackground.withOpacity(0.2); + : context.colour.onPrimaryContainer.withOpacity(0.2); // TODO: Ideally move this to theme file final InputDecoration decoration = InputDecoration( diff --git a/lib/_ui/bottom_bar.dart b/lib/_ui/bottom_bar.dart index edf360cc..7c902bb0 100644 --- a/lib/_ui/bottom_bar.dart +++ b/lib/_ui/bottom_bar.dart @@ -17,7 +17,7 @@ class BottomBar extends StatelessWidget { @override Widget build(BuildContext context) { return ColoredBox( - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ diff --git a/lib/_ui/bottom_wallet_actions.dart b/lib/_ui/bottom_wallet_actions.dart index 8e75159b..cf7650f6 100644 --- a/lib/_ui/bottom_wallet_actions.dart +++ b/lib/_ui/bottom_wallet_actions.dart @@ -21,7 +21,7 @@ class WalletActionButtons extends StatelessWidget { // const buttonWidth = double.maxFinite; //128.0; - final color = context.colour.background; + final color = context.colour.primaryContainer; return Container( padding: const EdgeInsets.only( diff --git a/lib/_ui/components/button.dart b/lib/_ui/components/button.dart index 33ee213b..1390b424 100644 --- a/lib/_ui/components/button.dart +++ b/lib/_ui/components/button.dart @@ -144,7 +144,8 @@ class BBButton extends StatelessWidget { (Lighting x) => x.state.currentTheme(context) == ThemeMode.dark, ); - final bgColour = darkMode ? context.colour.background : NewColours.offWhite; + final bgColour = + darkMode ? context.colour.primaryContainer : NewColours.offWhite; Widget widget; @@ -162,7 +163,7 @@ class BBButton extends StatelessWidget { // shadowColor: Colors.transparent, padding: const EdgeInsets.symmetric(vertical: 8), - // disabledForegroundColor: context.colour.onBackground, + // disabledForegroundColor: context.colour.onPrimaryContainer, ); if (!loading) @@ -177,7 +178,7 @@ class BBButton extends StatelessWidget { SvgPicture.asset( leftSvgAsset!, colorFilter: ColorFilter.mode( - context.colour.onBackground, + context.colour.onPrimaryContainer, BlendMode.srcIn, ), ), @@ -185,7 +186,7 @@ class BBButton extends StatelessWidget { ] else if (leftIcon != null) ...[ Icon( leftIcon, - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), const Gap(16), ], @@ -272,14 +273,14 @@ class BBButton extends StatelessWidget { valueColor: AlwaysStoppedAnimation( context.colour.primary, ), - backgroundColor: context.colour.background, + backgroundColor: context.colour.primaryContainer, ), ), ), const Gap(8), FaIcon( FontAwesomeIcons.angleRight, - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, // size: 16, ), const Gap(8), diff --git a/lib/_ui/components/controls.dart b/lib/_ui/components/controls.dart index e1c3c8bd..253ab163 100644 --- a/lib/_ui/components/controls.dart +++ b/lib/_ui/components/controls.dart @@ -47,10 +47,10 @@ class BBSwitcher extends StatelessWidget { ); final colour = - darkMode ? context.colour.background : context.colour.surface; + darkMode ? context.colour.primaryContainer : context.colour.surface; final borderColour = - darkMode ? context.colour.onBackground : context.colour.onSurface; + darkMode ? context.colour.onPrimaryContainer : context.colour.onSurface; return Container( decoration: BoxDecoration( @@ -94,7 +94,7 @@ class BBDropDown extends StatelessWidget { ); final bgColour = - darkMode ? context.colour.onBackground : NewColours.offWhite; + darkMode ? context.colour.onPrimaryContainer : NewColours.offWhite; final widget = SizedBox( width: 225, @@ -131,7 +131,7 @@ class BBDropDown extends StatelessWidget { borderRadius: BorderRadius.circular(8), ), filled: true, - fillColor: context.colour.background, + fillColor: context.colour.primaryContainer, focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: bgColour), borderRadius: BorderRadius.circular(8), @@ -181,10 +181,10 @@ class BBSwitch extends StatelessWidget { @override Widget build(BuildContext context) { return Switch( - activeColor: context.colour.background, - activeTrackColor: context.colour.onBackground, + activeColor: context.colour.primaryContainer, + activeTrackColor: context.colour.onPrimaryContainer, inactiveTrackColor: context.colour.surface, - inactiveThumbColor: context.colour.onBackground.withOpacity(0.4), + inactiveThumbColor: context.colour.onPrimaryContainer.withOpacity(0.4), value: value, onChanged: onChanged, ); diff --git a/lib/_ui/components/text.dart b/lib/_ui/components/text.dart index a8e7908a..36aaac08 100644 --- a/lib/_ui/components/text.dart +++ b/lib/_ui/components/text.dart @@ -170,7 +170,7 @@ class BBText extends StatelessWidget { if (isGreen) style = style.copyWith(color: Colors.green); if (isBold) style = style.copyWith(fontWeight: FontWeight.bold); if (removeColourOpacity) - style = style.copyWith(color: context.colour.onBackground); + style = style.copyWith(color: context.colour.onPrimaryContainer); if (fontSize != null) style = style.copyWith(fontSize: fontSize); if (compact) style = style.copyWith(height: 0.8); diff --git a/lib/_ui/components/text_input.dart b/lib/_ui/components/text_input.dart index 784a98de..ac67160c 100644 --- a/lib/_ui/components/text_input.dart +++ b/lib/_ui/components/text_input.dart @@ -128,7 +128,8 @@ class _BBTextInputState extends State { @override Widget build(BuildContext context) { - if (widget.value != _editingController.text) _editingController.text = widget.value; + if (widget.value != _editingController.text) + _editingController.text = widget.value; Widget widgett; @@ -142,7 +143,8 @@ class _BBTextInputState extends State { enableIMEPersonalizedLearning: false, keyboardType: TextInputType.multiline, maxLines: 5, - style: context.font.bodySmall!.copyWith(color: context.colour.onBackground), + style: context.font.bodySmall! + .copyWith(color: context.colour.onPrimaryContainer), onTap: () => widget.onEnter?.call(), decoration: InputDecoration( suffixIcon: widget.rightIcon, @@ -154,13 +156,13 @@ class _BBTextInputState extends State { enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide( - color: context.colour.onBackground.withOpacity(0.2), + color: context.colour.onPrimaryContainer.withOpacity(0.2), ), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide( - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), ), ), @@ -190,19 +192,19 @@ class _BBTextInputState extends State { enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide( - color: context.colour.onBackground.withOpacity(0.2), + color: context.colour.onPrimaryContainer.withOpacity(0.2), ), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide( - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), ), disabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide( - color: context.colour.onBackground.withOpacity(0.2), + color: context.colour.onPrimaryContainer.withOpacity(0.2), ), ), labelStyle: context.font.labelSmall, @@ -238,13 +240,13 @@ class _BBTextInputState extends State { enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide( - color: context.colour.onBackground.withOpacity(0.2), + color: context.colour.onPrimaryContainer.withOpacity(0.2), ), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide( - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), ), labelStyle: context.font.labelSmall, @@ -281,13 +283,13 @@ class _BBTextInputState extends State { enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide( - color: context.colour.onBackground.withOpacity(0.2), + color: context.colour.onPrimaryContainer.withOpacity(0.2), ), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide( - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), ), labelStyle: context.font.labelSmall, @@ -318,13 +320,13 @@ class _BBTextInputState extends State { enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide( - color: context.colour.onBackground.withOpacity(0.2), + color: context.colour.onPrimaryContainer.withOpacity(0.2), ), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide( - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), ), labelStyle: context.font.labelSmall, @@ -383,7 +385,7 @@ class _BBTextInputState extends State { // _editingController.text = widget.value!; // final borderColor = -// widget.selected ? context.colour.primary : context.colour.onBackground.withOpacity(0.2); +// widget.selected ? context.colour.primary : context.colour.onPrimaryContainer.withOpacity(0.2); // return TextField( // key: widget.uiKey, @@ -480,8 +482,9 @@ class _BBAmountInputState2 extends State { if (widget.value != null && _editingController.text != widget.value) _editingController.text = widget.value!; - final borderColor = - widget.selected ? context.colour.primary : context.colour.onBackground.withOpacity(0.2); + final borderColor = widget.selected + ? context.colour.primary + : context.colour.onPrimaryContainer.withOpacity(0.2); return SizedBox( height: 60, diff --git a/lib/_ui/headers.dart b/lib/_ui/headers.dart index 9121d537..6098b03f 100644 --- a/lib/_ui/headers.dart +++ b/lib/_ui/headers.dart @@ -38,7 +38,7 @@ class BBHeader extends StatelessWidget { if (showBack) IconButton( icon: const FaIcon(FontAwesomeIcons.xmark), - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, onPressed: () { if (onBack == null) Navigator.of(context).pop(); diff --git a/lib/_ui/page_template.dart b/lib/_ui/page_template.dart index aa4cdd1f..6c67b4be 100644 --- a/lib/_ui/page_template.dart +++ b/lib/_ui/page_template.dart @@ -21,8 +21,9 @@ class StackedPage extends StatelessWidget { child: Container( width: double.infinity, height: 72, - color: context.colour.background.withOpacity(0.95), - padding: const EdgeInsets.only(bottom: 16, top: 8, left: 16, right: 16), + color: context.colour.primaryContainer.withOpacity(0.95), + padding: + const EdgeInsets.only(bottom: 16, top: 8, left: 16, right: 16), alignment: Alignment.bottomCenter, child: bottomChild, ), diff --git a/lib/_ui/popup_border.dart b/lib/_ui/popup_border.dart index a6c66168..8a3936ec 100644 --- a/lib/_ui/popup_border.dart +++ b/lib/_ui/popup_border.dart @@ -7,7 +7,8 @@ import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart'; class PopUpBorder extends StatefulWidget { - const PopUpBorder({super.key, required this.child, this.scrollToBottom = false}); + const PopUpBorder( + {super.key, required this.child, this.scrollToBottom = false}); final Widget child; final bool scrollToBottom; @@ -66,7 +67,7 @@ class _PopUpBorderState extends State { ignoring: false, child: Container( decoration: BoxDecoration( - color: context.colour.background, + color: context.colour.primaryContainer, borderRadius: const BorderRadius.vertical( top: Radius.circular(25.0), ), diff --git a/lib/_ui/toast.dart b/lib/_ui/toast.dart index cff49a1c..0ce9c5c9 100644 --- a/lib/_ui/toast.dart +++ b/lib/_ui/toast.dart @@ -6,7 +6,7 @@ extension Xontext on BuildContext { SnackBar showToast(String text) { return SnackBar( content: Center(child: BBText.titleLarge(text)), - backgroundColor: colour.background, + backgroundColor: colour.primaryContainer, elevation: 4, ); } diff --git a/lib/address/pop_up.dart b/lib/address/pop_up.dart index 3fa5258b..ce65208e 100644 --- a/lib/address/pop_up.dart +++ b/lib/address/pop_up.dart @@ -79,13 +79,13 @@ class _Screen extends StatelessWidget { const AddressQR(), const Gap(8), Divider( - color: context.colour.onBackground.withOpacity(0.3), + color: context.colour.onPrimaryContainer.withOpacity(0.3), ), const Gap(8), const AddressDetails(), const Gap(4), Divider( - color: context.colour.onBackground.withOpacity(0.3), + color: context.colour.onPrimaryContainer.withOpacity(0.3), ), const Gap(4), const AddressActions(), diff --git a/lib/auth/page.dart b/lib/auth/page.dart index bf72f5fb..5ae9c818 100644 --- a/lib/auth/page.dart +++ b/lib/auth/page.dart @@ -131,7 +131,7 @@ class AuthPasswordField extends StatelessWidget { iconSize: 32, color: pin.isEmpty ? context.colour.surface - : context.colour.onBackground, + : context.colour.onPrimaryContainer, splashColor: Colors.transparent, onPressed: () { SystemSound.play(SystemSoundType.click); @@ -178,14 +178,14 @@ class _NumberButtonState extends State { Widget build(BuildContext context) { final _ = OutlinedButton.styleFrom( shape: const CircleBorder(), - backgroundColor: context.colour.onBackground, + backgroundColor: context.colour.onPrimaryContainer, foregroundColor: context.colour.primary, ); final __ = OutlinedButton.styleFrom( shape: const CircleBorder(), backgroundColor: context.colour.primary, - foregroundColor: context.colour.background, + foregroundColor: context.colour.primaryContainer, ); return Center( diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 6fe8f061..870b7c27 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -131,7 +131,7 @@ class _ScreenState extends State<_Screen> { SystemChrome.setSystemUIOverlayStyle( SystemUiOverlayStyle( - statusBarColor: context.colour.surface, + statusBarColor: context.colour.primaryContainer, ), ); }); @@ -162,7 +162,7 @@ class _ScreenState extends State<_Screen> { ), Expanded( child: ColoredBox( - color: context.colour.surface, + color: context.colour.primaryContainer, child: const HomeTransactions(), ), ), @@ -325,7 +325,7 @@ class CardItem extends StatelessWidget { height: 100, child: Card( clipBehavior: Clip.antiAliasWithSaveLayer, - color: context.colour.surface, + color: context.colour.primaryContainer, child: DecoratedBox( decoration: BoxDecoration( gradient: LinearGradient( @@ -489,7 +489,7 @@ class WalletTag extends StatelessWidget { ); final watchonlyColor = - darkMode ? context.colour.surface : context.colour.onSurface; + darkMode ? context.colour.surface : context.colour.onPrimaryContainer; final (name, color) = _buildTagDetails(isLiquid, tx); @@ -590,7 +590,7 @@ class HomeTopBar2 extends StatelessWidget { const Spacer(), IconButton( key: UIKeys.homeSettingsButton, - color: context.colour.error, + color: context.colour.onPrimaryContainer, padding: const EdgeInsets.only(bottom: 12), visualDensity: VisualDensity.compact, iconSize: 30, @@ -604,7 +604,7 @@ class HomeTopBar2 extends StatelessWidget { ), IconButton( iconSize: 30, - color: context.colour.error, + color: context.colour.onPrimaryContainer, visualDensity: VisualDensity.compact, padding: const EdgeInsets.only(bottom: 12), icon: const Icon( @@ -733,7 +733,8 @@ class ScanButton extends StatelessWidget { (Lighting x) => x.state.currentTheme(context) == ThemeMode.dark, ); - final bgColour = darkMode ? context.colour.surface : NewColours.offWhite; + final bgColour = + darkMode ? context.colour.primaryContainer : NewColours.offWhite; return SizedBox( height: 40, @@ -756,7 +757,7 @@ class ScanButton extends StatelessWidget { ), child: Icon( Icons.qr_code_2, - color: context.colour.onSurface, + color: context.colour.onPrimaryContainer, size: 32, ), ), @@ -895,7 +896,7 @@ class HomeNoWallets extends StatelessWidget { 'BULL BITCOIN', style: font.copyWith( fontSize: 80, - color: context.colour.surface, + color: context.colour.primaryContainer, height: 0.8, ), ), diff --git a/lib/home/market.dart b/lib/home/market.dart index e51c676b..ab916f05 100644 --- a/lib/home/market.dart +++ b/lib/home/market.dart @@ -62,7 +62,7 @@ class MarketHome extends StatelessWidget { // return Container( // width: double.infinity, // height: double.infinity, -// color: context.colour.onBackground, +// color: context.colour.onPrimaryContainer, // child: CenterLeft( // child: Padding( // padding: const EdgeInsets.all(16.0), diff --git a/lib/import/recover.dart b/lib/import/recover.dart index 5fc279b2..a256b418 100644 --- a/lib/import/recover.dart +++ b/lib/import/recover.dart @@ -54,7 +54,8 @@ class _ImportEnterWordsScreenState extends State { @override Widget build(BuildContext context) { - final importType = context.select((ImportWalletCubit cubit) => cubit.state.importType); + final importType = + context.select((ImportWalletCubit cubit) => cubit.state.importType); createFocusNodes(importType == ImportTypes.words12); @@ -78,10 +79,10 @@ class _ImportEnterWordsScreenState extends State { child: SegmentedButton( style: ButtonStyle( iconColor: MaterialStatePropertyAll( - context.colour.onBackground, + context.colour.onPrimaryContainer, ), backgroundColor: MaterialStatePropertyAll( - context.colour.background, + context.colour.primaryContainer, ), ), segments: >[ @@ -90,7 +91,7 @@ class _ImportEnterWordsScreenState extends State { label: Text( '12 words', style: TextStyle( - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), ), ), @@ -99,7 +100,7 @@ class _ImportEnterWordsScreenState extends State { label: Text( '24 words', style: TextStyle( - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), ), ), @@ -112,7 +113,9 @@ class _ImportEnterWordsScreenState extends State { context.read().recoverClicked(); if (value.first == ImportTypes.words24) - context.read().recoverClicked24(); + context + .read() + .recoverClicked24(); }, ), ), @@ -128,7 +131,8 @@ class _ImportEnterWordsScreenState extends State { uiKey: UIKeys.importRecoverField(i), index: i, focusNode: focusNodes[i], - returnClicked: (i) => returnClicked(i, importType), + returnClicked: (i) => + returnClicked(i, importType), ), ], ), @@ -141,7 +145,8 @@ class _ImportEnterWordsScreenState extends State { uiKey: UIKeys.importRecoverField(i), index: i, focusNode: focusNodes[i], - returnClicked: (i) => returnClicked(i, importType), + returnClicked: (i) => + returnClicked(i, importType), ), ], ), @@ -160,7 +165,8 @@ class _ImportEnterWordsScreenState extends State { uiKey: UIKeys.importRecoverField(i), index: i, focusNode: focusNodes[i], - returnClicked: (i) => returnClicked(i, importType), + returnClicked: (i) => + returnClicked(i, importType), ), ], ), @@ -173,7 +179,8 @@ class _ImportEnterWordsScreenState extends State { uiKey: UIKeys.importRecoverField(i), index: i, focusNode: focusNodes[i], - returnClicked: (i) => returnClicked(i, importType), + returnClicked: (i) => + returnClicked(i, importType), ), ], ), @@ -244,7 +251,8 @@ class _ImportWordTextFieldState extends State { controller.addListener(() { hideOverlay(); setState(() { - suggestions = context.read().state.findWords(controller.text); + suggestions = + context.read().state.findWords(controller.text); }); if (tapped) return; WidgetsBinding.instance.addPostFrameCallback((_) { @@ -307,7 +315,9 @@ class _ImportWordTextFieldState extends State { key: i == 0 ? UIKeys.firstSuggestionWord : null, title: BBText.body(suggestions[i]), onTap: () { - context.read().wordChanged(widget.index, suggestions[i], true); + context + .read() + .wordChanged(widget.index, suggestions[i], true); hideOverlay(); setState(() { tapped = true; @@ -323,7 +333,8 @@ class _ImportWordTextFieldState extends State { @override Widget build(BuildContext context) { - final is12 = context.select((ImportWalletCubit cubit) => cubit.state.is12()); + final is12 = + context.select((ImportWalletCubit cubit) => cubit.state.is12()); final word = context.select( (ImportWalletCubit cubit) => is12 @@ -353,7 +364,8 @@ class _ImportWordTextFieldState extends State { child: CallbackShortcuts( bindings: { LogicalKeySet(LogicalKeyboardKey.enter): () { - if (widget.focusNode.hasFocus) widget.returnClicked(widget.index); + if (widget.focusNode.hasFocus) + widget.returnClicked(widget.index); }, }, child: AnimatedOpacity( @@ -380,7 +392,9 @@ class _ImportWordTextFieldState extends State { context.read().clearUntappedWords(); }, onChanged: (value) { - context.read().wordChanged(widget.index, value, false); + context + .read() + .wordChanged(widget.index, value, false); hideOverlay(); setState(() { @@ -404,13 +418,15 @@ class _ImportWordsPassphrase extends StatelessWidget { @override Widget build(BuildContext context) { - final text = context.select((ImportWalletCubit cubit) => cubit.state.passPhrase); + final text = + context.select((ImportWalletCubit cubit) => cubit.state.passPhrase); return Padding( padding: const EdgeInsets.symmetric(horizontal: 8), child: BBTextInput.big( value: text, - onChanged: (value) => context.read().passPhraseChanged(value), + onChanged: (value) => + context.read().passPhraseChanged(value), hint: 'Enter passphrase if needed', ), ); @@ -422,8 +438,10 @@ class _ImportWordsRecoverButton extends StatelessWidget { @override Widget build(BuildContext context) { - final recovering = context.select((ImportWalletCubit cubit) => cubit.state.importing); - final err = context.select((ImportWalletCubit cubit) => cubit.state.errImporting); + final recovering = + context.select((ImportWalletCubit cubit) => cubit.state.importing); + final err = + context.select((ImportWalletCubit cubit) => cubit.state.errImporting); return Column( crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisSize: MainAxisSize.min, diff --git a/lib/import/wallet_type_selection.dart b/lib/import/wallet_type_selection.dart index 37b93007..8cf91209 100644 --- a/lib/import/wallet_type_selection.dart +++ b/lib/import/wallet_type_selection.dart @@ -277,7 +277,7 @@ class _ImportWalletTypeButton extends StatelessWidget { width: selected ? 4 : 1, color: selected ? context.colour.primary - : context.colour.onBackground, + : context.colour.onPrimaryContainer, ), ), child: Column( @@ -310,7 +310,7 @@ class _ImportWalletTypeButton extends StatelessWidget { text: 'Wallet fingerprint (XFP): ', style: TextStyle( fontSize: 12, - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), ), TextSpan( @@ -318,7 +318,7 @@ class _ImportWalletTypeButton extends StatelessWidget { style: TextStyle( fontSize: 12, fontWeight: FontWeight.bold, - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), ), ], @@ -333,7 +333,7 @@ class _ImportWalletTypeButton extends StatelessWidget { text: 'First Address: ', style: TextStyle( fontSize: 12, - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), ), TextSpan( @@ -341,7 +341,7 @@ class _ImportWalletTypeButton extends StatelessWidget { style: TextStyle( fontSize: 12, fontWeight: FontWeight.bold, - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), ), ], @@ -356,7 +356,7 @@ class _ImportWalletTypeButton extends StatelessWidget { text: 'Balance: ', style: TextStyle( fontSize: 12, - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), ), TextSpan( @@ -364,7 +364,7 @@ class _ImportWalletTypeButton extends StatelessWidget { style: TextStyle( fontSize: 12, fontWeight: FontWeight.bold, - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), ), ], @@ -379,7 +379,7 @@ class _ImportWalletTypeButton extends StatelessWidget { text: 'Transactions: ', style: TextStyle( fontSize: 12, - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), ), TextSpan( @@ -387,7 +387,7 @@ class _ImportWalletTypeButton extends StatelessWidget { style: TextStyle( fontSize: 12, fontWeight: FontWeight.bold, - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), ), ], diff --git a/lib/import/xpub.dart b/lib/import/xpub.dart index 302e9252..903718ba 100644 --- a/lib/import/xpub.dart +++ b/lib/import/xpub.dart @@ -88,14 +88,18 @@ class ColdCardSection extends StatelessWidget { @override Widget build(BuildContext context) { - final loading = context.select((ImportWalletCubit cubit) => cubit.state.loadingFile); - final scanning = context - .select((ImportWalletCubit cubit) => cubit.state.importStep == ImportSteps.scanningNFC); + final loading = + context.select((ImportWalletCubit cubit) => cubit.state.loadingFile); + final scanning = context.select((ImportWalletCubit cubit) => + cubit.state.importStep == ImportSteps.scanningNFC); - final err = context.select((ImportWalletCubit cubit) => cubit.state.errLoadingFile); + final err = + context.select((ImportWalletCubit cubit) => cubit.state.errLoadingFile); if (loading) - return const Center(child: CircularProgressIndicator()).animate(delay: 300.ms).fadeIn(); + return const Center(child: CircularProgressIndicator()) + .animate(delay: 300.ms) + .fadeIn(); return Padding( padding: const EdgeInsets.symmetric(horizontal: 24.0), @@ -296,15 +300,19 @@ class AdvancedOptions extends StatelessWidget { @override Widget build(BuildContext context) { final xpub = context.select((ImportWalletCubit cubit) => cubit.state.xpub); - final path = context.select((ImportWalletCubit x) => x.state.customDerivation); - final fingerprint = context.select((ImportWalletCubit x) => x.state.fingerprint); - final combined = - context.select((ImportWalletCubit x) => x.state.manualCombinedPublicDescriptor ?? ''); - final descr = context.select((ImportWalletCubit x) => x.state.manualPublicDescriptor ?? ''); - final cdescr = - context.select((ImportWalletCubit x) => x.state.manualCombinedPublicDescriptor ?? ''); + final path = + context.select((ImportWalletCubit x) => x.state.customDerivation); + final fingerprint = + context.select((ImportWalletCubit x) => x.state.fingerprint); + final combined = context.select( + (ImportWalletCubit x) => x.state.manualCombinedPublicDescriptor ?? ''); + final descr = context + .select((ImportWalletCubit x) => x.state.manualPublicDescriptor ?? ''); + final cdescr = context.select( + (ImportWalletCubit x) => x.state.manualCombinedPublicDescriptor ?? ''); - final err = context.select((ImportWalletCubit cubit) => cubit.state.errImporting); + final err = + context.select((ImportWalletCubit cubit) => cubit.state.errImporting); return Padding( padding: const EdgeInsets.only( @@ -314,7 +322,8 @@ class AdvancedOptions extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - const BBHeader.popUpCenteredText(text: 'Advanced Options', isLeft: true), + const BBHeader.popUpCenteredText( + text: 'Advanced Options', isLeft: true), BBTextInput.multiLine( value: xpub, onChanged: (value) { @@ -323,7 +332,7 @@ class AdvancedOptions extends StatelessWidget { rightIcon: IconButton( icon: FaIcon( FontAwesomeIcons.qrcode, - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), onPressed: () { context.read().scanQRClicked(); diff --git a/lib/main.dart b/lib/main.dart index 5c846b97..21ec27c0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -82,7 +82,7 @@ class BullBitcoinWalletApp extends StatelessWidget { // await Future.delayed(100.ms); // SystemChrome.setSystemUIOverlayStyle( // SystemUiOverlayStyle( - // statusBarColor: context.colour.background, + // statusBarColor: context.colour.primaryContainer, // ), // ); // }); diff --git a/lib/network_fees/popup.dart b/lib/network_fees/popup.dart index a80bcb26..81b38f0c 100644 --- a/lib/network_fees/popup.dart +++ b/lib/network_fees/popup.dart @@ -62,7 +62,7 @@ class SelectFeesButton extends StatelessWidget { FaIcon( FontAwesomeIcons.chevronRight, size: 16, - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), ], ), @@ -321,7 +321,7 @@ class SelectFeesItem extends StatelessWidget { border: Border.all( color: selected ? context.colour.primary - : context.colour.onBackground, + : context.colour.onPrimaryContainer, width: selected ? 2 : 1, ), ), diff --git a/lib/send/advanced.dart b/lib/send/advanced.dart index 206d1958..faf51841 100644 --- a/lib/send/advanced.dart +++ b/lib/send/advanced.dart @@ -282,7 +282,7 @@ class AdvancedOptionAdress extends StatelessWidget { border: Border.all( color: isSelected ? context.colour.primary - : context.colour.onBackground, + : context.colour.onPrimaryContainer, width: isSelected ? 3 : 3, ), ), diff --git a/lib/send/send_page.dart b/lib/send/send_page.dart index de6e6e74..2d9a81af 100644 --- a/lib/send/send_page.dart +++ b/lib/send/send_page.dart @@ -162,7 +162,7 @@ class _Screen extends StatelessWidget { if (sent && isLn) return const SendingLnTx(); return ColoredBox( - color: context.colour.background, + color: context.colour.primaryContainer, child: SingleChildScrollView( child: Padding( padding: const EdgeInsets.symmetric(horizontal: 24), @@ -324,14 +324,14 @@ class _AddressFieldState extends State { iconSize: 16, visualDensity: VisualDensity.compact, padding: EdgeInsets.zero, - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, icon: const FaIcon(FontAwesomeIcons.paste), ), IconButton( onPressed: context.read().scanAddress, icon: FaIcon( FontAwesomeIcons.barcode, - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), ), ], diff --git a/lib/settings/settings_page.dart b/lib/settings/settings_page.dart index 2500451f..1dae6f00 100644 --- a/lib/settings/settings_page.dart +++ b/lib/settings/settings_page.dart @@ -67,7 +67,7 @@ class _Screen extends StatelessWidget { icon: FaIcon( FontAwesomeIcons.telegram, size: 40, - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), ), const Gap(4), diff --git a/lib/styles.dart b/lib/styles.dart index 02283d7f..6087fed3 100644 --- a/lib/styles.dart +++ b/lib/styles.dart @@ -34,8 +34,8 @@ class Themes { onSecondary: _Colours.white, surface: _Colours.gray, onSurface: _Colours.white, - background: _Colours.white, - onBackground: _Colours.black, + primaryContainer: _Colours.white, + onPrimaryContainer: _Colours.black, error: _Colours.red, onError: _Colours.white, tertiary: _Colours.darkGray.withOpacity(0.6), @@ -66,8 +66,8 @@ class Themes { onSecondary: _Colours.white, surface: _Colours.gray, onSurface: _Colours.white, - background: _Colours.black, - onBackground: _Colours.white, + primaryContainer: _Colours.black, + onPrimaryContainer: _Colours.white, error: _Colours.red, onError: _Colours.white, tertiary: _Colours.white, @@ -98,8 +98,8 @@ class Themes { onSecondary: _Colours.white, surface: _Colours.gray, onSurface: _Colours.white, - background: _Colours.darkGray, - onBackground: _Colours.white, + primaryContainer: _Colours.darkGray, + onPrimaryContainer: _Colours.white, error: _Colours.red, onError: _Colours.white, tertiary: _Colours.darkGray, diff --git a/lib/swap/swap_history_page.dart b/lib/swap/swap_history_page.dart index ea666cd4..b3da20cc 100644 --- a/lib/swap/swap_history_page.dart +++ b/lib/swap/swap_history_page.dart @@ -123,11 +123,11 @@ class _PanelState extends State<_Panel> { // ], // ); return ExpansionPanelList( - dividerColor: context.colour.onBackground, + dividerColor: context.colour.onPrimaryContainer, expandedHeaderPadding: EdgeInsets.zero, children: [ ExpansionPanel( - backgroundColor: context.colour.background, + backgroundColor: context.colour.primaryContainer, isExpanded: expanded1, headerBuilder: (context, isExpanded) { return ListTile( @@ -151,7 +151,7 @@ class _PanelState extends State<_Panel> { body: const SwapsList(), ), ExpansionPanel( - backgroundColor: context.colour.background, + backgroundColor: context.colour.primaryContainer, isExpanded: expanded2, canTapOnHeader: true, headerBuilder: (context, isExpanded) { @@ -267,7 +267,7 @@ class SwapItem extends StatelessWidget { IconButton( icon: Icon( Icons.copy, - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), onPressed: () { locator().copy(swapTx.id); @@ -319,7 +319,7 @@ class RefreshButton extends StatelessWidget { : IconButton( icon: Icon( Icons.refresh, - color: context.colour.onBackground, + color: context.colour.onPrimaryContainer, ), onPressed: () { context.read().refreshSwap( diff --git a/lib/wallet/wallet_card.dart b/lib/wallet/wallet_card.dart index ee840d0c..1fddad26 100644 --- a/lib/wallet/wallet_card.dart +++ b/lib/wallet/wallet_card.dart @@ -55,10 +55,11 @@ class WalletCardDetails extends StatelessWidget { final isInstant = wallet.baseWalletType == BaseWalletType.Liquid; final isWatchOnly = wallet.watchOnly(); - final darkMode = - context.select((Lighting x) => x.state.currentTheme(context) == ThemeMode.dark); + final darkMode = context.select( + (Lighting x) => x.state.currentTheme(context) == ThemeMode.dark); - final watchonlyColor = darkMode ? context.colour.surface : context.colour.onBackground; + final watchonlyColor = + darkMode ? context.colour.surface : context.colour.onPrimaryContainer; if (isWatchOnly && !isTestnet) return (watchonlyColor, 'mainnet_watchonly'); if (isWatchOnly && isTestnet) return (watchonlyColor, 'testnet_watchonly'); @@ -80,19 +81,23 @@ class WalletCardDetails extends StatelessWidget { final (color, _) = cardDetails(context, wallet); final name = context.select((WalletBloc x) => x.state.wallet?.name); - final fingerprint = context.select((WalletBloc x) => x.state.wallet?.sourceFingerprint ?? ''); - final walletStr = context.select((WalletBloc x) => x.state.wallet?.getWalletTypeStr()); + final fingerprint = context + .select((WalletBloc x) => x.state.wallet?.sourceFingerprint ?? ''); + final walletStr = + context.select((WalletBloc x) => x.state.wallet?.getWalletTypeStr()); final sats = context.select((WalletBloc x) => x.state.balanceSats()); - final balance = - context.select((CurrencyCubit x) => x.state.getAmountInUnits(sats, removeText: true)); - final unit = - context.select((CurrencyCubit x) => x.state.getUnitString(isLiquid: wallet.isLiquid())); + final balance = context.select( + (CurrencyCubit x) => x.state.getAmountInUnits(sats, removeText: true)); + final unit = context.select((CurrencyCubit x) => + x.state.getUnitString(isLiquid: wallet.isLiquid())); - final fiatCurrency = context.select((CurrencyCubit x) => x.state.defaultFiatCurrency); + final fiatCurrency = + context.select((CurrencyCubit x) => x.state.defaultFiatCurrency); - final fiatAmt = context.select((NetworkCubit x) => x.state.calculatePrice(sats, fiatCurrency)); + final fiatAmt = context + .select((NetworkCubit x) => x.state.calculatePrice(sats, fiatCurrency)); return DecoratedBox( decoration: BoxDecoration( diff --git a/lib/wallet_settings/test-backup.dart b/lib/wallet_settings/test-backup.dart index 8726da79..8bfe51eb 100644 --- a/lib/wallet_settings/test-backup.dart +++ b/lib/wallet_settings/test-backup.dart @@ -210,7 +210,7 @@ class BackupTestItemWord extends StatelessWidget { ), color: isSelected ? context.colour.primary - : context.colour.onBackground, + : context.colour.onPrimaryContainer, ), child: CenterLeft( child: BBText.body( @@ -230,7 +230,7 @@ class BackupTestItemWord extends StatelessWidget { border: Border.all( color: context.colour.surface, ), - color: context.colour.background, + color: context.colour.primaryContainer, ), child: CenterLeft(child: BBText.body(word)), ),