diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index b1f88cf5..046bc927 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -1,9 +1,6 @@ name: Analyze on: - push: - branches: - - main pull_request: branches: - main @@ -15,8 +12,8 @@ jobs: strategy: matrix: analyze_mode: - - { name: "Infos allowed, Warnings fatal", mode: "--no-fatal-infos", allow_failure: false } - - { name: "Warnings allowed, Infos fatal: allow failure", mode: "--no-fatal-warnings", allow_failure: true } + - { name: "Warnings fatal, Infos allowed", mode: "--no-fatal-infos", allow_failure: false } + - { name: "Infos fatal, Warnings allowed", mode: "--no-fatal-warnings", allow_failure: false } steps: - name: Checkout Repository @@ -26,7 +23,6 @@ jobs: uses: subosito/flutter-action@v2 with: channel: stable - flutter-version: 3.24.5 - name: Install dependencies run: flutter pub get diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 124db4fe..1790d237 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,6 @@ jobs: - uses: subosito/flutter-action@v2 with: channel: stable - flutter-version: 3.24.5 architecture: x64 - run: flutter pub get diff --git a/README.md b/README.md index a67d0914..5f387e95 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Analyze](https://github.com/SatoshiPortal/bullbitcoin-mobile/actions/workflows/analyze.yml/badge.svg)](https://github.com/SatoshiPortal/bullbitcoin-mobile/actions/workflows/analyze.yml) [![Build](https://github.com/SatoshiPortal/bullbitcoin-mobile/actions/workflows/build.yml/badge.svg)](https://github.com/SatoshiPortal/bullbitcoin-mobile/actions/workflows/build.yml) + # About Bull Bitcoin Mobile Bull Bitcoin Mobile is a self-custodial Bitcoin and Liquid Network which offers non-custodial atomic swaps across Bitcoin, Lightning and Liquid. The wallet philosophy is to provide advanced features that give users the maximum control, while still being easy to use for beginners. Our goal is to make sure that anyone can take self-custody of their Bitcoin, even in a high fee environment. Our driving principle is to create a user experience which nudges the user into implementing best practices. diff --git a/analysis_options.yaml b/analysis_options.yaml index 0807e4e2..d58f37fb 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -2,17 +2,16 @@ include: package:lint/analysis_options.yaml linter: rules: - sort_constructors_first: true - prefer_single_quotes: true avoid_classes_with_only_static_members: false avoid_dynamic_calls: false no_wildcard_variable_uses: false + analyzer: exclude: - lib/**/*.g.dart - lib/**/*.freezed.dart - # - test/ + - test/ - maintainance/** - pubspec.yaml diff --git a/lib/_model/wallet.dart b/lib/_model/wallet.dart index da4e6004..6a1d78f1 100644 --- a/lib/_model/wallet.dart +++ b/lib/_model/wallet.dart @@ -326,18 +326,18 @@ class Wallet with _$Wallet { switch (type) { case BBWalletType.main: if (baseWalletType == BaseWalletType.Bitcoin) { - str = 'Secure' + ':' + id.substring(0, 5); + str = 'Secure:${id.substring(0, 5)}'; } else { - str = 'Instant' + ':' + id.substring(0, 5); + str = 'Instant:${id.substring(0, 5)}'; } case BBWalletType.xpub: - str = 'Xpub' + ':' + id.substring(0, 5); + str = 'Xpub:${id.substring(0, 5)}'; case BBWalletType.words: - str = 'Imported' + ':' + id.substring(0, 5); + str = 'Imported:${id.substring(0, 5)}'; case BBWalletType.coldcard: - str = 'Coldcard' + ':' + id.substring(0, 5); + str = 'Coldcard:${id.substring(0, 5)}'; case BBWalletType.descriptors: - str = 'Imported Descriptor' + ':' + id.substring(0, 5); + str = 'Imported Descriptor:${id.substring(0, 5)}'; } return str; @@ -355,11 +355,11 @@ class Wallet with _$Wallet { str = 'Instant Payments Wallet'; } case BBWalletType.xpub: - str = 'Xpub' + ':' + id.substring(0, 5); + str = 'Xpub:${id.substring(0, 5)}'; case BBWalletType.coldcard: - str = 'Coldcard' + ':' + id.substring(0, 5); + str = 'Coldcard:${id.substring(0, 5)}'; case BBWalletType.descriptors: - str = 'Imported Descriptor' + ':' + id.substring(0, 5); + str = 'Imported Descriptor:${id.substring(0, 5)}'; } return str; diff --git a/lib/_pkg/deep_link.dart b/lib/_pkg/deep_link.dart index ecc77f9c..e9d704c0 100644 --- a/lib/_pkg/deep_link.dart +++ b/lib/_pkg/deep_link.dart @@ -85,11 +85,15 @@ bool? isTestnetAddress(String address) { if (address.startsWith('2') || address.startsWith('m') || address.startsWith('n') || - address.startsWith('tb1')) return true; + address.startsWith('tb1')) { + return true; + } if (address.startsWith('1') || address.startsWith('3') || - address.startsWith('bc1')) return false; + address.startsWith('bc1')) { + return false; + } return null; } diff --git a/lib/_pkg/wallet/bdk/transaction.dart b/lib/_pkg/wallet/bdk/transaction.dart index 095fe3b8..4cf10b64 100644 --- a/lib/_pkg/wallet/bdk/transaction.dart +++ b/lib/_pkg/wallet/bdk/transaction.dart @@ -269,7 +269,7 @@ class BDKTransactions { if (serdBdkTx.output == null) throw 'No output object'; final scriptPubkeyString = serdBdkTx.output ?.firstWhere( - (output) => output.value == amountChange, + (output) => output.value == amountChange.toInt(), ) .scriptPubkey; @@ -323,7 +323,9 @@ class BDKTransactions { try { if (serdBdkTx.output == null) throw 'No output object'; final scriptPubkeyString = serdBdkTx.output - ?.firstWhere((output) => output.value == amountReceived) + ?.firstWhere( + (output) => output.value == amountReceived.toInt(), + ) .scriptPubkey; if (scriptPubkeyString == null) { @@ -393,7 +395,9 @@ class BDKTransactions { // This check is to eliminate sent RBF duplicates if (transactions.any((t) { return t.rbfTxIds.any((ids) => ids == tx.txid); - })) continue; + })) { + continue; + } // TODO: Merged above two into single iteration; //if (transactions.any((t) => diff --git a/lib/_ui/atoms/bb_form_field.dart b/lib/_ui/atoms/bb_form_field.dart index 776888d0..6d79ea72 100644 --- a/lib/_ui/atoms/bb_form_field.dart +++ b/lib/_ui/atoms/bb_form_field.dart @@ -34,7 +34,7 @@ class BBFormField extends StatelessWidget { Widget build(BuildContext context) { final borderColor = selected ? context.colour.primary - : context.colour.onPrimaryContainer.withOpacity(0.2); + : context.colour.onPrimaryContainer.withValues(alpha: 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 7c902bb0..d5b15a34 100644 --- a/lib/_ui/bottom_bar.dart +++ b/lib/_ui/bottom_bar.dart @@ -29,7 +29,7 @@ class BottomBar extends StatelessWidget { style: TextButton.styleFrom( foregroundColor: pageIdx == i ? context.colour.onPrimary - : context.colour.onPrimary.withOpacity(0.5), + : context.colour.onPrimary.withValues(alpha: 0.5), textStyle: const TextStyle( fontSize: 16, fontWeight: FontWeight.bold, diff --git a/lib/_ui/bottom_wallet_actions.dart b/lib/_ui/bottom_wallet_actions.dart index e480b9cd..90d1ff34 100644 --- a/lib/_ui/bottom_wallet_actions.dart +++ b/lib/_ui/bottom_wallet_actions.dart @@ -52,9 +52,9 @@ class WalletActionButtons extends StatelessWidget { color, color, color, - color.withOpacity(0.9), - color.withOpacity(0.5), - color.withOpacity(0.0), + color.withValues(alpha: 0.9), + color.withValues(alpha: 0.5), + color.withValues(alpha: 0.0), ], begin: Alignment.bottomCenter, end: Alignment.topCenter, diff --git a/lib/_ui/components/button.dart b/lib/_ui/components/button.dart index 50660657..aa2897de 100644 --- a/lib/_ui/components/button.dart +++ b/lib/_ui/components/button.dart @@ -246,8 +246,8 @@ class BBButton extends StatelessWidget { boxShadow: [ BoxShadow( color: !disabled - ? Colors.black.withOpacity(0.1) - : Colors.grey.withOpacity(0.1), + ? Colors.black.withValues(alpha: 0.1) + : Colors.grey.withValues(alpha: 0.1), blurRadius: 10, offset: const Offset(0, 4), ), diff --git a/lib/_ui/components/controls.dart b/lib/_ui/components/controls.dart index 7035d63f..58987fdf 100644 --- a/lib/_ui/components/controls.dart +++ b/lib/_ui/components/controls.dart @@ -110,7 +110,7 @@ class BBDropDown extends StatelessWidget { ), boxShadow: [ BoxShadow( - color: Colors.black.withOpacity(0.1), + color: Colors.black.withValues(alpha: 0.1), blurRadius: 10, offset: const Offset(0, 4), ), @@ -236,7 +236,8 @@ class BBSwitch extends StatelessWidget { activeColor: context.colour.primaryContainer, activeTrackColor: context.colour.onPrimaryContainer, inactiveTrackColor: context.colour.surface, - inactiveThumbColor: context.colour.onPrimaryContainer.withOpacity(0.4), + inactiveThumbColor: + context.colour.onPrimaryContainer.withValues(alpha: 0.4), value: value, onChanged: onChanged, ); diff --git a/lib/_ui/components/indicators.dart b/lib/_ui/components/indicators.dart index 3f6ab06b..1770da6d 100644 --- a/lib/_ui/components/indicators.dart +++ b/lib/_ui/components/indicators.dart @@ -20,7 +20,8 @@ class BBLoadingRow extends StatefulWidget { State createState() => _BBLoadingRowState(); } -class _BBLoadingRowState extends State with SingleTickerProviderStateMixin { +class _BBLoadingRowState extends State + with SingleTickerProviderStateMixin { late AnimationController _animationController; final Cubic firstCurve = Curves.easeInCubic; final Cubic seconCurve = Curves.easeOutCubic; @@ -92,7 +93,9 @@ class DashBox extends StatelessWidget { child: Container( width: width, decoration: BoxDecoration( - color: isOn ? context.colour.error : context.colour.surface.withOpacity(0.4), + color: isOn + ? context.colour.error + : context.colour.surface.withValues(alpha: 0.4), borderRadius: BorderRadius.circular(1), ), ), diff --git a/lib/_ui/components/text_input.dart b/lib/_ui/components/text_input.dart index 913161d0..9a27d756 100644 --- a/lib/_ui/components/text_input.dart +++ b/lib/_ui/components/text_input.dart @@ -151,7 +151,7 @@ class _BBTextInputState extends State { suffixIcon: widget.rightIcon, hintText: widget.hint, hintStyle: TextStyle( - color: context.colour.onPrimaryContainer.withOpacity(0.5), + color: context.colour.onPrimaryContainer.withValues(alpha: 0.5), ), // suffix: widget.rightIcon, border: OutlineInputBorder( @@ -160,7 +160,7 @@ class _BBTextInputState extends State { enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide( - color: context.colour.onPrimaryContainer.withOpacity(0.2), + color: context.colour.onPrimaryContainer.withValues(alpha: 0.2), ), ), focusedBorder: OutlineInputBorder( @@ -190,7 +190,7 @@ class _BBTextInputState extends State { decoration: InputDecoration( hintText: widget.hint, hintStyle: TextStyle( - color: context.colour.onPrimaryContainer.withOpacity(0.5), + color: context.colour.onPrimaryContainer.withValues(alpha: 0.5), ), counterText: '', border: OutlineInputBorder( @@ -199,7 +199,8 @@ class _BBTextInputState extends State { enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide( - color: context.colour.onPrimaryContainer.withOpacity(0.2), + color: + context.colour.onPrimaryContainer.withValues(alpha: 0.2), ), ), focusedBorder: OutlineInputBorder( @@ -211,7 +212,8 @@ class _BBTextInputState extends State { disabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide( - color: context.colour.onPrimaryContainer.withOpacity(0.2), + color: + context.colour.onPrimaryContainer.withValues(alpha: 0.2), ), ), labelStyle: context.font.labelSmall, @@ -235,7 +237,7 @@ class _BBTextInputState extends State { decoration: InputDecoration( hintText: widget.hint, hintStyle: TextStyle( - color: context.colour.onPrimaryContainer.withOpacity(0.5), + color: context.colour.onPrimaryContainer.withValues(alpha: 0.5), ), suffixIcon: IconButton( icon: Padding( @@ -250,7 +252,8 @@ class _BBTextInputState extends State { enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide( - color: context.colour.onPrimaryContainer.withOpacity(0.2), + color: + context.colour.onPrimaryContainer.withValues(alpha: 0.2), ), ), focusedBorder: OutlineInputBorder( @@ -280,7 +283,7 @@ class _BBTextInputState extends State { decoration: InputDecoration( hintText: widget.hint, hintStyle: TextStyle( - color: context.colour.onPrimaryContainer.withOpacity(0.5), + color: context.colour.onPrimaryContainer.withValues(alpha: 0.5), ), suffixIcon: widget.rightIcon, // IconButton( @@ -296,7 +299,8 @@ class _BBTextInputState extends State { enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide( - color: context.colour.onPrimaryContainer.withOpacity(0.2), + color: + context.colour.onPrimaryContainer.withValues(alpha: 0.2), ), ), focusedBorder: OutlineInputBorder( @@ -328,7 +332,7 @@ class _BBTextInputState extends State { decoration: InputDecoration( hintText: widget.hint, hintStyle: TextStyle( - color: context.colour.onPrimaryContainer.withOpacity(0.5), + color: context.colour.onPrimaryContainer.withValues(alpha: 0.5), ), border: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), @@ -336,7 +340,8 @@ class _BBTextInputState extends State { enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide( - color: context.colour.onPrimaryContainer.withOpacity(0.2), + color: + context.colour.onPrimaryContainer.withValues(alpha: 0.2), ), ), focusedBorder: OutlineInputBorder( @@ -401,7 +406,7 @@ class _BBTextInputState extends State { // _editingController.text = widget.value!; // final borderColor = -// widget.selected ? context.colour.primary : context.colour.onPrimaryContainer.withOpacity(0.2); +// widget.selected ? context.colour.primary : context.colour.onPrimaryContainer.withValues(alpha:0.2); // return TextField( // key: widget.uiKey, @@ -501,7 +506,7 @@ class _BBAmountInputState2 extends State { final borderColor = widget.selected ? context.colour.primary - : context.colour.onPrimaryContainer.withOpacity(0.2); + : context.colour.onPrimaryContainer.withValues(alpha: 0.2); return SizedBox( height: 60, @@ -540,7 +545,7 @@ class _BBAmountInputState2 extends State { decoration: InputDecoration( hintText: widget.hint, hintStyle: TextStyle( - color: context.colour.onPrimaryContainer.withOpacity(0.5), + color: context.colour.onPrimaryContainer.withValues(alpha: 0.5), ), border: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), diff --git a/lib/_ui/molecules/wallet/wallet_card.dart b/lib/_ui/molecules/wallet/wallet_card.dart index f54da79f..88ee5a38 100644 --- a/lib/_ui/molecules/wallet/wallet_card.dart +++ b/lib/_ui/molecules/wallet/wallet_card.dart @@ -45,7 +45,7 @@ class WalletCard extends StatelessWidget { begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - color.withOpacity(0.73), + color.withValues(alpha: 0.73), color, ], ), diff --git a/lib/_ui/page_template.dart b/lib/_ui/page_template.dart index 6c67b4be..5b05ed0d 100644 --- a/lib/_ui/page_template.dart +++ b/lib/_ui/page_template.dart @@ -21,7 +21,7 @@ class StackedPage extends StatelessWidget { child: Container( width: double.infinity, height: 72, - color: context.colour.primaryContainer.withOpacity(0.95), + color: context.colour.primaryContainer.withValues(alpha: 0.95), padding: const EdgeInsets.only(bottom: 16, top: 8, left: 16, right: 16), alignment: Alignment.bottomCenter, diff --git a/lib/_ui/warning.dart b/lib/_ui/warning.dart index a664280a..f627027c 100644 --- a/lib/_ui/warning.dart +++ b/lib/_ui/warning.dart @@ -61,7 +61,7 @@ class WarningBanner extends StatelessWidget { child: Container( padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), decoration: BoxDecoration( - color: context.colour.error.withOpacity(0.2), + color: context.colour.error.withValues(alpha: 0.2), borderRadius: BorderRadius.circular(10), ), child: Row( diff --git a/lib/address/pop_up.dart b/lib/address/pop_up.dart index 4240a762..dc5e91b9 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.onPrimaryContainer.withOpacity(0.3), + color: context.colour.onPrimaryContainer.withValues(alpha: 0.3), ), const Gap(8), const AddressDetails(), const Gap(4), Divider( - color: context.colour.onPrimaryContainer.withOpacity(0.3), + color: context.colour.onPrimaryContainer.withValues(alpha: 0.3), ), const Gap(4), const AddressActions(), diff --git a/lib/home/bloc/home_state.dart b/lib/home/bloc/home_state.dart index 1198a8fb..e4493c69 100644 --- a/lib/home/bloc/home_state.dart +++ b/lib/home/bloc/home_state.dart @@ -138,7 +138,9 @@ class HomeState with _$HomeState { if (wallet.transactions.indexWhere( (t) => t.swapTx?.id == swaptx.id, ) != - -1) return walletBloc; + -1) { + return walletBloc; + } } return null; diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index d9201c43..f9c689ac 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -86,7 +86,7 @@ class _ScreenState extends State<_Screen> { static AppBar _buildAppBar(BuildContext context) { return AppBar( automaticallyImplyLeading: false, - shadowColor: context.colour.primary.withOpacity(0.2), + shadowColor: context.colour.primary.withValues(alpha: 0.2), surfaceTintColor: Colors.transparent, elevation: 0, flexibleSpace: const HomeTopBar2(), @@ -302,7 +302,7 @@ class CardColumn extends StatelessWidget { side: const BorderSide(color: NewColours.lightGray), backgroundColor: context.colour.primaryContainer, surfaceTintColor: - context.colour.primaryContainer.withOpacity(0.5), + context.colour.primaryContainer.withValues(alpha: 0.5), elevation: 2, splashFactory: NoSplash.splashFactory, enableFeedback: false, @@ -383,7 +383,7 @@ class CardItem extends StatelessWidget { begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - color.withOpacity(0.73), + color.withValues(alpha: 0.73), color, ], ), @@ -786,7 +786,7 @@ class ScanButton extends StatelessWidget { ), side: const BorderSide(color: NewColours.lightGray), backgroundColor: bgColour, - surfaceTintColor: bgColour.withOpacity(0.5), + surfaceTintColor: bgColour.withValues(alpha: 0.5), elevation: 2, splashFactory: NoSplash.splashFactory, enableFeedback: false, diff --git a/lib/import/page.dart b/lib/import/page.dart index bf7e3f41..5ef32995 100644 --- a/lib/import/page.dart +++ b/lib/import/page.dart @@ -125,11 +125,15 @@ class ImportAppBar extends StatelessWidget { if (creatingMainWallet && (step == ImportSteps.import12Words || - step == ImportSteps.import24Words)) onBack = () => context.pop(); + step == ImportSteps.import24Words)) { + onBack = () => context.pop(); + } if (isRecovery && (step == ImportSteps.import12Words || - step == ImportSteps.import24Words)) onBack = () => context.pop(); + step == ImportSteps.import24Words)) { + onBack = () => context.pop(); + } onBack ??= () => context.pop(); @@ -167,8 +171,6 @@ class _Screen extends StatelessWidget { case ImportSteps.advancedOptions: return const AdvancedOptions(); - default: - return Container(); } }(), ); diff --git a/lib/network/popup.dart b/lib/network/popup.dart index 9c37a101..a07e7063 100644 --- a/lib/network/popup.dart +++ b/lib/network/popup.dart @@ -230,8 +230,8 @@ class _SegmentButton extends StatelessWidget { Widget build(BuildContext context) { final isLiq = context.select((_NetworkSelector _) => _.state); - final selectedBGColour = context.colour.surface.withOpacity(0.3); - final unselectedBGColour = context.colour.surface.withOpacity(0.1); + final selectedBGColour = context.colour.surface.withValues(alpha: 0.3); + final unselectedBGColour = context.colour.surface.withValues(alpha: 0.1); return Expanded( child: InkWell( diff --git a/lib/network_fees/bloc/networkfees_cubit.dart b/lib/network_fees/bloc/networkfees_cubit.dart index 0364b860..b4c95974 100644 --- a/lib/network_fees/bloc/networkfees_cubit.dart +++ b/lib/network_fees/bloc/networkfees_cubit.dart @@ -115,7 +115,9 @@ class NetworkFeesCubit extends Cubit { void checkFees() { if (state.selectedFeesOption == 4 && - (state.fees == null || state.fees == 0)) feeOptionSelected(2); + (state.fees == null || state.fees == 0)) { + feeOptionSelected(2); + } } Future checkMinimumFees() async { @@ -184,7 +186,9 @@ class NetworkFeesCubit extends Cubit { ); if (state.tempSelectedFeesOption == 4 && state.tempFees != null && - state.tempFees! <= max) emit(state.copyWith(fees: state.tempFees)); + state.tempFees! <= max) { + emit(state.copyWith(fees: state.tempFees)); + } } } emit(state.copyWith(feesSaved: true)); diff --git a/lib/receive/bloc/state.dart b/lib/receive/bloc/state.dart index 577c30d6..10f03ec4 100644 --- a/lib/receive/bloc/state.dart +++ b/lib/receive/bloc/state.dart @@ -95,9 +95,13 @@ class ReceiveState with _$ReceiveState { bool isChainSwap() { if (walletBloc == null || walletBloc?.state.wallet == null) return false; if (paymentNetwork == PaymentNetwork.bitcoin && - walletBloc!.state.wallet!.isLiquid()) return true; + walletBloc!.state.wallet!.isLiquid()) { + return true; + } if (paymentNetwork == PaymentNetwork.liquid && - walletBloc!.state.wallet!.isBitcoin()) return true; + walletBloc!.state.wallet!.isBitcoin()) { + return true; + } return false; } diff --git a/lib/send/bloc/send_state.dart b/lib/send/bloc/send_state.dart index 462b992d..251f8e33 100644 --- a/lib/send/bloc/send_state.dart +++ b/lib/send/bloc/send_state.dart @@ -230,11 +230,15 @@ class SendState with _$SendState { } if (selectedWalletBloc!.state.wallet!.isBitcoin() && (paymentNetwork == AddressNetwork.liquid || - paymentNetwork == AddressNetwork.bip21Liquid)) return true; + paymentNetwork == AddressNetwork.bip21Liquid)) { + return true; + } if (selectedWalletBloc!.state.wallet!.isLiquid() && (paymentNetwork == AddressNetwork.bitcoin || - paymentNetwork == AddressNetwork.bip21Bitcoin)) return true; + paymentNetwork == AddressNetwork.bip21Bitcoin)) { + return true; + } return false; } diff --git a/lib/settings/bloc/lighting_cubit.dart b/lib/settings/bloc/lighting_cubit.dart index 391d1366..ca8f5ebd 100644 --- a/lib/settings/bloc/lighting_cubit.dart +++ b/lib/settings/bloc/lighting_cubit.dart @@ -34,7 +34,8 @@ class Lighting extends Cubit { } extension X on ThemeLighting { - ThemeData dark() => this == ThemeLighting.dim ? Themes.dimTheme : Themes.darkTheme; + ThemeData dark() => + this == ThemeLighting.dim ? Themes.dimTheme : Themes.darkTheme; ThemeMode mode() { switch (this) { @@ -45,8 +46,6 @@ extension X on ThemeLighting { return ThemeMode.dark; case ThemeLighting.system: return ThemeMode.system; - default: - return ThemeMode.light; } } @@ -61,8 +60,6 @@ extension X on ThemeLighting { final brightness = MediaQuery.of(context).platformBrightness; final isDarkMode = brightness == Brightness.dark; return isDarkMode ? ThemeMode.dark : ThemeMode.light; - default: - return ThemeMode.light; } } } diff --git a/lib/settings/broadcast.dart b/lib/settings/broadcast.dart index 9d7eb273..aa2b83e8 100644 --- a/lib/settings/broadcast.dart +++ b/lib/settings/broadcast.dart @@ -162,7 +162,7 @@ class _Screen extends StatelessWidget { width: MediaQuery.of(context).size.width * 0.7, child: Material( borderRadius: BorderRadius.circular(24), - color: context.colour.surface.withOpacity(0.3), + color: context.colour.surface.withValues(alpha: 0.3), child: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/styles.dart b/lib/styles.dart index 6087fed3..4140f3fe 100644 --- a/lib/styles.dart +++ b/lib/styles.dart @@ -38,7 +38,7 @@ class Themes { onPrimaryContainer: _Colours.black, error: _Colours.red, onError: _Colours.white, - tertiary: _Colours.darkGray.withOpacity(0.6), + tertiary: _Colours.darkGray.withValues(alpha: 0.6), onTertiary: _Colours.white, ), scaffoldBackgroundColor: _Colours.white, diff --git a/lib/swap/listeners.dart b/lib/swap/listeners.dart index 35c07bbb..ad1e1d9c 100644 --- a/lib/swap/listeners.dart +++ b/lib/swap/listeners.dart @@ -42,7 +42,9 @@ class SwapAppListener extends StatelessWidget { if (isReceivePage || isSendPage || isSwapReceivePage || - isOnchainSwapReceivePage) return; + isOnchainSwapReceivePage) { + return; + } final swapTx = state.updatedSwapTx!; final isReverse = swapTx.isReverse(); diff --git a/lib/transaction/transaction_page.dart b/lib/transaction/transaction_page.dart index 86061848..e4458dad 100644 --- a/lib/transaction/transaction_page.dart +++ b/lib/transaction/transaction_page.dart @@ -173,7 +173,7 @@ class _CombinedTxAndSwapPage extends StatelessWidget { const _TxDetails(), Container( padding: const EdgeInsets.only(left: 16.0), - color: context.colour.surface.withOpacity(0.1), + color: context.colour.surface.withValues(alpha: 0.1), child: const Column( children: [ Gap(8), @@ -199,7 +199,7 @@ class _CombinedTxAndOnchainSwapPage extends StatelessWidget { children: [ Container( padding: const EdgeInsets.only(left: 16.0), - color: context.colour.surface.withOpacity(0.1), + color: context.colour.surface.withValues(alpha: 0.1), child: const Column( children: [ Gap(24), diff --git a/lib/wallet/wallet_card.dart b/lib/wallet/wallet_card.dart index b5675c83..44c5033e 100644 --- a/lib/wallet/wallet_card.dart +++ b/lib/wallet/wallet_card.dart @@ -108,7 +108,7 @@ class WalletCardDetails extends StatelessWidget { begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - color.withOpacity(0.73), + color.withValues(alpha: 0.73), color, ], ), diff --git a/pubspec.lock b/pubspec.lock index dfdd72fd..18820a54 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,23 +5,23 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 + sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" url: "https://pub.dev" source: hosted - version: "72.0.0" + version: "76.0.0" _macros: dependency: transitive description: dart source: sdk - version: "0.3.2" + version: "0.3.3" analyzer: dependency: transitive description: name: analyzer - sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 + sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" url: "https://pub.dev" source: hosted - version: "6.7.0" + version: "6.11.0" ansicolor: dependency: transitive description: @@ -131,10 +131,10 @@ packages: dependency: transitive description: name: build - sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0 url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.2" build_cli_annotations: dependency: transitive description: @@ -147,42 +147,42 @@ packages: dependency: transitive description: name: build_config - sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" build_daemon: dependency: transitive description: name: build_daemon - sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9" + sha256: "294a2edaf4814a378725bfe6358210196f5ea37af89ecd81bfa32960113d4948" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.0.3" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" + sha256: "99d3980049739a985cf9b21f30881f46db3ebc62c5b8d5e60e27440876b1ba1e" url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.4.3" build_runner: dependency: "direct dev" description: name: build_runner - sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d" + sha256: "74691599a5bc750dc96a6b4bfd48f7d9d66453eab04c7f4063134800d6a5c573" url: "https://pub.dev" source: hosted - version: "2.4.13" + version: "2.4.14" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0 + sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021" url: "https://pub.dev" source: hosted - version: "7.3.2" + version: "8.0.0" built_collection: dependency: transitive description: @@ -195,10 +195,10 @@ packages: dependency: transitive description: name: built_value - sha256: c7913a9737ee4007efedaffc968c049fd0f3d0e49109e778edc10de9426005cb + sha256: "28a712df2576b63c6c005c465989a348604960c0958d28be5303ba9baa841ac2" url: "https://pub.dev" source: hosted - version: "8.9.2" + version: "8.9.3" carousel_slider: dependency: "direct main" description: @@ -251,12 +251,12 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.0" convert: - dependency: transitive + dependency: "direct main" description: name: convert sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 @@ -280,7 +280,7 @@ packages: source: hosted version: "0.3.4+2" crypto: - dependency: transitive + dependency: "direct main" description: name: crypto sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" @@ -533,10 +533,10 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: "9b78450b89f059e96c9ebb355fa6b3df1d6b330436e0b885fb49594c41721398" + sha256: "615a505aef59b151b46bbeef55b36ce2b6ed299d160c51d84281946f0aa0ce0e" url: "https://pub.dev" source: hosted - version: "2.0.23" + version: "2.0.24" flutter_rust_bridge: dependency: transitive description: @@ -644,7 +644,7 @@ packages: source: hosted version: "2.5.7" freezed_annotation: - dependency: transitive + dependency: "direct main" description: name: freezed_annotation sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2 @@ -748,18 +748,18 @@ packages: dependency: transitive description: name: http_multi_server - sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 url: "https://pub.dev" source: hosted - version: "3.2.1" + version: "3.2.2" http_parser: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "76d306a1c3afb33fe82e2bbacad62a61f409b5634c915fceb0d799de1a913360" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.1" image: dependency: transitive description: @@ -817,18 +817,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" url: "https://pub.dev" source: hosted - version: "10.0.5" + version: "10.0.7" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.8" leak_tracker_testing: dependency: transitive description: @@ -873,10 +873,10 @@ packages: dependency: "direct main" description: name: lottie - sha256: fa39707f36786707b01eca7626d2c16c32aa603b3f3a146518518458847dc127 + sha256: "377d87b8dcef640c04717e93afb86a510f0e1117a399ab94dc4b3f39c85eaa87" url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "3.3.0" lwk_dart: dependency: "direct main" description: @@ -890,10 +890,10 @@ packages: dependency: transitive description: name: macros - sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" + sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" url: "https://pub.dev" source: hosted - version: "0.1.2-main.4" + version: "0.1.3-main.0" matcher: dependency: transitive description: @@ -930,10 +930,10 @@ packages: dependency: transitive description: name: mockito - sha256: "6841eed20a7befac0ce07df8116c8b8233ed1f4486a7647c7fc5a02ae6163917" + sha256: f99d8d072e249f719a5531735d146d8cf04c580d93920b04de75bef6dfb2daf6 url: "https://pub.dev" source: hosted - version: "5.4.4" + version: "5.4.5" mocktail: dependency: "direct dev" description: @@ -1170,10 +1170,10 @@ packages: dependency: transitive description: name: shelf - sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 url: "https://pub.dev" source: hosted - version: "1.4.1" + version: "1.4.2" shelf_packages_handler: dependency: transitive description: @@ -1202,7 +1202,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_gen: dependency: transitive description: @@ -1215,10 +1215,10 @@ packages: dependency: transitive description: name: source_helper - sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd" + sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c" url: "https://pub.dev" source: hosted - version: "1.3.4" + version: "1.3.5" source_map_stack_trace: dependency: transitive description: @@ -1255,10 +1255,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -1271,18 +1271,18 @@ packages: dependency: transitive description: name: stream_transform - sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" sync_http: dependency: transitive description: @@ -1303,26 +1303,26 @@ packages: dependency: transitive description: name: test - sha256: "7ee44229615f8f642b68120165ae4c2a75fe77ae2065b1e55ae4711f6cf0899e" + sha256: "713a8789d62f3233c46b4a90b174737b2c04cb6ae4500f2aa8b1be8f03f5e67f" url: "https://pub.dev" source: hosted - version: "1.25.7" + version: "1.25.8" test_api: dependency: transitive description: name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.7.2" + version: "0.7.3" test_core: dependency: transitive description: name: test_core - sha256: "55ea5a652e38a1dfb32943a7973f3681a60f872f8c3a05a14664ad54ef9c6696" + sha256: "12391302411737c176b0b5d6491f466b0dd56d4763e347b6714efbaa74d7953d" url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "0.6.5" timeago: dependency: "direct main" description: @@ -1463,18 +1463,18 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" watcher: dependency: transitive description: name: watcher - sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" web: dependency: transitive description: @@ -1495,10 +1495,10 @@ packages: dependency: transitive description: name: webdriver - sha256: "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e" + sha256: "3d773670966f02a646319410766d3b5e1037efb7f07cc68f844d5e06cd4d61c8" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.4" webkit_inspection_protocol: dependency: transitive description: @@ -1540,5 +1540,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.5.0 <4.0.0" - flutter: ">=3.24.0" + dart: ">=3.6.0 <4.0.0" + flutter: ">=3.27.0"