mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-10 20:54:33 +00:00
add coin control option to mobile more menu + assets fix
This commit is contained in:
parent
27de4d868e
commit
7319f509f0
6 changed files with 147 additions and 62 deletions
|
@ -50,6 +50,11 @@ class _WalletNavigationBarState extends ConsumerState<WalletNavigationBar> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final showMore = ref.watch(walletsChangeNotifierProvider.select(
|
||||||
|
(value) => value.getManager(widget.walletId).hasPaynymSupport)) ||
|
||||||
|
ref.watch(walletsChangeNotifierProvider.select((value) =>
|
||||||
|
value.getManager(widget.walletId).hasCoinControlSupport));
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
@ -97,6 +102,71 @@ class _WalletNavigationBarState extends ConsumerState<WalletNavigationBar> {
|
||||||
// const SizedBox(
|
// const SizedBox(
|
||||||
// height: 8,
|
// height: 8,
|
||||||
// ),
|
// ),
|
||||||
|
if (ref.watch(walletsChangeNotifierProvider.select((value) =>
|
||||||
|
value.getManager(widget.walletId).hasCoinControlSupport)))
|
||||||
|
AnimatedOpacity(
|
||||||
|
opacity: scale,
|
||||||
|
duration: duration,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
if (mounted) {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
|
||||||
|
// Navigator.of(context).pushNamed(
|
||||||
|
// PaynymHomeView.routeName,
|
||||||
|
// arguments: widget.walletId,
|
||||||
|
// );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
width: 146,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color:
|
||||||
|
Theme.of(context).extension<StackColors>()!.popupBG,
|
||||||
|
boxShadow: [
|
||||||
|
Theme.of(context)
|
||||||
|
.extension<StackColors>()!
|
||||||
|
.standardBoxShadow
|
||||||
|
],
|
||||||
|
borderRadius: BorderRadius.circular(
|
||||||
|
widget.height / 2.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"Coin control",
|
||||||
|
style: STextStyles.buttonSmall(context),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 16,
|
||||||
|
),
|
||||||
|
SvgPicture.asset(
|
||||||
|
Assets.svg.coinControl.gamePad,
|
||||||
|
height: 20,
|
||||||
|
width: 20,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.extension<StackColors>()!
|
||||||
|
.bottomNavIconIcon,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (ref.watch(walletsChangeNotifierProvider.select((value) =>
|
||||||
|
value
|
||||||
|
.getManager(widget.walletId)
|
||||||
|
.hasCoinControlSupport)) &&
|
||||||
|
ref.watch(walletsChangeNotifierProvider.select((value) =>
|
||||||
|
value.getManager(widget.walletId).hasPaynymSupport)))
|
||||||
|
const SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
if (ref.watch(walletsChangeNotifierProvider.select((value) =>
|
||||||
|
value.getManager(widget.walletId).hasPaynymSupport)))
|
||||||
AnimatedOpacity(
|
AnimatedOpacity(
|
||||||
opacity: scale,
|
opacity: scale,
|
||||||
duration: duration,
|
duration: duration,
|
||||||
|
@ -159,8 +229,9 @@ class _WalletNavigationBarState extends ConsumerState<WalletNavigationBar> {
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
width: 146,
|
width: 146,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color:
|
color: Theme.of(context)
|
||||||
Theme.of(context).extension<StackColors>()!.popupBG,
|
.extension<StackColors>()!
|
||||||
|
.popupBG,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
Theme.of(context)
|
Theme.of(context)
|
||||||
.extension<StackColors>()!
|
.extension<StackColors>()!
|
||||||
|
@ -410,8 +481,7 @@ class _WalletNavigationBarState extends ConsumerState<WalletNavigationBar> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (ref.watch(walletsChangeNotifierProvider.select((value) =>
|
if (showMore)
|
||||||
value.getManager(widget.walletId).hasPaynymSupport)))
|
|
||||||
RawMaterialButton(
|
RawMaterialButton(
|
||||||
constraints: const BoxConstraints(
|
constraints: const BoxConstraints(
|
||||||
minWidth: 66,
|
minWidth: 66,
|
||||||
|
|
|
@ -24,6 +24,7 @@ import 'package:stackwallet/services/event_bus/events/global/refresh_percent_cha
|
||||||
import 'package:stackwallet/services/event_bus/events/global/updated_in_background_event.dart';
|
import 'package:stackwallet/services/event_bus/events/global/updated_in_background_event.dart';
|
||||||
import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart';
|
import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart';
|
||||||
import 'package:stackwallet/services/event_bus/global_event_bus.dart';
|
import 'package:stackwallet/services/event_bus/global_event_bus.dart';
|
||||||
|
import 'package:stackwallet/services/mixins/coin_control_interface.dart';
|
||||||
import 'package:stackwallet/services/mixins/electrum_x_parsing.dart';
|
import 'package:stackwallet/services/mixins/electrum_x_parsing.dart';
|
||||||
import 'package:stackwallet/services/mixins/paynym_wallet_interface.dart';
|
import 'package:stackwallet/services/mixins/paynym_wallet_interface.dart';
|
||||||
import 'package:stackwallet/services/mixins/wallet_cache.dart';
|
import 'package:stackwallet/services/mixins/wallet_cache.dart';
|
||||||
|
@ -94,7 +95,12 @@ String constructDerivePath({
|
||||||
}
|
}
|
||||||
|
|
||||||
class BitcoinWallet extends CoinServiceAPI
|
class BitcoinWallet extends CoinServiceAPI
|
||||||
with WalletCache, WalletDB, ElectrumXParsing, PaynymWalletInterface {
|
with
|
||||||
|
WalletCache,
|
||||||
|
WalletDB,
|
||||||
|
ElectrumXParsing,
|
||||||
|
PaynymWalletInterface,
|
||||||
|
CoinControlInterface {
|
||||||
BitcoinWallet({
|
BitcoinWallet({
|
||||||
required String walletId,
|
required String walletId,
|
||||||
required String walletName,
|
required String walletName,
|
||||||
|
|
|
@ -10,6 +10,7 @@ import 'package:stackwallet/services/coins/coin_service.dart';
|
||||||
import 'package:stackwallet/services/event_bus/events/global/node_connection_status_changed_event.dart';
|
import 'package:stackwallet/services/event_bus/events/global/node_connection_status_changed_event.dart';
|
||||||
import 'package:stackwallet/services/event_bus/events/global/updated_in_background_event.dart';
|
import 'package:stackwallet/services/event_bus/events/global/updated_in_background_event.dart';
|
||||||
import 'package:stackwallet/services/event_bus/global_event_bus.dart';
|
import 'package:stackwallet/services/event_bus/global_event_bus.dart';
|
||||||
|
import 'package:stackwallet/services/mixins/coin_control_interface.dart';
|
||||||
import 'package:stackwallet/services/mixins/paynym_wallet_interface.dart';
|
import 'package:stackwallet/services/mixins/paynym_wallet_interface.dart';
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
import 'package:stackwallet/utilities/logger.dart';
|
import 'package:stackwallet/utilities/logger.dart';
|
||||||
|
@ -229,6 +230,8 @@ class Manager with ChangeNotifier {
|
||||||
|
|
||||||
bool get hasPaynymSupport => _currentWallet is PaynymWalletInterface;
|
bool get hasPaynymSupport => _currentWallet is PaynymWalletInterface;
|
||||||
|
|
||||||
|
bool get hasCoinControlSupport => _currentWallet is CoinControlInterface;
|
||||||
|
|
||||||
int get rescanOnOpenVersion =>
|
int get rescanOnOpenVersion =>
|
||||||
DB.instance.get<dynamic>(
|
DB.instance.get<dynamic>(
|
||||||
boxName: DB.boxNameDBInfo,
|
boxName: DB.boxNameDBInfo,
|
||||||
|
|
3
lib/services/mixins/coin_control_interface.dart
Normal file
3
lib/services/mixins/coin_control_interface.dart
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
mixin CoinControlInterface {
|
||||||
|
//
|
||||||
|
}
|
|
@ -60,7 +60,7 @@ class _COIN_CONTROL {
|
||||||
class _SVG {
|
class _SVG {
|
||||||
const _SVG();
|
const _SVG();
|
||||||
|
|
||||||
static const coinControl = _COIN_CONTROL();
|
final coinControl = const _COIN_CONTROL();
|
||||||
|
|
||||||
String? background(BuildContext context) {
|
String? background(BuildContext context) {
|
||||||
switch (Theme.of(context).extension<StackColors>()!.themeType) {
|
switch (Theme.of(context).extension<StackColors>()!.themeType) {
|
||||||
|
|
|
@ -324,6 +324,9 @@ flutter:
|
||||||
# coin icons
|
# coin icons
|
||||||
- assets/svg/coin_icons/
|
- assets/svg/coin_icons/
|
||||||
|
|
||||||
|
# coin control icons
|
||||||
|
- assets/svg/coin_control/
|
||||||
|
|
||||||
# lottie animations
|
# lottie animations
|
||||||
- assets/lottie/test.json
|
- assets/lottie/test.json
|
||||||
- assets/lottie/test2.json
|
- assets/lottie/test2.json
|
||||||
|
|
Loading…
Reference in a new issue