mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 01:37:54 +00:00
Merge branch 'ui-fixes' into address_book_isar
# Conflicts: # lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart # lib/utilities/db_version_migration.dart
This commit is contained in:
commit
59c1a49ee7
45 changed files with 1058 additions and 715 deletions
|
@ -178,9 +178,6 @@ void main() async {
|
|||
}
|
||||
}
|
||||
|
||||
//Add Themes directory - TODO
|
||||
// await StackFileSystem.applicationThemesDirectory();
|
||||
|
||||
monero.onStartup();
|
||||
wownero.onStartup();
|
||||
|
||||
|
|
|
@ -794,6 +794,15 @@ class StackTheme {
|
|||
Color? _bottomNavIconIcon;
|
||||
final int bottomNavIconIconInt;
|
||||
|
||||
// ==== bottomNavIconIcon highlighted =====================================================
|
||||
|
||||
@ignore
|
||||
Color get bottomNavIconIconHighlighted =>
|
||||
_bottomNavIconIconHighlighted ??= Color(bottomNavIconIconHighlightedInt);
|
||||
@ignore
|
||||
Color? _bottomNavIconIconHighlighted;
|
||||
final int bottomNavIconIconHighlightedInt;
|
||||
|
||||
// ==== topNavIconPrimary =====================================================
|
||||
|
||||
@ignore
|
||||
|
@ -1556,6 +1565,7 @@ class StackTheme {
|
|||
required this.snackBarTextInfoInt,
|
||||
required this.bottomNavIconBackInt,
|
||||
required this.bottomNavIconIconInt,
|
||||
required this.bottomNavIconIconHighlightedInt,
|
||||
required this.topNavIconPrimaryInt,
|
||||
required this.topNavIconGreenInt,
|
||||
required this.topNavIconYellowInt,
|
||||
|
@ -1795,6 +1805,8 @@ class StackTheme {
|
|||
parseColor(json["colors"]["bottom_nav_icon_back"] as String),
|
||||
bottomNavIconIconInt:
|
||||
parseColor(json["colors"]["bottom_nav_icon_icon"] as String),
|
||||
bottomNavIconIconHighlightedInt: parseColor(
|
||||
json["colors"]["bottom_nav_icon_icon_highlighted"] as String),
|
||||
topNavIconPrimaryInt:
|
||||
parseColor(json["colors"]["top_nav_icon_primary"] as String),
|
||||
topNavIconGreenInt:
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,14 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/models/notification_model.dart';
|
||||
import 'package:stackwallet/themes/coin_icon_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/theme_providers.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/format.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/utilities/util.dart';
|
||||
|
@ -9,7 +16,7 @@ import 'package:stackwallet/widgets/conditional_parent.dart';
|
|||
import 'package:stackwallet/widgets/rounded_container.dart';
|
||||
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||
|
||||
class NotificationCard extends StatelessWidget {
|
||||
class NotificationCard extends ConsumerWidget {
|
||||
const NotificationCard({
|
||||
Key? key,
|
||||
required this.notification,
|
||||
|
@ -25,8 +32,17 @@ class NotificationCard extends StatelessWidget {
|
|||
static const double mobileIconSize = 24;
|
||||
static const double desktopIconSize = 30;
|
||||
|
||||
String coinIconPath(ThemeAssets assets, WidgetRef ref) {
|
||||
try {
|
||||
final coin = coinFromPrettyName(notification.coinName);
|
||||
return ref.read(coinIconProvider(coin));
|
||||
} catch (_) {
|
||||
return notification.iconAssetName;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final isDesktop = Util.isDesktop;
|
||||
|
||||
return Stack(
|
||||
|
@ -41,8 +57,14 @@ class NotificationCard extends StatelessWidget {
|
|||
child: Row(
|
||||
children: [
|
||||
notification.changeNowId == null
|
||||
? SvgPicture.asset(
|
||||
notification.iconAssetName,
|
||||
? SvgPicture.file(
|
||||
File(
|
||||
coinIconPath(
|
||||
ref.watch(
|
||||
themeProvider.select((value) => value.assets),
|
||||
),
|
||||
ref),
|
||||
),
|
||||
width: isDesktop ? desktopIconSize : mobileIconSize,
|
||||
height: isDesktop ? desktopIconSize : mobileIconSize,
|
||||
)
|
||||
|
@ -53,8 +75,14 @@ class NotificationCard extends StatelessWidget {
|
|||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
),
|
||||
child: SvgPicture.asset(
|
||||
notification.iconAssetName,
|
||||
child: SvgPicture.file(
|
||||
File(
|
||||
coinIconPath(
|
||||
ref.watch(
|
||||
themeProvider.select((value) => value.assets),
|
||||
),
|
||||
ref),
|
||||
),
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.accentColorDark,
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:stackwallet/providers/global/prefs_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/coin_image_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
|
@ -87,8 +89,10 @@ class CoinSelectSheet extends StatelessWidget {
|
|||
padding: const EdgeInsets.all(12),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
ref.watch(coinImageProvider(coin)),
|
||||
SvgPicture.file(
|
||||
File(
|
||||
ref.watch(coinImageProvider(coin)),
|
||||
),
|
||||
height: 20,
|
||||
width: 20,
|
||||
),
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
@ -334,8 +336,10 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
|
|||
padding: const EdgeInsets.all(12),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
ref.watch(coinIconProvider(e.coin)),
|
||||
SvgPicture.file(
|
||||
File(
|
||||
ref.watch(coinIconProvider(e.coin)),
|
||||
),
|
||||
height: 24,
|
||||
),
|
||||
const SizedBox(
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
@ -9,8 +11,8 @@ import 'package:stackwallet/pages/exchange_view/exchange_step_views/step_2_view.
|
|||
import 'package:stackwallet/pages/send_view/send_view.dart';
|
||||
import 'package:stackwallet/providers/global/address_book_service_provider.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/coin_icon_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/theme_providers.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/clipboard_interface.dart';
|
||||
|
@ -110,11 +112,13 @@ class ContactPopUp extends ConsumerWidget {
|
|||
),
|
||||
child: contact.id == "default"
|
||||
? Center(
|
||||
child: SvgPicture.asset(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) =>
|
||||
value.assets.stackIcon,
|
||||
child: SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value
|
||||
.assets.stackIcon,
|
||||
),
|
||||
),
|
||||
),
|
||||
width: 20,
|
||||
|
@ -211,9 +215,11 @@ class ContactPopUp extends ConsumerWidget {
|
|||
const SizedBox(
|
||||
height: 2,
|
||||
),
|
||||
SvgPicture.asset(
|
||||
ref.watch(
|
||||
coinIconProvider(e.coin),
|
||||
SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
coinIconProvider(e.coin),
|
||||
),
|
||||
),
|
||||
height: 24,
|
||||
),
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
@ -7,8 +9,8 @@ import 'package:stackwallet/pages/address_book_views/subviews/coin_select_sheet.
|
|||
import 'package:stackwallet/providers/providers.dart';
|
||||
// import 'package:stackwallet/providers/global/should_show_lockscreen_on_resume_state_provider.dart';
|
||||
import 'package:stackwallet/providers/ui/address_book_providers/address_entry_data_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/coin_icon_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/address_utils.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/barcode_scanner_interface.dart';
|
||||
|
@ -141,8 +143,10 @@ class _NewContactAddressEntryFormState
|
|||
padding: const EdgeInsets.symmetric(vertical: 4),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
ref.watch(coinIconProvider(coin)),
|
||||
SvgPicture.file(
|
||||
File(
|
||||
ref.watch(coinIconProvider(coin)),
|
||||
),
|
||||
height: 24,
|
||||
width: 24,
|
||||
),
|
||||
|
@ -211,15 +215,17 @@ class _NewContactAddressEntryFormState
|
|||
)
|
||||
: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
ref.watch(
|
||||
coinIconProvider(
|
||||
ref.watch(
|
||||
addressEntryDataProvider(widget.id)
|
||||
.select(
|
||||
(value) => value.coin,
|
||||
),
|
||||
)!,
|
||||
SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
coinIconProvider(
|
||||
ref.watch(
|
||||
addressEntryDataProvider(widget.id)
|
||||
.select(
|
||||
(value) => value.coin,
|
||||
),
|
||||
)!,
|
||||
),
|
||||
),
|
||||
),
|
||||
height: 20,
|
||||
|
|
|
@ -144,7 +144,7 @@ class _ReceiveViewState extends ConsumerState<ReceiveView> {
|
|||
aspectRatio: 1,
|
||||
child: AppBarIconButton(
|
||||
semanticsLabel:
|
||||
"Address List Pop-up Button. Opens A Pop-up For Adress List Button.",
|
||||
"Address List Pop-up Button. Opens A Pop-up For Address List Button.",
|
||||
key: const Key("walletNetworkSettingsAddNewNodeViewButton"),
|
||||
size: 36,
|
||||
shadows: const [],
|
||||
|
|
|
@ -191,7 +191,8 @@ class GlobalSettingsView extends StatelessWidget {
|
|||
title: "Appearance",
|
||||
onPressed: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
AppearanceSettingsView.routeName);
|
||||
AppearanceSettingsView.routeName,
|
||||
);
|
||||
},
|
||||
),
|
||||
if (Platform.isIOS)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
|
@ -6,8 +8,8 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/stack_back
|
|||
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/sub_widgets/restoring_item_card.dart';
|
||||
import 'package:stackwallet/providers/stack_restore/stack_restoring_ui_state_provider.dart';
|
||||
import 'package:stackwallet/route_generator.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/coin_icon_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/enums/stack_restoring_status.dart';
|
||||
|
@ -81,8 +83,10 @@ class _RestoringWalletCardState extends ConsumerState<RestoringWalletCard> {
|
|||
.extension<StackColors>()!
|
||||
.colorForCoin(coin),
|
||||
child: Center(
|
||||
child: SvgPicture.asset(
|
||||
ref.watch(coinIconProvider(coin)),
|
||||
child: SvgPicture.file(
|
||||
File(
|
||||
ref.watch(coinIconProvider(coin)),
|
||||
),
|
||||
height: 20,
|
||||
width: 20,
|
||||
),
|
||||
|
@ -222,9 +226,11 @@ class _RestoringWalletCardState extends ConsumerState<RestoringWalletCard> {
|
|||
.extension<StackColors>()!
|
||||
.colorForCoin(coin),
|
||||
child: Center(
|
||||
child: SvgPicture.asset(
|
||||
ref.watch(
|
||||
coinIconProvider(coin),
|
||||
child: SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
coinIconProvider(coin),
|
||||
),
|
||||
),
|
||||
height: 20,
|
||||
width: 20,
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:stackwallet/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_view.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/coin_icon_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/widgets/background.dart';
|
||||
|
@ -236,22 +238,24 @@ class _StartupPreferencesViewState
|
|||
.only(top: 12),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
ref.watch(
|
||||
coinIconProvider(
|
||||
ref
|
||||
.watch(
|
||||
walletsChangeNotifierProvider
|
||||
.select(
|
||||
(value) =>
|
||||
value.getManager(
|
||||
ref.watch(
|
||||
prefsChangeNotifierProvider.select((value) => value.startupWalletId!),
|
||||
SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
coinIconProvider(
|
||||
ref
|
||||
.watch(
|
||||
walletsChangeNotifierProvider
|
||||
.select(
|
||||
(value) =>
|
||||
value.getManager(
|
||||
ref.watch(
|
||||
prefsChangeNotifierProvider.select((value) => value.startupWalletId!),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
.coin,
|
||||
)
|
||||
.coin,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/coin_icon_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/widgets/background.dart';
|
||||
|
@ -102,9 +104,11 @@ class _StartupWalletSelectionViewState
|
|||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: SvgPicture.asset(
|
||||
ref.watch(
|
||||
coinIconProvider(manager.coin),
|
||||
child: SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
coinIconProvider(manager.coin),
|
||||
),
|
||||
),
|
||||
width: 20,
|
||||
height: 20,
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/coin_icon_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/enums/sync_type_enum.dart';
|
||||
|
@ -116,9 +118,11 @@ class WalletSyncingOptionsView extends ConsumerWidget {
|
|||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: SvgPicture.asset(
|
||||
ref.watch(
|
||||
coinIconProvider(manager.coin),
|
||||
child: SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
coinIconProvider(manager.coin),
|
||||
),
|
||||
),
|
||||
width: 20,
|
||||
height: 20,
|
||||
|
|
|
@ -8,7 +8,6 @@ import 'package:qr_flutter/qr_flutter.dart';
|
|||
import 'package:stackwallet/notifications/show_flush_bar.dart';
|
||||
import 'package:stackwallet/providers/global/wallets_provider.dart';
|
||||
import 'package:stackwallet/services/coins/manager.dart';
|
||||
import 'package:stackwallet/services/mixins/xpubable.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/clipboard_interface.dart';
|
||||
|
@ -177,7 +176,7 @@ class _XPubViewState extends ConsumerState<XPubView> {
|
|||
child: child,
|
||||
),
|
||||
child: FutureBuilder(
|
||||
future: (manager.wallet as XPubAble).xpub,
|
||||
future: manager.xpub,
|
||||
builder: (context, AsyncSnapshot<String> snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done &&
|
||||
snapshot.hasData) {
|
||||
|
|
|
@ -33,7 +33,7 @@ import 'package:stackwallet/widgets/rounded_white_container.dart';
|
|||
import 'package:tuple/tuple.dart';
|
||||
|
||||
/// [eventBus] should only be set during testing
|
||||
class WalletSettingsView extends StatefulWidget {
|
||||
class WalletSettingsView extends ConsumerStatefulWidget {
|
||||
const WalletSettingsView({
|
||||
Key? key,
|
||||
required this.walletId,
|
||||
|
@ -52,10 +52,10 @@ class WalletSettingsView extends StatefulWidget {
|
|||
final EventBus? eventBus;
|
||||
|
||||
@override
|
||||
State<WalletSettingsView> createState() => _WalletSettingsViewState();
|
||||
ConsumerState<WalletSettingsView> createState() => _WalletSettingsViewState();
|
||||
}
|
||||
|
||||
class _WalletSettingsViewState extends State<WalletSettingsView> {
|
||||
class _WalletSettingsViewState extends ConsumerState<WalletSettingsView> {
|
||||
late final String walletId;
|
||||
late final Coin coin;
|
||||
late String xpub;
|
||||
|
@ -74,7 +74,7 @@ class _WalletSettingsViewState extends State<WalletSettingsView> {
|
|||
walletId = widget.walletId;
|
||||
coin = widget.coin;
|
||||
xPubEnabled =
|
||||
coin != Coin.monero && coin != Coin.wownero && coin != Coin.epicCash;
|
||||
ref.read(walletsChangeNotifierProvider).getManager(walletId).hasXPub;
|
||||
xpub = "";
|
||||
|
||||
_currentSyncStatus = widget.initialSyncStatus;
|
||||
|
|
|
@ -23,19 +23,6 @@ class TxIcon extends ConsumerWidget {
|
|||
|
||||
static const Size size = Size(32, 32);
|
||||
|
||||
// String _getBundleAssetName(
|
||||
// bool isCancelled, bool isReceived, bool isPending, BuildContext context) {
|
||||
// if (!isReceived && transaction.subType == TransactionSubType.mint) {
|
||||
// if (isCancelled) {
|
||||
// return Assets.svg.anonymizeFailed;
|
||||
// }
|
||||
// if (isPending) {
|
||||
// return Assets.svg.anonymizePending;
|
||||
// }
|
||||
// return Assets.svg.anonymize;
|
||||
// }
|
||||
// }
|
||||
|
||||
String _getAssetName(
|
||||
bool isCancelled, bool isReceived, bool isPending, ThemeAssets assets) {
|
||||
if (!isReceived && transaction.subType == TransactionSubType.mint) {
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:stackwallet/db/isar/main_db.dart';
|
||||
import 'package:stackwallet/models/isar/models/contact_entry.dart';
|
||||
import 'package:stackwallet/models/isar/models/isar_models.dart';
|
||||
import 'package:stackwallet/pages/address_book_views/subviews/add_new_contact_address_view.dart';
|
||||
|
@ -24,8 +27,6 @@ import 'package:stackwallet/widgets/rounded_white_container.dart';
|
|||
import 'package:stackwallet/widgets/transaction_card.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
|
||||
import '../../../db/isar/main_db.dart';
|
||||
|
||||
class DesktopContactDetails extends ConsumerStatefulWidget {
|
||||
const DesktopContactDetails({
|
||||
Key? key,
|
||||
|
@ -117,12 +118,14 @@ class _DesktopContactDetailsState extends ConsumerState<DesktopContactDetails> {
|
|||
.textFieldDefaultBG,
|
||||
borderRadius: BorderRadius.circular(32),
|
||||
),
|
||||
child: contact.id == "default"
|
||||
child: contact.customId == "default"
|
||||
? Center(
|
||||
child: SvgPicture.asset(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.stackIcon,
|
||||
child: SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.stackIcon,
|
||||
),
|
||||
),
|
||||
),
|
||||
width: 32,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
|
@ -6,8 +8,8 @@ import 'package:stackwallet/db/isar/main_db.dart';
|
|||
import 'package:stackwallet/models/isar/models/blockchain_data/utxo.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/coin_control/utxo_row.dart';
|
||||
import 'package:stackwallet/providers/global/wallets_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/coin_icon_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
|
@ -359,8 +361,10 @@ class _DesktopCoinControlUseDialogState
|
|||
color: Colors.transparent,
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
ref.watch(coinIconProvider(coin)),
|
||||
SvgPicture.file(
|
||||
File(
|
||||
ref.watch(coinIconProvider(coin)),
|
||||
),
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
|
@ -7,8 +9,8 @@ import 'package:stackwallet/models/isar/models/blockchain_data/utxo.dart';
|
|||
import 'package:stackwallet/pages_desktop_specific/coin_control/freeze_button.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/coin_control/utxo_row.dart';
|
||||
import 'package:stackwallet/providers/global/wallets_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/coin_icon_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
|
@ -343,8 +345,10 @@ class _DesktopCoinControlViewState
|
|||
color: Colors.transparent,
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
ref.watch(coinIconProvider(coin)),
|
||||
SvgPicture.file(
|
||||
File(
|
||||
ref.watch(coinIconProvider(coin)),
|
||||
),
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:decimal/decimal.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
@ -522,10 +523,14 @@ class _DesktopTradeRowCardState extends ConsumerState<DesktopTradeRowCard> {
|
|||
borderRadius: BorderRadius.circular(32),
|
||||
),
|
||||
child: Center(
|
||||
child: SvgPicture.asset(
|
||||
_fetchIconAssetForStatus(
|
||||
trade.status,
|
||||
ref.watch(themeProvider.select((value) => value.assets)),
|
||||
child: SvgPicture.file(
|
||||
File(
|
||||
_fetchIconAssetForStatus(
|
||||
trade.status,
|
||||
ref.watch(
|
||||
themeProvider.select((value) => value.assets),
|
||||
),
|
||||
),
|
||||
),
|
||||
width: 32,
|
||||
height: 32,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
|
@ -81,28 +83,36 @@ class DesktopNotificationsIcon extends ConsumerWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return SvgPicture.asset(
|
||||
ref.watch(notificationsProvider
|
||||
.select((value) => value.hasUnreadNotifications))
|
||||
? ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.bellNew,
|
||||
return ref.watch(notificationsProvider
|
||||
.select((value) => value.hasUnreadNotifications))
|
||||
? SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.bellNew,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Assets.svg.bell,
|
||||
width: 20,
|
||||
height: 20,
|
||||
color: ref.watch(notificationsProvider
|
||||
.select((value) => value.hasUnreadNotifications))
|
||||
? null
|
||||
: DesktopMenuItemId.notifications ==
|
||||
ref.watch(currentDesktopMenuItemProvider.state).state
|
||||
? Theme.of(context).extension<StackColors>()!.accentColorDark
|
||||
: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.accentColorDark
|
||||
.withOpacity(0.8),
|
||||
);
|
||||
),
|
||||
width: 20,
|
||||
height: 20,
|
||||
)
|
||||
: SvgPicture.asset(
|
||||
Assets.svg.bell,
|
||||
width: 20,
|
||||
height: 20,
|
||||
color: ref.watch(notificationsProvider
|
||||
.select((value) => value.hasUnreadNotifications))
|
||||
? null
|
||||
: DesktopMenuItemId.notifications ==
|
||||
ref.watch(currentDesktopMenuItemProvider.state).state
|
||||
? Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.accentColorDark
|
||||
: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.accentColorDark
|
||||
.withOpacity(0.8),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
@ -53,10 +55,12 @@ class DesktopMyStackTitle extends ConsumerWidget {
|
|||
SizedBox(
|
||||
width: 32,
|
||||
height: 32,
|
||||
child: SvgPicture.asset(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.stackIcon,
|
||||
child: SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.stackIcon,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
|
@ -10,8 +12,8 @@ import 'package:stackwallet/providers/global/price_provider.dart';
|
|||
import 'package:stackwallet/providers/global/wallets_provider.dart';
|
||||
import 'package:stackwallet/providers/wallet/public_private_balance_state_provider.dart';
|
||||
import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/coin_icon_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
import 'package:stackwallet/utilities/barcode_scanner_interface.dart';
|
||||
import 'package:stackwallet/utilities/clipboard_interface.dart';
|
||||
|
@ -81,8 +83,10 @@ class _DesktopPaynymSendDialogState
|
|||
// Theme.of(context).extension<StackColors>()!.textSubtitle4,
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
ref.watch(coinIconProvider(coin)),
|
||||
SvgPicture.file(
|
||||
File(
|
||||
ref.watch(coinIconProvider(coin)),
|
||||
),
|
||||
width: 36,
|
||||
height: 36,
|
||||
),
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:stackwallet/pages/wallets_view/wallets_overview.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/coin_icon_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
|
@ -141,8 +143,10 @@ class _DesktopWalletSummaryRowState
|
|||
flex: 4,
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
ref.watch(coinIconProvider(widget.coin)),
|
||||
SvgPicture.file(
|
||||
File(
|
||||
ref.watch(coinIconProvider(widget.coin)),
|
||||
),
|
||||
width: 28,
|
||||
height: 28,
|
||||
),
|
||||
|
|
|
@ -94,10 +94,12 @@ class _ForgotPasswordDesktopViewState
|
|||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.stackIcon,
|
||||
SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.stackIcon,
|
||||
),
|
||||
),
|
||||
),
|
||||
width: 100,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
@ -166,10 +167,12 @@ class _DesktopLoginViewState extends ConsumerState<DesktopLoginView> {
|
|||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.stackIcon,
|
||||
SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.stackIcon,
|
||||
),
|
||||
),
|
||||
),
|
||||
width: 100,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
|
@ -47,10 +49,12 @@ class _ForgotPasswordDesktopViewState
|
|||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.stackIcon,
|
||||
SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.stackIcon,
|
||||
),
|
||||
),
|
||||
),
|
||||
width: 100,
|
||||
|
|
|
@ -6,8 +6,8 @@ import 'package:flutter_svg/svg.dart';
|
|||
import 'package:stackwallet/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/route_generator.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/coin_icon_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
|
@ -250,8 +250,10 @@ class _NodesSettings extends ConsumerState<NodesSettings> {
|
|||
children: [
|
||||
Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
ref.watch(coinIconProvider(coin)),
|
||||
SvgPicture.file(
|
||||
File(
|
||||
ref.watch(coinIconProvider(coin)),
|
||||
),
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
|
|
|
@ -53,11 +53,11 @@ import 'package:uuid/uuid.dart';
|
|||
const int MINIMUM_CONFIRMATIONS = 1;
|
||||
final Amount DUST_LIMIT = Amount(
|
||||
rawValue: BigInt.from(294),
|
||||
fractionDigits: Coin.particl.decimals,
|
||||
fractionDigits: Coin.bitcoin.decimals,
|
||||
);
|
||||
final Amount DUST_LIMIT_P2PKH = Amount(
|
||||
rawValue: BigInt.from(546),
|
||||
fractionDigits: Coin.particl.decimals,
|
||||
fractionDigits: Coin.bitcoin.decimals,
|
||||
);
|
||||
|
||||
const String GENESIS_HASH_MAINNET =
|
||||
|
|
|
@ -71,7 +71,6 @@ String constructDerivePath({
|
|||
case 0x80: // bch mainnet wif
|
||||
switch (derivePathType) {
|
||||
case DerivePathType.bip44:
|
||||
case DerivePathType.bip49:
|
||||
coinType = 145; // bch mainnet
|
||||
break;
|
||||
case DerivePathType.bch44: // bitcoin.com wallet specific
|
||||
|
@ -95,9 +94,6 @@ String constructDerivePath({
|
|||
case DerivePathType.bch44:
|
||||
purpose = 44;
|
||||
break;
|
||||
case DerivePathType.bip49:
|
||||
purpose = 49;
|
||||
break;
|
||||
default:
|
||||
throw Exception("DerivePathType $derivePathType not supported");
|
||||
}
|
||||
|
@ -283,10 +279,6 @@ class BitcoinCashWallet extends CoinServiceAPI
|
|||
return DerivePathType.bip44;
|
||||
}
|
||||
|
||||
if (decodeBase58[0] == _network.scriptHash) {
|
||||
// P2SH
|
||||
return DerivePathType.bip49;
|
||||
}
|
||||
throw ArgumentError('Invalid version or Network mismatch');
|
||||
} else {
|
||||
try {
|
||||
|
@ -419,15 +411,6 @@ class BitcoinCashWallet extends CoinServiceAPI
|
|||
addrType = isar_models.AddressType.p2pkh;
|
||||
addressString = bitbox.Address.toCashAddress(addressString);
|
||||
break;
|
||||
case DerivePathType.bip49:
|
||||
addressString = P2SH(
|
||||
data: PaymentData(
|
||||
redeem: P2WPKH(data: data, network: _network).data),
|
||||
network: _network)
|
||||
.data
|
||||
.address!;
|
||||
addrType = isar_models.AddressType.p2sh;
|
||||
break;
|
||||
default:
|
||||
throw Exception("DerivePathType $type not supported");
|
||||
}
|
||||
|
@ -518,7 +501,6 @@ class BitcoinCashWallet extends CoinServiceAPI
|
|||
|
||||
final deriveTypes = [
|
||||
DerivePathType.bip44,
|
||||
DerivePathType.bip49,
|
||||
];
|
||||
|
||||
if (coin != Coin.bitcoincashTestnet) {
|
||||
|
@ -1397,10 +1379,6 @@ class BitcoinCashWallet extends CoinServiceAPI
|
|||
// P2PKH
|
||||
_generateAddressForChain(0, 0, DerivePathType.bip44),
|
||||
_generateAddressForChain(1, 0, DerivePathType.bip44),
|
||||
|
||||
// P2SH
|
||||
_generateAddressForChain(0, 0, DerivePathType.bip49),
|
||||
_generateAddressForChain(1, 0, DerivePathType.bip49),
|
||||
]);
|
||||
|
||||
await db.putAddresses(initialAddresses);
|
||||
|
@ -1408,7 +1386,7 @@ class BitcoinCashWallet extends CoinServiceAPI
|
|||
Logging.instance.log("_generateNewWalletFinished", level: LogLevel.Info);
|
||||
}
|
||||
|
||||
/// Generates a new internal or external chain address for the wallet using a BIP44 or BIP49 derivation path.
|
||||
/// Generates a new internal or external chain address for the wallet using a BIP44 derivation path.
|
||||
/// [chain] - Use 0 for receiving (external), 1 for change (internal). Should not be any other value!
|
||||
/// [index] - This can be any integer >= 0
|
||||
Future<isar_models.Address> _generateAddressForChain(
|
||||
|
@ -1449,17 +1427,6 @@ class BitcoinCashWallet extends CoinServiceAPI
|
|||
addrType = isar_models.AddressType.p2pkh;
|
||||
address = bitbox.Address.toCashAddress(address);
|
||||
break;
|
||||
case DerivePathType.bip49:
|
||||
address = P2SH(
|
||||
data: PaymentData(
|
||||
redeem: P2WPKH(data: data, network: _network).data),
|
||||
network: _network)
|
||||
.data
|
||||
.address!;
|
||||
addrType = isar_models.AddressType.p2sh;
|
||||
break;
|
||||
case DerivePathType.bip84:
|
||||
throw UnsupportedError("bip84 not supported by BCH");
|
||||
default:
|
||||
throw Exception("DerivePathType $derivePathType not supported");
|
||||
}
|
||||
|
@ -1502,13 +1469,6 @@ class BitcoinCashWallet extends CoinServiceAPI
|
|||
coinType = coin == Coin.bitcoincash ? "0" : "1";
|
||||
purpose = "44";
|
||||
break;
|
||||
case DerivePathType.bip49:
|
||||
type = isar_models.AddressType.p2sh;
|
||||
coinType = coin == Coin.bitcoincash ? "145" : "1";
|
||||
purpose = "49";
|
||||
break;
|
||||
case DerivePathType.bip84:
|
||||
throw UnsupportedError("bip84 not supported by BCH");
|
||||
default:
|
||||
throw Exception("DerivePathType $derivePathType not supported");
|
||||
}
|
||||
|
@ -1537,9 +1497,6 @@ class BitcoinCashWallet extends CoinServiceAPI
|
|||
case DerivePathType.bch44:
|
||||
key = "${walletId}_${chainId}DerivationsBch44P2PKH";
|
||||
break;
|
||||
case DerivePathType.bip49:
|
||||
key = "${walletId}_${chainId}DerivationsP2SH";
|
||||
break;
|
||||
default:
|
||||
throw UnsupportedError(
|
||||
"${derivePathType.name} not supported by ${coin.prettyName}");
|
||||
|
@ -2721,20 +2678,6 @@ class BitcoinCashWallet extends CoinServiceAPI
|
|||
redeemScript = null;
|
||||
break;
|
||||
|
||||
case DerivePathType.bip49:
|
||||
final p2wpkh = P2WPKH(
|
||||
data: PaymentData(
|
||||
pubkey: Format.stringToUint8List(pubKey),
|
||||
),
|
||||
network: _network,
|
||||
).data;
|
||||
redeemScript = p2wpkh.output;
|
||||
data = P2SH(
|
||||
data: PaymentData(redeem: p2wpkh),
|
||||
network: _network,
|
||||
).data;
|
||||
break;
|
||||
|
||||
default:
|
||||
throw Exception("DerivePathType unsupported");
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@ import 'package:stackwallet/services/event_bus/events/global/updated_in_backgrou
|
|||
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/utilities/amount/amount.dart';
|
||||
import 'package:stackwallet/services/mixins/xpubable.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/logger.dart';
|
||||
|
||||
|
@ -252,7 +252,8 @@ class Manager with ChangeNotifier {
|
|||
);
|
||||
}
|
||||
|
||||
bool get hasXPub => _currentWallet is XPubAble;
|
||||
// TODO: re enable once xpubs have been redone
|
||||
bool get hasXPub => false; //_currentWallet is XPubAble;
|
||||
|
||||
Future<String> get xpub async {
|
||||
if (!hasXPub) {
|
||||
|
|
|
@ -103,6 +103,7 @@ class StackColors extends ThemeExtension<StackColors> {
|
|||
// icons
|
||||
final Color bottomNavIconBack;
|
||||
final Color bottomNavIconIcon;
|
||||
final Color bottomNavIconIconHighlighted;
|
||||
final Color topNavIconPrimary;
|
||||
final Color topNavIconGreen;
|
||||
final Color topNavIconYellow;
|
||||
|
@ -281,6 +282,7 @@ class StackColors extends ThemeExtension<StackColors> {
|
|||
required this.snackBarTextInfo,
|
||||
required this.bottomNavIconBack,
|
||||
required this.bottomNavIconIcon,
|
||||
required this.bottomNavIconIconHighlighted,
|
||||
required this.topNavIconPrimary,
|
||||
required this.topNavIconGreen,
|
||||
required this.topNavIconYellow,
|
||||
|
@ -441,6 +443,7 @@ class StackColors extends ThemeExtension<StackColors> {
|
|||
snackBarTextInfo: colorTheme.snackBarTextInfo,
|
||||
bottomNavIconBack: colorTheme.bottomNavIconBack,
|
||||
bottomNavIconIcon: colorTheme.bottomNavIconIcon,
|
||||
bottomNavIconIconHighlighted: colorTheme.bottomNavIconIconHighlighted,
|
||||
topNavIconPrimary: colorTheme.topNavIconPrimary,
|
||||
topNavIconGreen: colorTheme.topNavIconGreen,
|
||||
topNavIconYellow: colorTheme.topNavIconYellow,
|
||||
|
@ -603,6 +606,7 @@ class StackColors extends ThemeExtension<StackColors> {
|
|||
Color? snackBarTextInfo,
|
||||
Color? bottomNavIconBack,
|
||||
Color? bottomNavIconIcon,
|
||||
Color? bottomNavIconIconHighlighted,
|
||||
Color? topNavIconPrimary,
|
||||
Color? topNavIconGreen,
|
||||
Color? topNavIconYellow,
|
||||
|
@ -776,6 +780,8 @@ class StackColors extends ThemeExtension<StackColors> {
|
|||
snackBarTextInfo: snackBarTextInfo ?? this.snackBarTextInfo,
|
||||
bottomNavIconBack: bottomNavIconBack ?? this.bottomNavIconBack,
|
||||
bottomNavIconIcon: bottomNavIconIcon ?? this.bottomNavIconIcon,
|
||||
bottomNavIconIconHighlighted:
|
||||
bottomNavIconIconHighlighted ?? this.bottomNavIconIconHighlighted,
|
||||
topNavIconPrimary: topNavIconPrimary ?? this.topNavIconPrimary,
|
||||
topNavIconGreen: topNavIconGreen ?? this.topNavIconGreen,
|
||||
topNavIconYellow: topNavIconYellow ?? this.topNavIconYellow,
|
||||
|
@ -1279,6 +1285,11 @@ class StackColors extends ThemeExtension<StackColors> {
|
|||
other.bottomNavIconIcon,
|
||||
t,
|
||||
)!,
|
||||
bottomNavIconIconHighlighted: Color.lerp(
|
||||
bottomNavIconIconHighlighted,
|
||||
other.bottomNavIconIconHighlighted,
|
||||
t,
|
||||
)!,
|
||||
topNavIconPrimary: Color.lerp(
|
||||
topNavIconPrimary,
|
||||
other.topNavIconPrimary,
|
||||
|
|
|
@ -42,7 +42,7 @@ abstract class Constants {
|
|||
// Enable Logger.print statements
|
||||
static const bool disableLogger = false;
|
||||
|
||||
static const int currentHiveDbVersion = 8;
|
||||
static const int currentHiveDbVersion = 9;
|
||||
|
||||
static const int rescanV1 = 1;
|
||||
|
||||
|
|
|
@ -293,6 +293,37 @@ class DbVersionMigrator with WalletDB {
|
|||
// try to continue migrating
|
||||
return await migrate(8, secureStore: secureStore);
|
||||
|
||||
case 8:
|
||||
// migrate
|
||||
await Hive.openBox<dynamic>(DB.boxNameAllWalletsData);
|
||||
final walletsService =
|
||||
WalletsService(secureStorageInterface: secureStore);
|
||||
final walletInfoList = await walletsService.walletNames;
|
||||
await MainDB.instance.initMainDB();
|
||||
for (final walletId in walletInfoList.keys) {
|
||||
final info = walletInfoList[walletId]!;
|
||||
if (info.coin == Coin.bitcoincash ||
|
||||
info.coin == Coin.bitcoincashTestnet) {
|
||||
final ids = await MainDB.instance
|
||||
.getAddresses(walletId)
|
||||
.filter()
|
||||
.typeEqualTo(isar_models.AddressType.p2sh)
|
||||
.idProperty()
|
||||
.findAll();
|
||||
|
||||
await MainDB.instance.isar.writeTxn(() async {
|
||||
await MainDB.instance.isar.addresses.deleteAll(ids);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// update version
|
||||
await DB.instance.put<dynamic>(
|
||||
boxName: DB.boxNameDBInfo, key: "hive_data_version", value: 9);
|
||||
|
||||
// try to continue migrating
|
||||
return await migrate(9, secureStore: secureStore);
|
||||
|
||||
case 9:
|
||||
// migrate
|
||||
await _v9();
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
|
@ -5,6 +7,7 @@ import 'package:stackwallet/models/isar/models/contact_entry.dart';
|
|||
import 'package:stackwallet/pages/address_book_views/subviews/contact_popup.dart';
|
||||
import 'package:stackwallet/providers/global/address_book_service_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/theme_providers.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
|
@ -14,8 +17,6 @@ import 'package:stackwallet/widgets/conditional_parent.dart';
|
|||
import 'package:stackwallet/widgets/expandable.dart';
|
||||
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||
|
||||
import '../themes/theme_providers.dart';
|
||||
|
||||
class AddressBookCard extends ConsumerStatefulWidget {
|
||||
const AddressBookCard({
|
||||
Key? key,
|
||||
|
@ -92,10 +93,12 @@ class _AddressBookCardState extends ConsumerState<AddressBookCard> {
|
|||
),
|
||||
child: contact.customId == "default"
|
||||
? Center(
|
||||
child: SvgPicture.asset(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.stackIcon,
|
||||
child: SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.stackIcon,
|
||||
),
|
||||
),
|
||||
),
|
||||
width: 20,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
@ -47,10 +49,12 @@ class _LivingStackIconState extends ConsumerState<LivingStackIcon> {
|
|||
child: AnimatedScale(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
scale: _hovering ? 1.2 : 1,
|
||||
child: SvgPicture.asset(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.stackIcon,
|
||||
child: SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.stackIcon,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -14,7 +14,7 @@ class ExchangeNavIcon extends ConsumerWidget {
|
|||
File(
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets.buy,
|
||||
(value) => value.assets.exchange,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -68,9 +68,10 @@ class WalletNavigationBarItem extends ConsumerWidget {
|
|||
Text(
|
||||
data.label ?? "",
|
||||
style: STextStyles.buttonSmall(context).copyWith(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.bottomNavText),
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.bottomNavText,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -112,7 +113,11 @@ class WalletNavigationBarMoreItem extends ConsumerWidget {
|
|||
child: Text(
|
||||
data.label ?? "",
|
||||
textAlign: TextAlign.center,
|
||||
style: STextStyles.buttonSmall(context),
|
||||
style: STextStyles.buttonSmall(context).copyWith(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.bottomNavText,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
|
|
|
@ -175,7 +175,7 @@ class _WalletNavigationBarState extends ConsumerState<WalletNavigationBar> {
|
|||
height: 20,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.infoItemIcons,
|
||||
.bottomNavIconIconHighlighted,
|
||||
),
|
||||
crossFadeState: ref
|
||||
.watch(walletNavBarMore.state)
|
||||
|
@ -190,10 +190,10 @@ class _WalletNavigationBarState extends ConsumerState<WalletNavigationBar> {
|
|||
style:
|
||||
STextStyles.buttonSmall(context)
|
||||
.copyWith(
|
||||
color: Theme.of(context)
|
||||
.extension<
|
||||
StackColors>()!
|
||||
.bottomNavText),
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.bottomNavText,
|
||||
),
|
||||
),
|
||||
secondChild: Text(
|
||||
"More",
|
||||
|
@ -202,7 +202,7 @@ class _WalletNavigationBarState extends ConsumerState<WalletNavigationBar> {
|
|||
.copyWith(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.infoItemIcons,
|
||||
.bottomNavIconIconHighlighted,
|
||||
),
|
||||
),
|
||||
crossFadeState: ref
|
||||
|
|
|
@ -343,14 +343,9 @@ flutter:
|
|||
# exchange icons
|
||||
- assets/svg/exchange_icons/
|
||||
|
||||
# theme selectors
|
||||
# - assets/svg/dark-theme.svg
|
||||
# - assets/svg/light-mode.svg
|
||||
|
||||
# buy
|
||||
- assets/svg/buy/
|
||||
|
||||
|
||||
# lottie animations
|
||||
# basic
|
||||
- assets/lottie/test2.json
|
||||
|
|
|
@ -1,17 +1,35 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/models/notification_model.dart';
|
||||
import 'package:stackwallet/notifications/notification_card.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/theme_service.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
|
||||
import '../sample_data/theme_json.dart';
|
||||
import 'notification_card_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([
|
||||
ThemeService,
|
||||
])
|
||||
void main() {
|
||||
testWidgets("test notification card", (widgetTester) async {
|
||||
final key = UniqueKey();
|
||||
final mockThemeService = MockThemeService();
|
||||
final theme = StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
);
|
||||
|
||||
when(mockThemeService.getTheme(themeId: "light")).thenAnswer(
|
||||
(_) => theme,
|
||||
);
|
||||
|
||||
final notificationCard = NotificationCard(
|
||||
key: key,
|
||||
notification: NotificationModel(
|
||||
|
@ -27,19 +45,21 @@ void main() {
|
|||
);
|
||||
|
||||
await widgetTester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: ThemeData(
|
||||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
ProviderScope(
|
||||
overrides: [
|
||||
pThemeService.overrideWithValue(mockThemeService),
|
||||
],
|
||||
child: MaterialApp(
|
||||
theme: ThemeData(
|
||||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
theme,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
home: Material(
|
||||
child: notificationCard,
|
||||
],
|
||||
),
|
||||
home: Material(
|
||||
child: notificationCard,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
122
test/notifications/notification_card_test.mocks.dart
Normal file
122
test/notifications/notification_card_test.mocks.dart
Normal file
|
@ -0,0 +1,122 @@
|
|||
// Mocks generated by Mockito 5.3.2 from annotations
|
||||
// in stackwallet/test/notifications/notification_card_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i5;
|
||||
import 'dart:typed_data' as _i6;
|
||||
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:stackwallet/db/isar/main_db.dart' as _i2;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i4;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i3;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
// ignore_for_file: avoid_setters_without_getters
|
||||
// ignore_for_file: comment_references
|
||||
// ignore_for_file: implementation_imports
|
||||
// ignore_for_file: invalid_use_of_visible_for_testing_member
|
||||
// ignore_for_file: prefer_const_constructors
|
||||
// ignore_for_file: unnecessary_parenthesis
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB {
|
||||
_FakeMainDB_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
}
|
||||
|
||||
/// A class which mocks [ThemeService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
||||
MockThemeService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i2.MainDB get db => (super.noSuchMethod(
|
||||
Invocation.getter(#db),
|
||||
returnValue: _FakeMainDB_0(
|
||||
this,
|
||||
Invocation.getter(#db),
|
||||
),
|
||||
) as _i2.MainDB);
|
||||
@override
|
||||
List<_i4.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
Invocation.getter(#installedThemes),
|
||||
returnValue: <_i4.StackTheme>[],
|
||||
) as List<_i4.StackTheme>);
|
||||
@override
|
||||
void init(_i2.MainDB? db) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[db],
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i5.Future<void> install({required _i6.Uint8List? themeArchiveData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#install,
|
||||
[],
|
||||
{#themeArchiveData: themeArchiveData},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
@override
|
||||
_i5.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#remove,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
@override
|
||||
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#verifyInstalled,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<bool>.value(false),
|
||||
) as _i5.Future<bool>);
|
||||
@override
|
||||
_i5.Future<List<_i3.StackThemeMetaData>> fetchThemes() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchThemes,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<List<_i3.StackThemeMetaData>>.value(
|
||||
<_i3.StackThemeMetaData>[]),
|
||||
) as _i5.Future<List<_i3.StackThemeMetaData>>);
|
||||
@override
|
||||
_i5.Future<_i6.Uint8List> fetchTheme(
|
||||
{required _i3.StackThemeMetaData? themeMetaData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchTheme,
|
||||
[],
|
||||
{#themeMetaData: themeMetaData},
|
||||
),
|
||||
returnValue: _i5.Future<_i6.Uint8List>.value(_i6.Uint8List(0)),
|
||||
) as _i5.Future<_i6.Uint8List>);
|
||||
@override
|
||||
_i4.StackTheme? getTheme({required String? themeId}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getTheme,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
)) as _i4.StackTheme?);
|
||||
}
|
|
@ -91,6 +91,7 @@ const Map<String, dynamic> lightThemeJsonMap = {
|
|||
"snack_bar_text_info": "0xFF002A78",
|
||||
"bottom_nav_icon_back": "0xFFA2A2A2",
|
||||
"bottom_nav_icon_icon": "0xFF232323",
|
||||
"bottom_nav_icon_icon_highlighted": "0xFF232323",
|
||||
"top_nav_icon_primary": "0xFF232323",
|
||||
"top_nav_icon_green": "0xFF00A578",
|
||||
"top_nav_icon_yellow": "0xFFF4C517",
|
||||
|
|
|
@ -175,17 +175,6 @@ void main() async {
|
|||
verifyNoMoreInteractions(cachedClient);
|
||||
verifyNoMoreInteractions(tracker);
|
||||
});
|
||||
|
||||
test("Multisig/P2SH address", () {
|
||||
expect(
|
||||
mainnetWallet?.addressType(
|
||||
address: "3DYuVEmuKWQFxJcF7jDPhwPiXLTiNnyMFb"),
|
||||
DerivePathType.bip49);
|
||||
expect(secureStore.interactions, 0);
|
||||
verifyNoMoreInteractions(client);
|
||||
verifyNoMoreInteractions(cachedClient);
|
||||
verifyNoMoreInteractions(tracker);
|
||||
});
|
||||
});
|
||||
|
||||
group("validate mainnet bitcoincash addresses", () {
|
||||
|
|
Loading…
Reference in a new issue