Merge branch 'staging' into add-xtz
# Conflicts: # pubspec.lock
16
.metadata
|
@ -4,7 +4,7 @@
|
|||
# This file should be version controlled.
|
||||
|
||||
version:
|
||||
revision: f1875d570e39de09040c8f79aa13cc56baab8db1
|
||||
revision: f92f44110e87bad5ff168335c36da6f6053036e6
|
||||
channel: stable
|
||||
|
||||
project_type: app
|
||||
|
@ -13,17 +13,11 @@ project_type: app
|
|||
migration:
|
||||
platforms:
|
||||
- platform: root
|
||||
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
|
||||
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
|
||||
- platform: linux
|
||||
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
|
||||
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
|
||||
create_revision: f92f44110e87bad5ff168335c36da6f6053036e6
|
||||
base_revision: f92f44110e87bad5ff168335c36da6f6053036e6
|
||||
- platform: macos
|
||||
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
|
||||
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
|
||||
- platform: windows
|
||||
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
|
||||
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
|
||||
create_revision: f92f44110e87bad5ff168335c36da6f6053036e6
|
||||
base_revision: f92f44110e87bad5ff168335c36da6f6053036e6
|
||||
|
||||
# User provided section
|
||||
|
||||
|
|
BIN
assets/icon/macos-icon.png
Normal file
After Width: | Height: | Size: 15 KiB |
3
assets/svg/monkey.svg
Normal file
|
@ -0,0 +1,3 @@
|
|||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M6.32099 5.11654C6.36635 4.1732 5.61228 3.38665 4.66934 3.38665H4.33832C3.26477 3.38665 2.34238 4.25531 2.34238 5.35395V13.0533C2.34238 15.0164 3.93487 16.6089 5.89793 16.6089H6.38407L6.39773 16.1229L6.42638 15.1044L6.42658 15.1044V15.0904C6.42658 12.5838 8.06723 10.4614 10.3343 9.74146C11.2194 10.8231 12.5669 11.5163 14.0747 11.5163C14.341 11.5163 14.5977 11.4793 14.8307 11.4349L17.2447 13.7633L17.2463 13.7649C18.1535 14.6318 18.6673 15.8317 18.6673 17.0892V17.1274C18.6673 17.4146 18.436 17.6459 18.1488 17.6459C17.8616 17.6459 17.6303 17.4146 17.6303 17.1274V17.0892C17.6303 16.1162 17.2343 15.1861 16.5298 14.5151L14.4197 12.5036L13.5747 11.6981V12.8655V16.1089V16.6089H14.0747H15.0932C15.3805 16.6089 15.6118 16.8402 15.6118 17.1274C15.6118 17.4146 15.3805 17.6459 15.0932 17.6459H5.92658C3.38996 17.6459 1.33398 15.5908 1.33398 13.0533V5.35395C1.33398 3.6952 2.67931 2.34962 4.33832 2.34962H4.66934C6.20478 2.34962 7.42841 3.6318 7.35595 5.16484L7.35592 5.16564C7.29694 6.45768 6.32086 7.52368 5.03701 7.70095L5.03698 7.70076L5.0232 7.70306L4.97418 7.71122C4.69124 7.74677 4.43295 7.54849 4.39441 7.26866C4.35516 6.98361 4.55436 6.72184 4.83595 6.68323L4.83596 6.68333L4.84599 6.68174L4.90097 6.67306C5.6898 6.56499 6.28431 5.90776 6.32099 5.11654ZM6.32099 5.11654C6.32098 5.11674 6.32097 5.11695 6.32096 5.11715L5.82154 5.09295L6.32101 5.11592C6.321 5.11612 6.32099 5.11633 6.32099 5.11654ZM11.4399 7.74158L11.3069 7.46881L11.0036 7.46089C10.1647 7.43901 9.48213 6.76462 9.48213 5.92368C9.48213 5.07034 10.1733 4.38712 10.9908 4.38665L11.308 4.38646C11.1303 4.68787 11.0284 5.03924 11.0284 5.41442C11.0284 6.26965 11.5569 6.99893 12.3044 7.29712C12.3563 8.22999 13.1288 8.96998 14.0747 8.96998C15.0206 8.96998 15.7931 8.22999 15.8451 7.29712C16.5926 6.99893 17.121 6.26965 17.121 5.41442C17.121 5.03925 17.0191 4.68789 16.8415 4.38648L17.13 4.38665C17.9808 4.38713 18.6673 5.07495 18.6673 5.92368C18.6673 6.76031 17.9892 7.43872 17.1176 7.46088L16.7929 7.46914L16.6685 7.76911C16.247 8.78503 15.2445 9.49776 14.0747 9.49776C13.2838 9.49776 12.5655 9.16901 12.0541 8.64197C11.812 8.38874 11.6082 8.08661 11.4399 7.74158ZM13.0562 3.38665C12.3341 3.38665 11.6999 3.76432 11.3406 4.33302L11.4483 4.08766C11.8986 3.0621 12.9068 2.34961 14.0747 2.34961C15.2444 2.34961 16.2469 3.06287 16.6685 4.07834L16.7212 4.20536C16.3516 3.7085 15.7599 3.38665 15.0932 3.38665H13.0562ZM13.0469 5.41442C13.0469 5.41314 13.0471 5.41269 13.0473 5.4122C13.0477 5.41135 13.0485 5.40988 13.0501 5.40831C13.0517 5.40674 13.0531 5.4059 13.054 5.40554C13.0542 5.40545 13.0544 5.40538 13.0546 5.40531C13.055 5.40522 13.0555 5.40517 13.0562 5.40517C13.0575 5.40517 13.0579 5.40533 13.0584 5.40554C13.0593 5.4059 13.0607 5.40674 13.0623 5.40831C13.0639 5.40988 13.0647 5.41135 13.0651 5.4122C13.0653 5.41269 13.0655 5.41314 13.0655 5.41442C13.0655 5.415 13.0654 5.41541 13.0654 5.41573C13.0653 5.41612 13.0652 5.41638 13.0651 5.41665C13.0647 5.41749 13.0639 5.41897 13.0623 5.42054C13.0607 5.4221 13.0593 5.42295 13.0584 5.42331C13.0579 5.42352 13.0575 5.42368 13.0562 5.42368C13.0556 5.42368 13.0551 5.42364 13.0548 5.42358C13.0545 5.42351 13.0542 5.42341 13.054 5.42331C13.0531 5.42295 13.0517 5.4221 13.0501 5.42054C13.0485 5.41897 13.0477 5.41749 13.0473 5.41665C13.0471 5.41616 13.0469 5.41571 13.0469 5.41442ZM15.1025 5.41442C15.1025 5.41571 15.1023 5.41616 15.1021 5.41665C15.1018 5.41749 15.1009 5.41897 15.0994 5.42054C15.0978 5.4221 15.0963 5.42295 15.0955 5.42331C15.095 5.42352 15.0945 5.42368 15.0932 5.42368C15.092 5.42368 15.0915 5.42352 15.091 5.42331C15.0902 5.42295 15.0887 5.4221 15.0871 5.42054C15.0856 5.41897 15.0847 5.41749 15.0844 5.41665C15.0843 5.41643 15.0842 5.41621 15.0841 5.41592C15.084 5.41557 15.084 5.41512 15.084 5.41442C15.084 5.41314 15.0842 5.41269 15.0844 5.4122C15.0845 5.41178 15.0848 5.41121 15.0853 5.41054C15.0857 5.40987 15.0863 5.4091 15.0871 5.40831C15.0887 5.40674 15.0902 5.4059 15.091 5.40554C15.0915 5.40533 15.092 5.40517 15.0932 5.40517C15.0939 5.40517 15.0943 5.4052 15.0946 5.40527C15.095 5.40534 15.0952 5.40543 15.0955 5.40554C15.0963 5.4059 15.0978 5.40674 15.0994 5.40831C15.1009 5.40988 15.1018 5.41135 15.1021 5.4122C15.1023 5.41269 15.1025 5.41314 15.1025 5.41442Z" fill="#8E9192" stroke="#8E9192"/>
|
||||
</svg>
|
After Width: | Height: | Size: 4.3 KiB |
12
assets/svg/ordinal.svg
Normal file
|
@ -0,0 +1,12 @@
|
|||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g id="ordinal">
|
||||
<path id="Rectangle 43 (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M4.99935 3.33366C4.07887 3.33366 3.33268 4.07985 3.33268 5.00033V15.0003C3.33268 15.9208 4.07887 16.667 4.99935 16.667H14.9993C15.9198 16.667 16.666 15.9208 16.666 15.0003V5.00033C16.666 4.07985 15.9198 3.33366 14.9993 3.33366H4.99935ZM1.66602 5.00033C1.66602 3.15938 3.1584 1.66699 4.99935 1.66699H14.9993C16.8403 1.66699 18.3327 3.15938 18.3327 5.00033V15.0003C18.3327 16.8413 16.8403 18.3337 14.9993 18.3337H4.99935C3.1584 18.3337 1.66602 16.8413 1.66602 15.0003V5.00033Z" fill="#8E9192"/>
|
||||
<circle id="Ellipse 76" cx="6.25" cy="6.25" r="1.25" fill="#8E9192"/>
|
||||
<g id="Vector">
|
||||
<path d="M6.89025 11.0396L5.11402 13.704C4.74482 14.2578 5.14181 14.9996 5.80739 14.9996H9.35986C10.0254 14.9996 10.4224 14.2578 10.0532 13.704L8.277 11.0396C7.94715 10.5449 7.2201 10.5449 6.89025 11.0396Z" fill="#8E9192"/>
|
||||
<path d="M10.5883 8.15695L7.76997 13.7936C7.49292 14.3476 7.89584 14.9996 8.51532 14.9996H14.1519C14.7714 14.9996 15.1743 14.3476 14.8973 13.7936L12.079 8.15694C11.7719 7.54274 10.8954 7.54274 10.5883 8.15695Z" fill="#8E9192"/>
|
||||
<path d="M6.89025 11.0396L5.11402 13.704C4.74482 14.2578 5.14181 14.9996 5.80739 14.9996H9.35986C10.0254 14.9996 10.4224 14.2578 10.0532 13.704L8.277 11.0396C7.94715 10.5449 7.2201 10.5449 6.89025 11.0396Z" stroke="#8E9192"/>
|
||||
<path d="M10.5883 8.15695L7.76997 13.7936C7.49292 14.3476 7.89584 14.9996 8.51532 14.9996H14.1519C14.7714 14.9996 15.1743 14.3476 14.8973 13.7936L12.079 8.15694C11.7719 7.54274 10.8954 7.54274 10.5883 8.15695Z" stroke="#8E9192"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.7 KiB |
5
assets/svg/send.svg
Normal file
|
@ -0,0 +1,5 @@
|
|||
<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g id="send">
|
||||
<path id="Vector" d="M9.16537 4.9832C9.16537 5.1919 9.04104 5.3807 8.84889 5.46272L1.55925 8.60772C1.49302 8.63625 1.4232 8.65001 1.35397 8.65001C1.21334 8.65001 1.07532 8.59295 0.974398 8.48615C0.824086 8.32692 0.789503 8.09076 0.887266 7.89478L2.08827 5.49311L6.03562 4.99794L2.08801 4.50221L0.887005 2.10053C0.789292 1.90488 0.823936 1.66862 0.974235 1.50949C1.12505 1.35026 1.35837 1.30161 1.55908 1.38797L8.86373 4.51851C9.05612 4.60004 9.16537 4.78917 9.16537 4.9832Z" fill="white"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 612 B |
|
@ -1 +1 @@
|
|||
Subproject commit cd12741de19e4faef39a23b7d543a2452524990a
|
||||
Subproject commit f677dec0b34d3f9fe8fce2bc8ff5c508c3f3bb9a
|
|
@ -1 +1 @@
|
|||
Subproject commit ec3cf5e8e1b90e006188aa8c323d4cd52dbfa9b9
|
||||
Subproject commit 9cd241b5ea142e21c01dd7639b42603281c43287
|
|
@ -1 +1 @@
|
|||
Subproject commit 26a152fea3ca4b8c3f1130392a02f579c2ff218c
|
||||
Subproject commit 407425c9fcf7a30c81f1345246c7225bc18b5cd5
|
|
@ -1,17 +0,0 @@
|
|||
FROM ubuntu:20.04 as base
|
||||
COPY . /stack_wallet
|
||||
WORKDIR /stack_wallet/scripts/linux
|
||||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y git=1:2.25.1-1ubuntu3.6 make=4.2.1-1.2 curl=7.68.0-1ubuntu2.14 cargo=0.62.0ubuntu0libgit2-0ubuntu0.20.04.1 \
|
||||
file=1:5.38-4 ca-certificates=20211016ubuntu0.20.04.1 cmake=3.16.3-1ubuntu1.20.04.1 cmake-data=3.16.3-1ubuntu1.20.04.1 g++=4:9.3.0-1ubuntu2 libgmp-dev=2:6.2.0+dfsg-4ubuntu0.1 libssl-dev=1.1.1f-1ubuntu2.16 \
|
||||
libclang-dev=1:10.0-50~exp1 unzip=6.0-25ubuntu1.1 python3=3.8.2-0ubuntu2 pkg-config=0.29.1-0ubuntu4 libglib2.0-dev=2.64.6-1~ubuntu20.04.4 libgcrypt20-dev=1.8.5-5ubuntu1.1 gettext-base=0.19.8.1-10build1 \
|
||||
libgirepository1.0-dev=1.64.1-1~ubuntu20.04.1 valac=0.48.6-0ubuntu1 xsltproc=1.1.34-4ubuntu0.20.04.1 docbook-xsl=1.79.1+dfsg-2 python3-pip=20.0.2-5ubuntu1.6 ninja-build=1.10.0-1build1 clang=1:10.0-50~exp1 \
|
||||
libgtk-3-dev=3.24.20-0ubuntu1.1 libunbound-dev=1.9.4-2ubuntu1.4 libzmq3-dev=4.3.2-2ubuntu1 libtool=2.4.6-14 autoconf=2.69-11.1 automake=1:1.16.1-4ubuntu6 bison=2:3.5.1+dfsg-1 \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& pip3 install --upgrade meson==0.64.1 markdown==3.4.1 markupsafe==2.1.1 jinja2==3.1.2 pygments==2.13.0 toml==0.10.2 typogrify==2.0.7 tomli==2.0.1 && cd .. && ./prebuild.sh && cd linux && ./build_all.sh
|
||||
WORKDIR /
|
||||
RUN git clone https://github.com/flutter/flutter.git -b 3.3.4
|
||||
ENV PATH "$PATH:/flutter/bin"
|
||||
WORKDIR /stack_wallet
|
||||
RUN flutter pub get Linux && flutter build linux
|
||||
ENTRYPOINT ["/bin/bash"]
|
|
@ -177,6 +177,9 @@ class DB {
|
|||
}
|
||||
|
||||
Future<Box<dynamic>> getTxCacheBox({required Coin coin}) async {
|
||||
if (_txCacheBoxes[coin]?.isOpen != true) {
|
||||
_txCacheBoxes.remove(coin);
|
||||
}
|
||||
return _txCacheBoxes[coin] ??=
|
||||
await Hive.openBox<dynamic>(_boxNameTxCache(coin: coin));
|
||||
}
|
||||
|
@ -186,6 +189,9 @@ class DB {
|
|||
}
|
||||
|
||||
Future<Box<dynamic>> getAnonymitySetCacheBox({required Coin coin}) async {
|
||||
if (_setCacheBoxes[coin]?.isOpen != true) {
|
||||
_setCacheBoxes.remove(coin);
|
||||
}
|
||||
return _setCacheBoxes[coin] ??=
|
||||
await Hive.openBox<dynamic>(_boxNameSetCache(coin: coin));
|
||||
}
|
||||
|
@ -195,6 +201,9 @@ class DB {
|
|||
}
|
||||
|
||||
Future<Box<dynamic>> getUsedSerialsCacheBox({required Coin coin}) async {
|
||||
if (_usedSerialsCacheBoxes[coin]?.isOpen != true) {
|
||||
_usedSerialsCacheBoxes.remove(coin);
|
||||
}
|
||||
return _usedSerialsCacheBoxes[coin] ??=
|
||||
await Hive.openBox<dynamic>(_boxNameUsedSerialsCache(coin: coin));
|
||||
}
|
||||
|
@ -265,8 +274,12 @@ class DB {
|
|||
{required dynamic key, required String boxName}) async =>
|
||||
await mutex.protect(() async => await Hive.box<T>(boxName).delete(key));
|
||||
|
||||
Future<void> deleteAll<T>({required String boxName}) async =>
|
||||
await mutex.protect(() async => await Hive.box<T>(boxName).clear());
|
||||
Future<void> deleteAll<T>({required String boxName}) async {
|
||||
await mutex.protect(() async {
|
||||
final box = await Hive.openBox<T>(boxName);
|
||||
await box.clear();
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> deleteBoxFromDisk({required String boxName}) async =>
|
||||
await mutex.protect(() async => await Hive.deleteBoxFromDisk(boxName));
|
||||
|
|
|
@ -15,6 +15,7 @@ import 'package:stackwallet/exceptions/main_db/main_db_exception.dart';
|
|||
import 'package:stackwallet/models/isar/models/block_explorer.dart';
|
||||
import 'package:stackwallet/models/isar/models/contact_entry.dart';
|
||||
import 'package:stackwallet/models/isar/models/isar_models.dart';
|
||||
import 'package:stackwallet/models/isar/ordinal.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
|
@ -54,6 +55,8 @@ class MainDB {
|
|||
TransactionBlockExplorerSchema,
|
||||
StackThemeSchema,
|
||||
ContactEntrySchema,
|
||||
OrdinalSchema,
|
||||
LelantusCoinSchema,
|
||||
],
|
||||
directory: (await StackFileSystem.applicationIsarDirectory()).path,
|
||||
// inspector: kDebugMode,
|
||||
|
@ -246,7 +249,8 @@ class MainDB {
|
|||
await isar.utxos.putAll(utxos);
|
||||
});
|
||||
|
||||
Future<void> updateUTXOs(String walletId, List<UTXO> utxos) async {
|
||||
Future<bool> updateUTXOs(String walletId, List<UTXO> utxos) async {
|
||||
bool newUTXO = false;
|
||||
await isar.writeTxn(() async {
|
||||
final set = utxos.toSet();
|
||||
for (final utxo in utxos) {
|
||||
|
@ -268,12 +272,16 @@ class MainDB {
|
|||
blockHash: utxo.blockHash,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
newUTXO = true;
|
||||
}
|
||||
}
|
||||
|
||||
await isar.utxos.where().walletIdEqualTo(walletId).deleteAll();
|
||||
await isar.utxos.putAll(set.toList());
|
||||
});
|
||||
|
||||
return newUTXO;
|
||||
}
|
||||
|
||||
Stream<UTXO?> watchUTXO({
|
||||
|
@ -370,6 +378,8 @@ class MainDB {
|
|||
final transactionCount = await getTransactions(walletId).count();
|
||||
final addressCount = await getAddresses(walletId).count();
|
||||
final utxoCount = await getUTXOs(walletId).count();
|
||||
final lelantusCoinCount =
|
||||
await isar.lelantusCoins.where().walletIdEqualTo(walletId).count();
|
||||
|
||||
await isar.writeTxn(() async {
|
||||
const paginateLimit = 50;
|
||||
|
@ -403,6 +413,18 @@ class MainDB {
|
|||
.findAll();
|
||||
await isar.utxos.deleteAll(utxoIds);
|
||||
}
|
||||
|
||||
// lelantusCoins
|
||||
for (int i = 0; i < lelantusCoinCount; i += paginateLimit) {
|
||||
final lelantusCoinIds = await isar.lelantusCoins
|
||||
.where()
|
||||
.walletIdEqualTo(walletId)
|
||||
.offset(i)
|
||||
.limit(paginateLimit)
|
||||
.idProperty()
|
||||
.findAll();
|
||||
await isar.lelantusCoins.deleteAll(lelantusCoinIds);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -497,4 +519,15 @@ class MainDB {
|
|||
isar.writeTxn(() async {
|
||||
await isar.ethContracts.putAll(contracts);
|
||||
});
|
||||
|
||||
// ========== Lelantus =======================================================
|
||||
|
||||
Future<int?> getHighestUsedMintIndex({required String walletId}) async {
|
||||
return await isar.lelantusCoins
|
||||
.where()
|
||||
.walletIdEqualTo(walletId)
|
||||
.sortByMintIndexDesc()
|
||||
.mintIndexProperty()
|
||||
.findFirst();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ class EthTokenTxExtraDTO {
|
|||
),
|
||||
gas: _amountFromJsonNum(map['gas']),
|
||||
gasPrice: _amountFromJsonNum(map['gasPrice']),
|
||||
nonce: map['nonce'] as int,
|
||||
nonce: map['nonce'] as int?,
|
||||
input: map['input'] as String,
|
||||
gasCost: _amountFromJsonNum(map['gasCost']),
|
||||
gasUsed: _amountFromJsonNum(map['gasUsed']),
|
||||
|
@ -63,7 +63,7 @@ class EthTokenTxExtraDTO {
|
|||
final Amount gas;
|
||||
final Amount gasPrice;
|
||||
final String input;
|
||||
final int nonce;
|
||||
final int? nonce;
|
||||
final Amount gasCost;
|
||||
final Amount gasUsed;
|
||||
|
||||
|
|
|
@ -127,16 +127,16 @@ class EthTxDTO {
|
|||
map['timestamp'] = timestamp;
|
||||
map['from'] = from;
|
||||
map['to'] = to;
|
||||
map['value'] = value;
|
||||
map['gas'] = gas;
|
||||
map['gasPrice'] = gasPrice;
|
||||
map['maxFeePerGas'] = maxFeePerGas;
|
||||
map['maxPriorityFeePerGas'] = maxPriorityFeePerGas;
|
||||
map['value'] = value.toString();
|
||||
map['gas'] = gas.toString();
|
||||
map['gasPrice'] = gasPrice.toString();
|
||||
map['maxFeePerGas'] = maxFeePerGas.toString();
|
||||
map['maxPriorityFeePerGas'] = maxPriorityFeePerGas.toString();
|
||||
map['isError'] = isError;
|
||||
map['hasToken'] = hasToken;
|
||||
map['compressedTx'] = compressedTx;
|
||||
map['gasCost'] = gasCost;
|
||||
map['gasUsed'] = gasUsed;
|
||||
map['gasCost'] = gasCost.toString();
|
||||
map['gasUsed'] = gasUsed.toString();
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
39
lib/dto/ordinals/address_inscription_response.dart
Normal file
|
@ -0,0 +1,39 @@
|
|||
import 'package:stackwallet/dto/ordinals/litescribe_response.dart';
|
||||
import 'package:stackwallet/dto/ordinals/inscription_data.dart';
|
||||
|
||||
class AddressInscriptionResponse extends LitescribeResponse<AddressInscriptionResponse> {
|
||||
final int status;
|
||||
final String message;
|
||||
final AddressInscriptionResult result;
|
||||
|
||||
AddressInscriptionResponse({
|
||||
required this.status,
|
||||
required this.message,
|
||||
required this.result,
|
||||
});
|
||||
|
||||
factory AddressInscriptionResponse.fromJson(Map<String, dynamic> json) {
|
||||
return AddressInscriptionResponse(
|
||||
status: json['status'] as int,
|
||||
message: json['message'] as String,
|
||||
result: AddressInscriptionResult.fromJson(json['result'] as Map<String, dynamic>),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AddressInscriptionResult {
|
||||
final List<InscriptionData> list;
|
||||
final int total;
|
||||
|
||||
AddressInscriptionResult({
|
||||
required this.list,
|
||||
required this.total,
|
||||
});
|
||||
|
||||
factory AddressInscriptionResult.fromJson(Map<String, dynamic> json) {
|
||||
return AddressInscriptionResult(
|
||||
list: (json['list'] as List).map((item) => InscriptionData.fromJson(item as Map<String, dynamic>)).toList(),
|
||||
total: json['total'] as int,
|
||||
);
|
||||
}
|
||||
}
|
73
lib/dto/ordinals/inscription_data.dart
Normal file
|
@ -0,0 +1,73 @@
|
|||
// inscription data from litescribe /address/inscriptions endpoint
|
||||
class InscriptionData {
|
||||
final String inscriptionId;
|
||||
final int inscriptionNumber;
|
||||
final String address;
|
||||
final String preview;
|
||||
final String content;
|
||||
final int contentLength;
|
||||
final String contentType;
|
||||
final String contentBody;
|
||||
final int timestamp;
|
||||
final String genesisTransaction;
|
||||
final String location;
|
||||
final String output;
|
||||
final int outputValue;
|
||||
final int offset;
|
||||
|
||||
InscriptionData({
|
||||
required this.inscriptionId,
|
||||
required this.inscriptionNumber,
|
||||
required this.address,
|
||||
required this.preview,
|
||||
required this.content,
|
||||
required this.contentLength,
|
||||
required this.contentType,
|
||||
required this.contentBody,
|
||||
required this.timestamp,
|
||||
required this.genesisTransaction,
|
||||
required this.location,
|
||||
required this.output,
|
||||
required this.outputValue,
|
||||
required this.offset,
|
||||
});
|
||||
|
||||
factory InscriptionData.fromJson(Map<String, dynamic> json) {
|
||||
return InscriptionData(
|
||||
inscriptionId: json['inscriptionId'] as String,
|
||||
inscriptionNumber: json['inscriptionNumber'] as int,
|
||||
address: json['address'] as String,
|
||||
preview: json['preview'] as String,
|
||||
content: json['content'] as String,
|
||||
contentLength: json['contentLength'] as int,
|
||||
contentType: json['contentType'] as String,
|
||||
contentBody: json['contentBody'] as String,
|
||||
timestamp: json['timestamp'] as int,
|
||||
genesisTransaction: json['genesisTransaction'] as String,
|
||||
location: json['location'] as String,
|
||||
output: json['output'] as String,
|
||||
outputValue: json['outputValue'] as int,
|
||||
offset: json['offset'] as int,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'InscriptionData {'
|
||||
' inscriptionId: $inscriptionId,'
|
||||
' inscriptionNumber: $inscriptionNumber,'
|
||||
' address: $address,'
|
||||
' preview: $preview,'
|
||||
' content: $content,'
|
||||
' contentLength: $contentLength,'
|
||||
' contentType: $contentType,'
|
||||
' contentBody: $contentBody,'
|
||||
' timestamp: $timestamp,'
|
||||
' genesisTransaction: $genesisTransaction,'
|
||||
' location: $location,'
|
||||
' output: $output,'
|
||||
' outputValue: $outputValue,'
|
||||
' offset: $offset'
|
||||
' }';
|
||||
}
|
||||
}
|
6
lib/dto/ordinals/litescribe_response.dart
Normal file
|
@ -0,0 +1,6 @@
|
|||
class LitescribeResponse<T> {
|
||||
final T? data;
|
||||
final String? error;
|
||||
|
||||
LitescribeResponse({this.data, this.error});
|
||||
}
|
|
@ -164,14 +164,16 @@ class CachedElectrumX {
|
|||
|
||||
final _list = box.get("serials") as List?;
|
||||
|
||||
List<String> cachedSerials =
|
||||
_list == null ? [] : List<String>.from(_list);
|
||||
Set<String> cachedSerials =
|
||||
_list == null ? {} : List<String>.from(_list).toSet();
|
||||
|
||||
final startNumber = cachedSerials.length;
|
||||
// startNumber is broken currently
|
||||
final startNumber = 0; // cachedSerials.length;
|
||||
|
||||
final serials =
|
||||
await electrumXClient.getUsedCoinSerials(startNumber: startNumber);
|
||||
List<String> newSerials = [];
|
||||
final serials = await electrumXClient.getUsedCoinSerials(
|
||||
startNumber: startNumber,
|
||||
);
|
||||
Set<String> newSerials = {};
|
||||
|
||||
for (final element in (serials["serials"] as List)) {
|
||||
if (!isHexadecimal(element as String)) {
|
||||
|
@ -182,12 +184,14 @@ class CachedElectrumX {
|
|||
}
|
||||
cachedSerials.addAll(newSerials);
|
||||
|
||||
final resultingList = cachedSerials.toList();
|
||||
|
||||
await box.put(
|
||||
"serials",
|
||||
cachedSerials,
|
||||
resultingList,
|
||||
);
|
||||
|
||||
return cachedSerials;
|
||||
return resultingList;
|
||||
} catch (e, s) {
|
||||
Logging.instance.log(
|
||||
"Failed to process CachedElectrumX.getTransaction(): $e\n$s",
|
||||
|
|
|
@ -159,8 +159,8 @@ class ElectrumX {
|
|||
throw Exception(
|
||||
"JSONRPC response\n"
|
||||
" command: $command\n"
|
||||
" args: $args\n"
|
||||
" error: ${response.data}",
|
||||
" error: ${response.data}"
|
||||
" args: $args\n",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ class JsonRPC {
|
|||
|
||||
// TODO different timeout length?
|
||||
req.initiateTimeout(
|
||||
const Duration(seconds: 10),
|
||||
Duration(seconds: connectionTimeout.inSeconds ~/ 2),
|
||||
onTimedOut: () {
|
||||
_requestQueue.remove(req);
|
||||
},
|
||||
|
|
81
lib/models/isar/models/firo_specific/lelantus_coin.dart
Normal file
|
@ -0,0 +1,81 @@
|
|||
import 'package:isar/isar.dart';
|
||||
|
||||
part 'lelantus_coin.g.dart';
|
||||
|
||||
@collection
|
||||
class LelantusCoin {
|
||||
Id id = Isar.autoIncrement;
|
||||
|
||||
@Index()
|
||||
final String walletId;
|
||||
|
||||
final String txid;
|
||||
|
||||
final String value; // can't use BigInt in isar :shrug:
|
||||
|
||||
@Index(
|
||||
unique: true,
|
||||
replace: false,
|
||||
composite: [
|
||||
CompositeIndex("walletId"),
|
||||
],
|
||||
)
|
||||
final int mintIndex;
|
||||
|
||||
final int anonymitySetId;
|
||||
|
||||
final bool isUsed;
|
||||
|
||||
final bool isJMint;
|
||||
|
||||
final String? otherData;
|
||||
|
||||
LelantusCoin({
|
||||
required this.walletId,
|
||||
required this.txid,
|
||||
required this.value,
|
||||
required this.mintIndex,
|
||||
required this.anonymitySetId,
|
||||
required this.isUsed,
|
||||
required this.isJMint,
|
||||
required this.otherData,
|
||||
});
|
||||
|
||||
LelantusCoin copyWith({
|
||||
String? walletId,
|
||||
String? publicCoin,
|
||||
String? txid,
|
||||
String? value,
|
||||
int? mintIndex,
|
||||
int? anonymitySetId,
|
||||
bool? isUsed,
|
||||
bool? isJMint,
|
||||
String? otherData,
|
||||
}) {
|
||||
return LelantusCoin(
|
||||
walletId: walletId ?? this.walletId,
|
||||
txid: txid ?? this.txid,
|
||||
value: value ?? this.value,
|
||||
mintIndex: mintIndex ?? this.mintIndex,
|
||||
anonymitySetId: anonymitySetId ?? this.anonymitySetId,
|
||||
isUsed: isUsed ?? this.isUsed,
|
||||
isJMint: isJMint ?? this.isJMint,
|
||||
otherData: otherData ?? this.otherData,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LelantusCoin{'
|
||||
'id: $id, '
|
||||
'walletId: $walletId, '
|
||||
'txid: $txid, '
|
||||
'value: $value, '
|
||||
'mintIndex: $mintIndex, '
|
||||
'anonymitySetId: $anonymitySetId, '
|
||||
'otherData: $otherData, '
|
||||
'isJMint: $isJMint, '
|
||||
'isUsed: $isUsed'
|
||||
'}';
|
||||
}
|
||||
}
|
1629
lib/models/isar/models/firo_specific/lelantus_coin.g.dart
Normal file
|
@ -15,5 +15,6 @@ export 'blockchain_data/output.dart';
|
|||
export 'blockchain_data/transaction.dart';
|
||||
export 'blockchain_data/utxo.dart';
|
||||
export 'ethereum/eth_contract.dart';
|
||||
export 'firo_specific/lelantus_coin.dart';
|
||||
export 'log.dart';
|
||||
export 'transaction_note.dart';
|
||||
|
|
89
lib/models/isar/ordinal.dart
Normal file
|
@ -0,0 +1,89 @@
|
|||
import 'package:isar/isar.dart';
|
||||
import 'package:stackwallet/db/isar/main_db.dart';
|
||||
import 'package:stackwallet/dto/ordinals/inscription_data.dart';
|
||||
import 'package:stackwallet/models/isar/models/isar_models.dart';
|
||||
|
||||
part 'ordinal.g.dart';
|
||||
|
||||
@collection
|
||||
class Ordinal {
|
||||
Id id = Isar.autoIncrement;
|
||||
|
||||
final String walletId;
|
||||
|
||||
@Index(unique: true, replace: true, composite: [
|
||||
CompositeIndex("utxoTXID"),
|
||||
CompositeIndex("utxoVOUT"),
|
||||
])
|
||||
final String inscriptionId;
|
||||
|
||||
final int inscriptionNumber;
|
||||
|
||||
final String content;
|
||||
|
||||
// following two are used to look up the UTXO object in isar combined w/ walletId
|
||||
final String utxoTXID;
|
||||
final int utxoVOUT;
|
||||
|
||||
Ordinal({
|
||||
required this.walletId,
|
||||
required this.inscriptionId,
|
||||
required this.inscriptionNumber,
|
||||
required this.content,
|
||||
required this.utxoTXID,
|
||||
required this.utxoVOUT,
|
||||
});
|
||||
|
||||
factory Ordinal.fromInscriptionData(InscriptionData data, String walletId) {
|
||||
return Ordinal(
|
||||
walletId: walletId,
|
||||
inscriptionId: data.inscriptionId,
|
||||
inscriptionNumber: data.inscriptionNumber,
|
||||
content: data.content,
|
||||
utxoTXID: data.output.split(':')[
|
||||
0], // "output": "062f32e21aa04246b8873b5d9a929576addd0339881e1ea478b406795d6b6c47:0"
|
||||
utxoVOUT: int.parse(data.output.split(':')[1]),
|
||||
);
|
||||
}
|
||||
|
||||
Ordinal copyWith({
|
||||
String? walletId,
|
||||
String? inscriptionId,
|
||||
int? inscriptionNumber,
|
||||
String? content,
|
||||
String? utxoTXID,
|
||||
int? utxoVOUT,
|
||||
}) {
|
||||
return Ordinal(
|
||||
walletId: walletId ?? this.walletId,
|
||||
inscriptionId: inscriptionId ?? this.inscriptionId,
|
||||
inscriptionNumber: inscriptionNumber ?? this.inscriptionNumber,
|
||||
content: content ?? this.content,
|
||||
utxoTXID: utxoTXID ?? this.utxoTXID,
|
||||
utxoVOUT: utxoVOUT ?? this.utxoVOUT,
|
||||
);
|
||||
}
|
||||
|
||||
UTXO? getUTXO(MainDB db) {
|
||||
return db.isar.utxos
|
||||
.where()
|
||||
.walletIdEqualTo(walletId)
|
||||
.filter()
|
||||
.txidEqualTo(utxoTXID)
|
||||
.and()
|
||||
.voutEqualTo(utxoVOUT)
|
||||
.findFirstSync();
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Ordinal {'
|
||||
' walletId: $walletId,'
|
||||
' inscriptionId: $inscriptionId,'
|
||||
' inscriptionNumber: $inscriptionNumber,'
|
||||
' content: $content,'
|
||||
' utxoTXID: $utxoTXID,'
|
||||
' utxoVOUT: $utxoVOUT'
|
||||
' }';
|
||||
}
|
||||
}
|
1489
lib/models/isar/ordinal.g.dart
Normal file
|
@ -2350,8 +2350,6 @@ class ThemeAssetsV3 implements IThemeAssets {
|
|||
|
||||
// Added some future proof params in case we want to add anything else
|
||||
// This should provide some buffer in stead of creating assetsV4 etc
|
||||
@Name("otherStringParam1")
|
||||
late final String? dummy1;
|
||||
@Name("otherStringParam2")
|
||||
late final String? dummy2;
|
||||
@Name("otherStringParam3")
|
||||
|
@ -2397,6 +2395,19 @@ class ThemeAssetsV3 implements IThemeAssets {
|
|||
Map<Coin, String>? _coinCardImages;
|
||||
late final String? coinCardImagesString;
|
||||
|
||||
@ignore
|
||||
Map<Coin, String>? get coinCardFavoritesImages =>
|
||||
_coinCardFavoritesImages ??= coinCardFavoritesImagesString == null
|
||||
? null
|
||||
: parseCoinAssetsString(
|
||||
coinCardFavoritesImagesString!,
|
||||
placeHolder: coinPlaceholder,
|
||||
);
|
||||
@ignore
|
||||
Map<Coin, String>? _coinCardFavoritesImages;
|
||||
@Name("otherStringParam1")
|
||||
late final String? coinCardFavoritesImagesString;
|
||||
|
||||
ThemeAssetsV3();
|
||||
|
||||
factory ThemeAssetsV3.fromJson({
|
||||
|
@ -2452,13 +2463,18 @@ class ThemeAssetsV3 implements IThemeAssets {
|
|||
Map<String, dynamic>.from(json["coins"]["cards"] as Map),
|
||||
)
|
||||
: null
|
||||
..coinCardFavoritesImagesString = json["coins"]["favoriteCards"] is Map
|
||||
? createCoinAssetsString(
|
||||
"$themeId/assets",
|
||||
Map<String, dynamic>.from(json["coins"]["favoriteCards"] as Map),
|
||||
)
|
||||
: null
|
||||
..loadingGifRelative = json["loading_gif"] is String
|
||||
? "$themeId/assets/${json["loading_gif"] as String}"
|
||||
: null
|
||||
..backgroundRelative = json["background"] is String
|
||||
? "$themeId/assets/${json["background"] as String}"
|
||||
: null
|
||||
..dummy1 = null
|
||||
..dummy2 = null
|
||||
..dummy3 = null;
|
||||
}
|
||||
|
@ -2537,6 +2553,7 @@ class ThemeAssetsV3 implements IThemeAssets {
|
|||
'coinImages: $coinImages, '
|
||||
'coinSecondaryImages: $coinSecondaryImages, '
|
||||
'coinCardImages: $coinCardImages'
|
||||
'coinCardFavoritesImages: $coinCardFavoritesImages'
|
||||
')';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29626,7 +29626,7 @@ int _themeAssetsV3EstimateSize(
|
|||
}
|
||||
}
|
||||
{
|
||||
final value = object.dummy1;
|
||||
final value = object.coinCardFavoritesImagesString;
|
||||
if (value != null) {
|
||||
bytesCount += 3 + value.length * 3;
|
||||
}
|
||||
|
@ -29677,7 +29677,7 @@ void _themeAssetsV3Serialize(
|
|||
writer.writeString(offsets[7], object.coinSecondaryImagesString);
|
||||
writer.writeString(offsets[8], object.exchangeRelative);
|
||||
writer.writeString(offsets[9], object.loadingGifRelative);
|
||||
writer.writeString(offsets[10], object.dummy1);
|
||||
writer.writeString(offsets[10], object.coinCardFavoritesImagesString);
|
||||
writer.writeString(offsets[11], object.dummy2);
|
||||
writer.writeString(offsets[12], object.dummy3);
|
||||
writer.writeString(offsets[13], object.personaEasyRelative);
|
||||
|
@ -29714,7 +29714,7 @@ ThemeAssetsV3 _themeAssetsV3Deserialize(
|
|||
object.coinSecondaryImagesString = reader.readString(offsets[7]);
|
||||
object.exchangeRelative = reader.readString(offsets[8]);
|
||||
object.loadingGifRelative = reader.readStringOrNull(offsets[9]);
|
||||
object.dummy1 = reader.readStringOrNull(offsets[10]);
|
||||
object.coinCardFavoritesImagesString = reader.readStringOrNull(offsets[10]);
|
||||
object.dummy2 = reader.readStringOrNull(offsets[11]);
|
||||
object.dummy3 = reader.readStringOrNull(offsets[12]);
|
||||
object.personaEasyRelative = reader.readString(offsets[13]);
|
||||
|
@ -31224,7 +31224,7 @@ extension ThemeAssetsV3QueryFilter
|
|||
}
|
||||
|
||||
QueryBuilder<ThemeAssetsV3, ThemeAssetsV3, QAfterFilterCondition>
|
||||
dummy1IsNull() {
|
||||
coinCardFavoritesImagesStringIsNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNull(
|
||||
property: r'otherStringParam1',
|
||||
|
@ -31233,7 +31233,7 @@ extension ThemeAssetsV3QueryFilter
|
|||
}
|
||||
|
||||
QueryBuilder<ThemeAssetsV3, ThemeAssetsV3, QAfterFilterCondition>
|
||||
dummy1IsNotNull() {
|
||||
coinCardFavoritesImagesStringIsNotNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNotNull(
|
||||
property: r'otherStringParam1',
|
||||
|
@ -31242,7 +31242,7 @@ extension ThemeAssetsV3QueryFilter
|
|||
}
|
||||
|
||||
QueryBuilder<ThemeAssetsV3, ThemeAssetsV3, QAfterFilterCondition>
|
||||
dummy1EqualTo(
|
||||
coinCardFavoritesImagesStringEqualTo(
|
||||
String? value, {
|
||||
bool caseSensitive = true,
|
||||
}) {
|
||||
|
@ -31256,7 +31256,7 @@ extension ThemeAssetsV3QueryFilter
|
|||
}
|
||||
|
||||
QueryBuilder<ThemeAssetsV3, ThemeAssetsV3, QAfterFilterCondition>
|
||||
dummy1GreaterThan(
|
||||
coinCardFavoritesImagesStringGreaterThan(
|
||||
String? value, {
|
||||
bool include = false,
|
||||
bool caseSensitive = true,
|
||||
|
@ -31272,7 +31272,7 @@ extension ThemeAssetsV3QueryFilter
|
|||
}
|
||||
|
||||
QueryBuilder<ThemeAssetsV3, ThemeAssetsV3, QAfterFilterCondition>
|
||||
dummy1LessThan(
|
||||
coinCardFavoritesImagesStringLessThan(
|
||||
String? value, {
|
||||
bool include = false,
|
||||
bool caseSensitive = true,
|
||||
|
@ -31288,7 +31288,7 @@ extension ThemeAssetsV3QueryFilter
|
|||
}
|
||||
|
||||
QueryBuilder<ThemeAssetsV3, ThemeAssetsV3, QAfterFilterCondition>
|
||||
dummy1Between(
|
||||
coinCardFavoritesImagesStringBetween(
|
||||
String? lower,
|
||||
String? upper, {
|
||||
bool includeLower = true,
|
||||
|
@ -31308,7 +31308,7 @@ extension ThemeAssetsV3QueryFilter
|
|||
}
|
||||
|
||||
QueryBuilder<ThemeAssetsV3, ThemeAssetsV3, QAfterFilterCondition>
|
||||
dummy1StartsWith(
|
||||
coinCardFavoritesImagesStringStartsWith(
|
||||
String value, {
|
||||
bool caseSensitive = true,
|
||||
}) {
|
||||
|
@ -31322,7 +31322,7 @@ extension ThemeAssetsV3QueryFilter
|
|||
}
|
||||
|
||||
QueryBuilder<ThemeAssetsV3, ThemeAssetsV3, QAfterFilterCondition>
|
||||
dummy1EndsWith(
|
||||
coinCardFavoritesImagesStringEndsWith(
|
||||
String value, {
|
||||
bool caseSensitive = true,
|
||||
}) {
|
||||
|
@ -31336,7 +31336,8 @@ extension ThemeAssetsV3QueryFilter
|
|||
}
|
||||
|
||||
QueryBuilder<ThemeAssetsV3, ThemeAssetsV3, QAfterFilterCondition>
|
||||
dummy1Contains(String value, {bool caseSensitive = true}) {
|
||||
coinCardFavoritesImagesStringContains(String value,
|
||||
{bool caseSensitive = true}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.contains(
|
||||
property: r'otherStringParam1',
|
||||
|
@ -31347,7 +31348,8 @@ extension ThemeAssetsV3QueryFilter
|
|||
}
|
||||
|
||||
QueryBuilder<ThemeAssetsV3, ThemeAssetsV3, QAfterFilterCondition>
|
||||
dummy1Matches(String pattern, {bool caseSensitive = true}) {
|
||||
coinCardFavoritesImagesStringMatches(String pattern,
|
||||
{bool caseSensitive = true}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.matches(
|
||||
property: r'otherStringParam1',
|
||||
|
@ -31358,7 +31360,7 @@ extension ThemeAssetsV3QueryFilter
|
|||
}
|
||||
|
||||
QueryBuilder<ThemeAssetsV3, ThemeAssetsV3, QAfterFilterCondition>
|
||||
dummy1IsEmpty() {
|
||||
coinCardFavoritesImagesStringIsEmpty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'otherStringParam1',
|
||||
|
@ -31368,7 +31370,7 @@ extension ThemeAssetsV3QueryFilter
|
|||
}
|
||||
|
||||
QueryBuilder<ThemeAssetsV3, ThemeAssetsV3, QAfterFilterCondition>
|
||||
dummy1IsNotEmpty() {
|
||||
coinCardFavoritesImagesStringIsNotEmpty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
||||
property: r'otherStringParam1',
|
||||
|
|
|
@ -12,6 +12,7 @@ import 'package:hive/hive.dart';
|
|||
|
||||
part 'type_adaptors/lelantus_coin.g.dart';
|
||||
|
||||
@Deprecated("Use Isar object instead")
|
||||
// @HiveType(typeId: 9)
|
||||
class LelantusCoin {
|
||||
// @HiveField(0)
|
||||
|
@ -27,6 +28,7 @@ class LelantusCoin {
|
|||
// @HiveField(5)
|
||||
bool isUsed;
|
||||
|
||||
@Deprecated("Use Isar object instead")
|
||||
LelantusCoin(
|
||||
this.index,
|
||||
this.value,
|
||||
|
|
|
@ -142,7 +142,7 @@ class _AddCustomTokenViewState extends ConsumerState<AddCustomTokenView> {
|
|||
context: context,
|
||||
message: "Looking up contract",
|
||||
);
|
||||
currentToken = response.value;
|
||||
currentToken = response!.value;
|
||||
if (currentToken != null) {
|
||||
nameController.text = currentToken!.name;
|
||||
symbolController.text = currentToken!.symbol;
|
||||
|
@ -157,7 +157,7 @@ class _AddCustomTokenViewState extends ConsumerState<AddCustomTokenView> {
|
|||
context: context,
|
||||
builder: (context) => StackOkDialog(
|
||||
title: "Failed to look up token",
|
||||
message: response.exception?.message,
|
||||
message: response!.exception?.message,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stackwallet/pages/add_wallet_views/name_your_wallet_view/name_your_wallet_view.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
|
@ -32,35 +34,37 @@ class CreateWalletButtonGroup extends StatelessWidget {
|
|||
crossAxisAlignment:
|
||||
isDesktop ? CrossAxisAlignment.center : CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
minHeight: isDesktop ? 70 : 0,
|
||||
minWidth: isDesktop ? 480 : 0,
|
||||
),
|
||||
child: TextButton(
|
||||
style: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.getPrimaryEnabledButtonStyle(context),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
NameYourWalletView.routeName,
|
||||
arguments: Tuple2(
|
||||
AddWalletType.New,
|
||||
coin,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Text(
|
||||
"Create new wallet",
|
||||
style: isDesktop
|
||||
? STextStyles.desktopButtonEnabled(context)
|
||||
: STextStyles.button(context),
|
||||
if (Platform.isAndroid || coin != Coin.wownero)
|
||||
ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
minHeight: isDesktop ? 70 : 0,
|
||||
minWidth: isDesktop ? 480 : 0,
|
||||
),
|
||||
child: TextButton(
|
||||
style: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.getPrimaryEnabledButtonStyle(context),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
NameYourWalletView.routeName,
|
||||
arguments: Tuple2(
|
||||
AddWalletType.New,
|
||||
coin,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Text(
|
||||
"Create new wallet",
|
||||
style: isDesktop
|
||||
? STextStyles.desktopButtonEnabled(context)
|
||||
: STextStyles.button(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: isDesktop ? 16 : 12,
|
||||
),
|
||||
if (Platform.isAndroid || coin != Coin.wownero)
|
||||
SizedBox(
|
||||
height: isDesktop ? 16 : 12,
|
||||
),
|
||||
ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
minHeight: isDesktop ? 70 : 0,
|
||||
|
|
|
@ -35,6 +35,7 @@ import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart
|
|||
import 'package:stackwallet/services/exchange/majestic_bank/majestic_bank_exchange.dart';
|
||||
import 'package:stackwallet/services/exchange/trocador/trocador_exchange.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount_unit.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
|
@ -160,26 +161,15 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
|
|||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
// wtf Dart?????
|
||||
// This turns "99999999999999999999" into 100000000000000000000.0
|
||||
// final numFromLocalised = NumberFormat.decimalPattern(
|
||||
// ref.read(localeServiceChangeNotifierProvider).locale)
|
||||
// .parse(value);
|
||||
// return Decimal.tryParse(numFromLocalised.toString());
|
||||
|
||||
try {
|
||||
return Decimal.parse(value);
|
||||
} catch (_) {
|
||||
try {
|
||||
return Decimal.parse(value.replaceAll(",", "."));
|
||||
} catch (_) {
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
return AmountUnit.normal
|
||||
.tryParse(
|
||||
value,
|
||||
locale: ref.read(localeServiceChangeNotifierProvider).locale,
|
||||
coin: Coin.bitcoin, // dummy value (not used due to override)
|
||||
overrideWithDecimalPlacesFromString: true,
|
||||
)
|
||||
?.decimal;
|
||||
}
|
||||
|
||||
Future<AggregateCurrency> _getAggregateCurrency(Currency currency) async {
|
||||
|
@ -809,6 +799,14 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
|
|||
// if (_swapLock) {
|
||||
_sendController.text = ref.read(efSendAmountStringProvider);
|
||||
// }
|
||||
|
||||
if (_sendFocusNode.hasFocus) {
|
||||
_sendController.selection = TextSelection.fromPosition(
|
||||
TextPosition(
|
||||
offset: _sendController.text.length,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
ref.listen(efSendAmountStringProvider, (previous, String next) {
|
||||
|
@ -820,11 +818,19 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
|
|||
? "-"
|
||||
: ref.read(efReceiveAmountStringProvider);
|
||||
// }
|
||||
|
||||
if (_receiveFocusNode.hasFocus) {
|
||||
_receiveController.selection = TextSelection.fromPosition(
|
||||
TextPosition(
|
||||
offset: _receiveController.text.length,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ref.listen(efEstimateProvider.notifier, (previous, next) {
|
||||
final estimate = (next as StateController<Estimate?>).state;
|
||||
final estimate = (next).state;
|
||||
if (ref.read(efReversedProvider)) {
|
||||
updateSend(estimate);
|
||||
} else {
|
||||
|
|
275
lib/pages/monkey/monkey_loaded_view.dart
Normal file
|
@ -0,0 +1,275 @@
|
|||
// import 'dart:io';
|
||||
// import 'dart:typed_data';
|
||||
//
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
// import 'package:flutter_svg/svg.dart';
|
||||
// import 'package:http/http.dart' as http;
|
||||
// import 'package:path_provider/path_provider.dart';
|
||||
// import 'package:permission_handler/permission_handler.dart';
|
||||
// import 'package:stackwallet/pages/wallet_view/wallet_view.dart';
|
||||
// import 'package:stackwallet/providers/global/wallets_provider.dart';
|
||||
// import 'package:stackwallet/services/coins/banano/banano_wallet.dart';
|
||||
// import 'package:stackwallet/services/coins/manager.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/text_styles.dart';
|
||||
// import 'package:stackwallet/widgets/background.dart';
|
||||
// import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
// import 'package:stackwallet/widgets/desktop/secondary_button.dart';
|
||||
//
|
||||
// class MonkeyLoadedView extends ConsumerStatefulWidget {
|
||||
// const MonkeyLoadedView({
|
||||
// Key? key,
|
||||
// required this.walletId,
|
||||
// required this.managerProvider,
|
||||
// }) : super(key: key);
|
||||
//
|
||||
// static const String routeName = "/hasMonkey";
|
||||
// static const double navBarHeight = 65.0;
|
||||
//
|
||||
// final String walletId;
|
||||
// final ChangeNotifierProvider<Manager> managerProvider;
|
||||
//
|
||||
// @override
|
||||
// ConsumerState<MonkeyLoadedView> createState() => _MonkeyLoadedViewState();
|
||||
// }
|
||||
//
|
||||
// class _MonkeyLoadedViewState extends ConsumerState<MonkeyLoadedView> {
|
||||
// late final String walletId;
|
||||
// late final ChangeNotifierProvider<Manager> managerProvider;
|
||||
//
|
||||
// String receivingAddress = "";
|
||||
//
|
||||
// void getMonkeySVG(String address) async {
|
||||
// if (address.isEmpty) {
|
||||
// //address shouldn't be empty
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// final http.Response response = await http
|
||||
// .get(Uri.parse('https://monkey.banano.cc/api/v1/monkey/$address'));
|
||||
//
|
||||
// if (response.statusCode == 200) {
|
||||
// final decodedResponse = response.bodyBytes;
|
||||
// Directory directory = await getApplicationDocumentsDirectory();
|
||||
// late Directory sampleFolder;
|
||||
//
|
||||
// if (Platform.isAndroid) {
|
||||
// directory = Directory("/storage/emulated/0/");
|
||||
// sampleFolder = Directory('${directory!.path}Documents');
|
||||
// } else if (Platform.isIOS) {
|
||||
// sampleFolder = Directory(directory!.path);
|
||||
// } else if (Platform.isLinux) {
|
||||
// sampleFolder = Directory('${directory!.path}Documents');
|
||||
// } else if (Platform.isWindows) {
|
||||
// sampleFolder = Directory('${directory!.path}Documents');
|
||||
// } else if (Platform.isMacOS) {
|
||||
// sampleFolder = Directory('${directory!.path}Documents');
|
||||
// }
|
||||
//
|
||||
// try {
|
||||
// if (!sampleFolder.existsSync()) {
|
||||
// sampleFolder.createSync(recursive: true);
|
||||
// }
|
||||
// } catch (e, s) {
|
||||
// // todo: come back to this
|
||||
// debugPrint("$e $s");
|
||||
// }
|
||||
//
|
||||
// final docPath = sampleFolder.path;
|
||||
// final filePath = "$docPath/monkey.svg";
|
||||
//
|
||||
// File imgFile = File(filePath);
|
||||
// await imgFile.writeAsBytes(decodedResponse);
|
||||
// } else {
|
||||
// throw Exception("Failed to get MonKey");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// void getMonkeyPNG(String address) async {
|
||||
// if (address.isEmpty) {
|
||||
// //address shouldn't be empty
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// final http.Response response = await http.get(Uri.parse(
|
||||
// 'https://monkey.banano.cc/api/v1/monkey/${address}?format=png&size=512&background=false'));
|
||||
//
|
||||
// if (response.statusCode == 200) {
|
||||
// if (Platform.isAndroid) {
|
||||
// await Permission.storage.request();
|
||||
// }
|
||||
//
|
||||
// final decodedResponse = response.bodyBytes;
|
||||
// Directory directory = await getApplicationDocumentsDirectory();
|
||||
// late Directory sampleFolder;
|
||||
//
|
||||
// if (Platform.isAndroid) {
|
||||
// directory = Directory("/storage/emulated/0/");
|
||||
// sampleFolder = Directory('${directory!.path}Documents');
|
||||
// } else if (Platform.isIOS) {
|
||||
// sampleFolder = Directory(directory!.path);
|
||||
// } else if (Platform.isLinux) {
|
||||
// sampleFolder = Directory('${directory!.path}Documents');
|
||||
// } else if (Platform.isWindows) {
|
||||
// sampleFolder = Directory('${directory!.path}Documents');
|
||||
// } else if (Platform.isMacOS) {
|
||||
// sampleFolder = Directory('${directory!.path}Documents');
|
||||
// }
|
||||
//
|
||||
// try {
|
||||
// if (!sampleFolder.existsSync()) {
|
||||
// sampleFolder.createSync(recursive: true);
|
||||
// }
|
||||
// } catch (e, s) {
|
||||
// // todo: come back to this
|
||||
// debugPrint("$e $s");
|
||||
// }
|
||||
//
|
||||
// final docPath = sampleFolder.path;
|
||||
// final filePath = "$docPath/monkey.png";
|
||||
//
|
||||
// File imgFile = File(filePath);
|
||||
// await imgFile.writeAsBytes(decodedResponse);
|
||||
// } else {
|
||||
// throw Exception("Failed to get MonKey");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @override
|
||||
// void initState() {
|
||||
// walletId = widget.walletId;
|
||||
// managerProvider = widget.managerProvider;
|
||||
//
|
||||
// WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
|
||||
// final address = await ref
|
||||
// .read(walletsChangeNotifierProvider)
|
||||
// .getManager(walletId)
|
||||
// .currentReceivingAddress;
|
||||
// setState(() {
|
||||
// receivingAddress = address;
|
||||
// });
|
||||
// });
|
||||
//
|
||||
// super.initState();
|
||||
// }
|
||||
//
|
||||
// @override
|
||||
// void dispose() {
|
||||
// super.dispose();
|
||||
// }
|
||||
//
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// final Coin coin = ref.watch(managerProvider.select((value) => value.coin));
|
||||
// final manager = ref.watch(walletsChangeNotifierProvider
|
||||
// .select((value) => value.getManager(widget.walletId)));
|
||||
//
|
||||
// List<int>? imageBytes;
|
||||
// imageBytes = (manager.wallet as BananoWallet).getMonkeyImageBytes();
|
||||
//
|
||||
// return Background(
|
||||
// child: Stack(
|
||||
// children: [
|
||||
// Scaffold(
|
||||
// appBar: AppBar(
|
||||
// leading: AppBarBackButton(
|
||||
// onPressed: () {
|
||||
// Navigator.of(context).popUntil(
|
||||
// ModalRoute.withName(WalletView.routeName),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// title: Text(
|
||||
// "MonKey",
|
||||
// style: STextStyles.navBarTitle(context),
|
||||
// ),
|
||||
// actions: [
|
||||
// AspectRatio(
|
||||
// aspectRatio: 1,
|
||||
// child: AppBarIconButton(
|
||||
// icon: SvgPicture.asset(Assets.svg.circleQuestion),
|
||||
// onPressed: () {
|
||||
// showDialog<dynamic>(
|
||||
// context: context,
|
||||
// useSafeArea: false,
|
||||
// barrierDismissible: true,
|
||||
// builder: (context) {
|
||||
// return Dialog(
|
||||
// child: Material(
|
||||
// borderRadius: BorderRadius.circular(
|
||||
// 20,
|
||||
// ),
|
||||
// child: Container(
|
||||
// height: 200,
|
||||
// decoration: BoxDecoration(
|
||||
// color: Theme.of(context)
|
||||
// .extension<StackColors>()!
|
||||
// .popupBG,
|
||||
// borderRadius: BorderRadius.circular(
|
||||
// 20,
|
||||
// ),
|
||||
// ),
|
||||
// child: Column(
|
||||
// children: [
|
||||
// Center(
|
||||
// child: Text(
|
||||
// "Help",
|
||||
// style: STextStyles.pageTitleH2(
|
||||
// context),
|
||||
// ),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// });
|
||||
// }),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// body: Column(
|
||||
// children: [
|
||||
// const Spacer(
|
||||
// flex: 1,
|
||||
// ),
|
||||
// if (imageBytes != null)
|
||||
// Container(
|
||||
// child: SvgPicture.memory(Uint8List.fromList(imageBytes!)),
|
||||
// width: 300,
|
||||
// height: 300,
|
||||
// ),
|
||||
// const Spacer(
|
||||
// flex: 1,
|
||||
// ),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.all(16.0),
|
||||
// child: Column(
|
||||
// children: [
|
||||
// SecondaryButton(
|
||||
// label: "Download as SVG",
|
||||
// onPressed: () async {
|
||||
// getMonkeySVG(receivingAddress);
|
||||
// },
|
||||
// ),
|
||||
// const SizedBox(height: 12),
|
||||
// SecondaryButton(
|
||||
// label: "Download as PNG",
|
||||
// onPressed: () {
|
||||
// getMonkeyPNG(receivingAddress);
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
497
lib/pages/monkey/monkey_view.dart
Normal file
|
@ -0,0 +1,497 @@
|
|||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:stackwallet/providers/global/wallets_provider.dart';
|
||||
import 'package:stackwallet/services/coins/banano/banano_wallet.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/show_loading.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/utilities/util.dart';
|
||||
import 'package:stackwallet/widgets/background.dart';
|
||||
import 'package:stackwallet/widgets/conditional_parent.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
|
||||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||
|
||||
class MonkeyView extends ConsumerStatefulWidget {
|
||||
const MonkeyView({
|
||||
Key? key,
|
||||
required this.walletId,
|
||||
}) : super(key: key);
|
||||
|
||||
static const String routeName = "/monkey";
|
||||
static const double navBarHeight = 65.0;
|
||||
|
||||
final String walletId;
|
||||
|
||||
@override
|
||||
ConsumerState<MonkeyView> createState() => _MonkeyViewState();
|
||||
}
|
||||
|
||||
class _MonkeyViewState extends ConsumerState<MonkeyView> {
|
||||
late final String walletId;
|
||||
List<int>? imageBytes;
|
||||
|
||||
String receivingAddress = "";
|
||||
|
||||
Future<void> getMonkeyImage(String address) async {
|
||||
if (address.isEmpty) {
|
||||
//address shouldn't be empty
|
||||
return;
|
||||
}
|
||||
|
||||
final http.Response response = await http
|
||||
.get(Uri.parse('https://monkey.banano.cc/api/v1/monkey/$address'));
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
final manager =
|
||||
ref.read(walletsChangeNotifierProvider).getManager(walletId);
|
||||
final decodedResponse = response.bodyBytes;
|
||||
await (manager.wallet as BananoWallet)
|
||||
.updateMonkeyImageBytes(decodedResponse);
|
||||
} else {
|
||||
throw Exception("Failed to get MonKey");
|
||||
}
|
||||
}
|
||||
|
||||
// void getMonkeySVG(String address) async {
|
||||
// if (address.isEmpty) {
|
||||
// //address shouldn't be empty
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// final http.Response response = await http
|
||||
// .get(Uri.parse('https://monkey.banano.cc/api/v1/monkey/$address'));
|
||||
//
|
||||
// if (response.statusCode == 200) {
|
||||
// final decodedResponse = response.bodyBytes;
|
||||
// Directory directory = await getApplicationDocumentsDirectory();
|
||||
// late Directory sampleFolder;
|
||||
//
|
||||
// if (Platform.isAndroid) {
|
||||
// directory = Directory("/storage/emulated/0/");
|
||||
// sampleFolder = Directory('${directory!.path}Documents');
|
||||
// } else if (Platform.isIOS) {
|
||||
// sampleFolder = Directory(directory!.path);
|
||||
// } else if (Platform.isLinux) {
|
||||
// sampleFolder = Directory('${directory!.path}Documents');
|
||||
// } else if (Platform.isWindows) {
|
||||
// sampleFolder = Directory('${directory!.path}Documents');
|
||||
// } else if (Platform.isMacOS) {
|
||||
// sampleFolder = Directory('${directory!.path}Documents');
|
||||
// }
|
||||
//
|
||||
// try {
|
||||
// if (!sampleFolder.existsSync()) {
|
||||
// sampleFolder.createSync(recursive: true);
|
||||
// }
|
||||
// } catch (e, s) {
|
||||
// // todo: come back to this
|
||||
// debugPrint("$e $s");
|
||||
// }
|
||||
//
|
||||
// final docPath = sampleFolder.path;
|
||||
// final filePath = "$docPath/monkey.svg";
|
||||
//
|
||||
// File imgFile = File(filePath);
|
||||
// await imgFile.writeAsBytes(decodedResponse);
|
||||
// } else {
|
||||
// throw Exception("Failed to get MonKey");
|
||||
// }
|
||||
// }
|
||||
|
||||
Future<Directory?> getDocsDir() async {
|
||||
try {
|
||||
if (Platform.isAndroid) {
|
||||
return Directory("/storage/emulated/0/Documents");
|
||||
}
|
||||
|
||||
return await getApplicationDocumentsDirectory();
|
||||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> downloadMonkey(String address, bool isPNG) async {
|
||||
if (address.isEmpty) {
|
||||
//address shouldn't be empty
|
||||
return;
|
||||
}
|
||||
|
||||
String url = "https://monkey.banano.cc/api/v1/monkey/$address";
|
||||
|
||||
if (isPNG) {
|
||||
url += '?format=png&size=512&background=false';
|
||||
}
|
||||
|
||||
final http.Response response = await http.get(Uri.parse(url));
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
if (Platform.isAndroid) {
|
||||
await Permission.storage.request();
|
||||
}
|
||||
|
||||
final decodedResponse = response.bodyBytes;
|
||||
final Directory? sampleFolder = await getDocsDir();
|
||||
|
||||
print("PATH: ${sampleFolder?.path}");
|
||||
|
||||
if (sampleFolder == null) {
|
||||
print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
|
||||
return;
|
||||
}
|
||||
|
||||
// try {
|
||||
// if (!sampleFolder.existsSync()) {
|
||||
// sampleFolder.createSync(recursive: true);
|
||||
// }
|
||||
// } catch (e, s) {
|
||||
// // todo: come back to this
|
||||
// debugPrint("$e $s");
|
||||
// }
|
||||
|
||||
final docPath = sampleFolder.path;
|
||||
String filePath = "$docPath/monkey_$address";
|
||||
|
||||
filePath += isPNG ? ".png" : ".svg";
|
||||
|
||||
// todo check if monkey.png exists
|
||||
|
||||
File imgFile = File(filePath);
|
||||
await imgFile.writeAsBytes(decodedResponse);
|
||||
} else {
|
||||
throw Exception("Failed to get MonKey");
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
walletId = widget.walletId;
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
|
||||
final address = await ref
|
||||
.read(walletsChangeNotifierProvider)
|
||||
.getManager(walletId)
|
||||
.currentReceivingAddress;
|
||||
setState(() {
|
||||
receivingAddress = address;
|
||||
});
|
||||
});
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final manager = ref.watch(walletsChangeNotifierProvider
|
||||
.select((value) => value.getManager(widget.walletId)));
|
||||
final Coin coin = manager.coin;
|
||||
|
||||
final bool isDesktop = Util.isDesktop;
|
||||
|
||||
imageBytes ??= (manager.wallet as BananoWallet).getMonkeyImageBytes();
|
||||
|
||||
//edit for desktop
|
||||
return Background(
|
||||
child: ConditionalParent(
|
||||
condition: isDesktop,
|
||||
builder: (child) => DesktopScaffold(
|
||||
appBar: DesktopAppBar(
|
||||
background: Theme.of(context).extension<StackColors>()!.popupBG,
|
||||
leading: Expanded(
|
||||
child: Row(
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 32,
|
||||
),
|
||||
AppBarIconButton(
|
||||
size: 32,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFieldDefaultBG,
|
||||
shadows: const [],
|
||||
icon: SvgPicture.asset(
|
||||
Assets.svg.arrowLeft,
|
||||
width: 18,
|
||||
height: 18,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.topNavIconPrimary,
|
||||
),
|
||||
onPressed: () {
|
||||
if (mounted) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
width: 15,
|
||||
),
|
||||
SvgPicture.asset(Assets.svg.monkey),
|
||||
const SizedBox(
|
||||
width: 12,
|
||||
),
|
||||
Text(
|
||||
"MonKey",
|
||||
style: STextStyles.navBarTitle(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
trailing: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: MouseRegion(
|
||||
cursor: SystemMouseCursors.click,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
showDialog<dynamic>(
|
||||
context: context,
|
||||
useSafeArea: false,
|
||||
barrierDismissible: true,
|
||||
builder: (context) {
|
||||
return const StackDialog(
|
||||
title: "About MonKeys",
|
||||
message:
|
||||
"A MonKey is a visual representation of your Banano address.",
|
||||
);
|
||||
});
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
Assets.svg.circleQuestion,
|
||||
color: Colors.blue[800],
|
||||
),
|
||||
const SizedBox(
|
||||
width: 6,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8.0),
|
||||
child: Text(
|
||||
"What is MonKey?",
|
||||
style: STextStyles.desktopTextSmall(context).copyWith(
|
||||
color: Colors.blue[800],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
useSpacers: false,
|
||||
isCompactHeight: true,
|
||||
),
|
||||
body: child,
|
||||
),
|
||||
child: ConditionalParent(
|
||||
condition: !isDesktop,
|
||||
builder: (child) => Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: AppBarBackButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
title: Text(
|
||||
"MonKey",
|
||||
style: STextStyles.navBarTitle(context),
|
||||
),
|
||||
actions: [
|
||||
AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: AppBarIconButton(
|
||||
icon: SvgPicture.asset(
|
||||
Assets.svg.circleQuestion,
|
||||
),
|
||||
onPressed: () {
|
||||
showDialog<dynamic>(
|
||||
context: context,
|
||||
useSafeArea: false,
|
||||
barrierDismissible: true,
|
||||
builder: (context) {
|
||||
return const StackOkDialog(
|
||||
title: "About MonKeys",
|
||||
message:
|
||||
"A MonKey is a visual representation of your Banano address.",
|
||||
);
|
||||
});
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
body: child,
|
||||
),
|
||||
child: ConditionalParent(
|
||||
condition: isDesktop,
|
||||
builder: (child) => SizedBox(
|
||||
width: 318,
|
||||
child: child,
|
||||
),
|
||||
child: ConditionalParent(
|
||||
condition: imageBytes != null,
|
||||
builder: (_) => Column(
|
||||
children: [
|
||||
isDesktop
|
||||
? const SizedBox(
|
||||
height: 50,
|
||||
)
|
||||
: const Spacer(
|
||||
flex: 1,
|
||||
),
|
||||
if (imageBytes != null)
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 300,
|
||||
child: SvgPicture.memory(Uint8List.fromList(imageBytes!)),
|
||||
),
|
||||
isDesktop
|
||||
? const SizedBox(
|
||||
height: 50,
|
||||
)
|
||||
: const Spacer(
|
||||
flex: 1,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
children: [
|
||||
SecondaryButton(
|
||||
label: "Save as SVG",
|
||||
onPressed: () async {
|
||||
await showLoading(
|
||||
whileFuture:
|
||||
downloadMonkey(receivingAddress, false),
|
||||
context: context,
|
||||
isDesktop: Util.isDesktop,
|
||||
message: "Saving MonKey svg",
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
SecondaryButton(
|
||||
label: "Download as PNG",
|
||||
onPressed: () async {
|
||||
await showLoading(
|
||||
whileFuture:
|
||||
downloadMonkey(receivingAddress, true),
|
||||
context: context,
|
||||
isDesktop: Util.isDesktop,
|
||||
message: "Downloading MonKey png",
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// child,
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
isDesktop
|
||||
? const SizedBox(
|
||||
height: 100,
|
||||
)
|
||||
: const Spacer(
|
||||
flex: 4,
|
||||
),
|
||||
Center(
|
||||
child: Column(
|
||||
children: [
|
||||
Opacity(
|
||||
opacity: 0.2,
|
||||
child: SvgPicture.file(
|
||||
File(
|
||||
ref.watch(coinIconProvider(coin)),
|
||||
),
|
||||
width: 200,
|
||||
height: 200,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 70,
|
||||
),
|
||||
Text(
|
||||
"You do not have a MonKey yet. \nFetch yours now!",
|
||||
style: STextStyles.smallMed14(context).copyWith(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textDark3,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
isDesktop
|
||||
? const SizedBox(
|
||||
height: 50,
|
||||
)
|
||||
: const Spacer(
|
||||
flex: 6,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: PrimaryButton(
|
||||
label: "Fetch MonKey",
|
||||
onPressed: () async {
|
||||
final future = Future.wait([
|
||||
getMonkeyImage(receivingAddress),
|
||||
Future<void>.delayed(const Duration(seconds: 2)),
|
||||
]);
|
||||
|
||||
await showLoading(
|
||||
whileFuture: future,
|
||||
context: context,
|
||||
isDesktop: Util.isDesktop,
|
||||
message: "Fetching MonKey",
|
||||
subMessage: "We are fetching your MonKey",
|
||||
);
|
||||
|
||||
imageBytes = (manager.wallet as BananoWallet)
|
||||
.getMonkeyImageBytes();
|
||||
|
||||
if (imageBytes != null) {
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
// if (isDesktop) {
|
||||
// Navigator.of(context).popUntil(
|
||||
// ModalRoute.withName(
|
||||
// DesktopWalletView.routeName),
|
||||
// );
|
||||
// } else {
|
||||
// Navigator.of(context).popUntil(
|
||||
// ModalRoute.withName(WalletView.routeName),
|
||||
// );
|
||||
// }
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
135
lib/pages/monkey/sub_widgets/fetch_monkey_dialog.dart
Normal file
|
@ -0,0 +1,135 @@
|
|||
/*
|
||||
* This file is part of Stack Wallet.
|
||||
*
|
||||
* Copyright (c) 2023 Cypher Stack
|
||||
* All Rights Reserved.
|
||||
* The code is distributed under GPLv3 license, see LICENSE file for details.
|
||||
* Generated by Cypher Stack on 2023-05-26
|
||||
*
|
||||
*/
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/utilities/util.dart';
|
||||
import 'package:stackwallet/widgets/animated_widgets/rotating_arrows.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
|
||||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||
|
||||
class FetchMonkeyDialog extends StatefulWidget {
|
||||
const FetchMonkeyDialog({
|
||||
Key? key,
|
||||
required this.onCancel,
|
||||
}) : super(key: key);
|
||||
|
||||
final Future<void> Function() onCancel;
|
||||
|
||||
@override
|
||||
State<FetchMonkeyDialog> createState() => _FetchMonkeyDialogState();
|
||||
}
|
||||
|
||||
class _FetchMonkeyDialogState extends State<FetchMonkeyDialog> {
|
||||
late final Future<void> Function() onCancel;
|
||||
@override
|
||||
void initState() {
|
||||
onCancel = widget.onCancel;
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (Util.isDesktop) {
|
||||
return DesktopDialog(
|
||||
child: Column(
|
||||
children: [
|
||||
DesktopDialogCloseButton(
|
||||
onPressedOverride: () async {
|
||||
await onCancel.call();
|
||||
if (mounted) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
),
|
||||
const Spacer(
|
||||
flex: 1,
|
||||
),
|
||||
const RotatingArrows(
|
||||
width: 40,
|
||||
height: 40,
|
||||
),
|
||||
const Spacer(
|
||||
flex: 2,
|
||||
),
|
||||
Text(
|
||||
"Fetching MonKey",
|
||||
style: STextStyles.desktopH2(context),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Text(
|
||||
"We are fetching your MonKey",
|
||||
style: STextStyles.desktopTextMedium(context).copyWith(
|
||||
color: Theme.of(context).extension<StackColors>()!.textDark3,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const Spacer(
|
||||
flex: 2,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 32,
|
||||
right: 32,
|
||||
bottom: 32,
|
||||
),
|
||||
child: SecondaryButton(
|
||||
label: "Cancel",
|
||||
width: 272.5,
|
||||
onPressed: () async {
|
||||
await onCancel.call();
|
||||
if (mounted) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
return false;
|
||||
},
|
||||
child: StackDialog(
|
||||
title: "Fetching MonKey",
|
||||
message: "We are fetching your MonKey",
|
||||
icon: const RotatingArrows(
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
rightButton: TextButton(
|
||||
style: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.getSecondaryEnabledButtonStyle(context),
|
||||
child: Text(
|
||||
"Cancel",
|
||||
style: STextStyles.itemSubtitle12(context),
|
||||
),
|
||||
onPressed: () async {
|
||||
await onCancel.call();
|
||||
if (mounted) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
267
lib/pages/ordinals/ordinal_details_view.dart
Normal file
|
@ -0,0 +1,267 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:stackwallet/models/isar/ordinal.dart';
|
||||
import 'package:stackwallet/notifications/show_flush_bar.dart';
|
||||
import 'package:stackwallet/pages/ordinals/widgets/dialogs.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/widgets/background.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
|
||||
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||
|
||||
class OrdinalDetailsView extends StatefulWidget {
|
||||
const OrdinalDetailsView({
|
||||
Key? key,
|
||||
required this.walletId,
|
||||
required this.ordinal,
|
||||
}) : super(key: key);
|
||||
|
||||
final String walletId;
|
||||
final Ordinal ordinal;
|
||||
|
||||
static const routeName = "/ordinalDetailsView";
|
||||
|
||||
@override
|
||||
State<OrdinalDetailsView> createState() => _OrdinalDetailsViewState();
|
||||
}
|
||||
|
||||
class _OrdinalDetailsViewState extends State<OrdinalDetailsView> {
|
||||
static const _spacing = 12.0;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Background(
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
backgroundColor:
|
||||
Theme.of(context).extension<StackColors>()!.background,
|
||||
appBar: AppBar(
|
||||
backgroundColor:
|
||||
Theme.of(context).extension<StackColors>()!.background,
|
||||
leading: const AppBarBackButton(),
|
||||
title: Text(
|
||||
"Ordinal details",
|
||||
style: STextStyles.navBarTitle(context),
|
||||
),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 12,
|
||||
horizontal: 39,
|
||||
),
|
||||
child: _OrdinalImageGroup(
|
||||
ordinal: widget.ordinal,
|
||||
walletId: widget.walletId,
|
||||
),
|
||||
),
|
||||
_DetailsItemWCopy(
|
||||
title: "Inscription number",
|
||||
data: widget.ordinal.inscriptionNumber.toString(),
|
||||
),
|
||||
const SizedBox(
|
||||
height: _spacing,
|
||||
),
|
||||
_DetailsItemWCopy(
|
||||
title: "ID",
|
||||
data: widget.ordinal.inscriptionId,
|
||||
),
|
||||
const SizedBox(
|
||||
height: _spacing,
|
||||
),
|
||||
// todo: add utxo status
|
||||
const SizedBox(
|
||||
height: _spacing,
|
||||
),
|
||||
const _DetailsItemWCopy(
|
||||
title: "Amount",
|
||||
data: "TODO", // TODO infer from utxo utxoTXID:utxoVOUT
|
||||
),
|
||||
const SizedBox(
|
||||
height: _spacing,
|
||||
),
|
||||
const _DetailsItemWCopy(
|
||||
title: "Owner address",
|
||||
data: "TODO", // infer from address associated w utxoTXID
|
||||
),
|
||||
const SizedBox(
|
||||
height: _spacing,
|
||||
),
|
||||
_DetailsItemWCopy(
|
||||
title: "Transaction ID",
|
||||
data: widget.ordinal.utxoTXID,
|
||||
),
|
||||
const SizedBox(
|
||||
height: _spacing,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _DetailsItemWCopy extends StatelessWidget {
|
||||
const _DetailsItemWCopy({
|
||||
Key? key,
|
||||
required this.title,
|
||||
required this.data,
|
||||
}) : super(key: key);
|
||||
|
||||
final String title;
|
||||
final String data;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RoundedWhiteContainer(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: STextStyles.itemSubtitle(context),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
await Clipboard.setData(ClipboardData(text: data));
|
||||
if (context.mounted) {
|
||||
unawaited(
|
||||
showFloatingFlushBar(
|
||||
type: FlushBarType.info,
|
||||
message: "Copied to clipboard",
|
||||
context: context,
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
child: SvgPicture.asset(
|
||||
Assets.svg.copy,
|
||||
color:
|
||||
Theme.of(context).extension<StackColors>()!.infoItemIcons,
|
||||
width: 12,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
SelectableText(
|
||||
data,
|
||||
style: STextStyles.itemSubtitle12(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _OrdinalImageGroup extends StatelessWidget {
|
||||
const _OrdinalImageGroup({
|
||||
Key? key,
|
||||
required this.walletId,
|
||||
required this.ordinal,
|
||||
}) : super(key: key);
|
||||
|
||||
final String walletId;
|
||||
final Ordinal ordinal;
|
||||
|
||||
static const _spacing = 12.0;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
// Text(
|
||||
// "${ordinal.inscriptionId}", // Use any other property you want
|
||||
// style: STextStyles.w600_16(context),
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// height: _spacing,
|
||||
// ),
|
||||
AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
child: Image.network(
|
||||
ordinal.content, // Use the preview URL as the image source
|
||||
fit: BoxFit.cover,
|
||||
filterQuality:
|
||||
FilterQuality.none, // Set the filter mode to nearest
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: _spacing,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SecondaryButton(
|
||||
label: "Download",
|
||||
icon: SvgPicture.asset(
|
||||
Assets.svg.arrowDown,
|
||||
width: 10,
|
||||
height: 12,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.buttonTextSecondary,
|
||||
),
|
||||
buttonHeight: ButtonHeight.l,
|
||||
iconSpacing: 4,
|
||||
onPressed: () {
|
||||
// TODO: save and download image to device
|
||||
},
|
||||
),
|
||||
),
|
||||
// const SizedBox(
|
||||
// width: _spacing,
|
||||
// ),
|
||||
// Expanded(
|
||||
// child: PrimaryButton(
|
||||
// label: "Send",
|
||||
// icon: SvgPicture.asset(
|
||||
// Assets.svg.send,
|
||||
// width: 10,
|
||||
// height: 10,
|
||||
// color: Theme.of(context)
|
||||
// .extension<StackColors>()!
|
||||
// .buttonTextPrimary,
|
||||
// ),
|
||||
// buttonHeight: ButtonHeight.l,
|
||||
// iconSpacing: 4,
|
||||
// onPressed: () async {
|
||||
// final response = await showDialog<String?>(
|
||||
// context: context,
|
||||
// builder: (_) => const SendOrdinalUnfreezeDialog(),
|
||||
// );
|
||||
// if (response == "unfreeze") {
|
||||
// // TODO: unfreeze and go to send ord screen
|
||||
// }
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
889
lib/pages/ordinals/ordinals_filter_view.dart
Normal file
|
@ -0,0 +1,889 @@
|
|||
/*
|
||||
* This file is part of Stack Wallet.
|
||||
*
|
||||
* Copyright (c) 2023 Cypher Stack
|
||||
* All Rights Reserved.
|
||||
* The code is distributed under GPLv3 license, see LICENSE file for details.
|
||||
* Generated by Cypher Stack on 2023-05-26
|
||||
*
|
||||
*/
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_rounded_date_picker/flutter_rounded_date_picker.dart';
|
||||
import 'package:flutter_svg/svg.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/format.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/utilities/util.dart';
|
||||
import 'package:stackwallet/widgets/background.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
|
||||
import 'package:stackwallet/widgets/icon_widgets/x_icon.dart';
|
||||
import 'package:stackwallet/widgets/stack_text_field.dart';
|
||||
import 'package:stackwallet/widgets/textfield_icon_button.dart';
|
||||
|
||||
class OrdinalFilter {
|
||||
// final bool isMoonbird;
|
||||
// final bool isPunk;
|
||||
final DateTime? from;
|
||||
final DateTime? to;
|
||||
final String? inscription;
|
||||
final String keyword;
|
||||
|
||||
OrdinalFilter({
|
||||
// required this.isMoonbird,
|
||||
// required this.isPunk,
|
||||
required this.from,
|
||||
required this.to,
|
||||
required this.inscription,
|
||||
required this.keyword,
|
||||
});
|
||||
|
||||
OrdinalFilter copyWith({
|
||||
// bool? isMoonbird,
|
||||
// bool? isPunk,
|
||||
DateTime? from,
|
||||
DateTime? to,
|
||||
String? inscription,
|
||||
String? keyword,
|
||||
}) {
|
||||
return OrdinalFilter(
|
||||
// isMoonbird: isMoonbird ?? this.isMoonbird,
|
||||
// isPunk: isPunk ?? this.isPunk,
|
||||
from: from ?? this.from,
|
||||
to: to ?? this.to,
|
||||
inscription: inscription ?? this.inscription,
|
||||
keyword: keyword ?? this.keyword,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
final ordinalFilterProvider = StateProvider<OrdinalFilter?>((_) => null);
|
||||
|
||||
class OrdinalsFilterView extends ConsumerStatefulWidget {
|
||||
const OrdinalsFilterView({
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
static const String routeName = "/ordinalsFilterView";
|
||||
|
||||
@override
|
||||
ConsumerState<OrdinalsFilterView> createState() => _OrdinalsFilterViewState();
|
||||
}
|
||||
|
||||
class _OrdinalsFilterViewState extends ConsumerState<OrdinalsFilterView> {
|
||||
final _inscriptionTextEditingController = TextEditingController();
|
||||
final _keywordTextEditingController = TextEditingController();
|
||||
|
||||
// bool _isPunk = false;
|
||||
// bool _isMoonbird = false;
|
||||
|
||||
String _fromDateString = "";
|
||||
String _toDateString = "";
|
||||
|
||||
final keywordTextFieldFocusNode = FocusNode();
|
||||
final inscriptionTextFieldFocusNode = FocusNode();
|
||||
|
||||
late Color baseColor;
|
||||
|
||||
@override
|
||||
initState() {
|
||||
baseColor = ref.read(themeProvider.state).state.textSubtitle2;
|
||||
final filterState = ref.read(ordinalFilterProvider.state).state;
|
||||
if (filterState != null) {
|
||||
// _isMoonbird = filterState.isMoonbird;
|
||||
// _isPunk = filterState.isPunk;
|
||||
_selectedToDate = filterState.to;
|
||||
_selectedFromDate = filterState.from;
|
||||
_keywordTextEditingController.text = filterState.keyword;
|
||||
_inscriptionTextEditingController.text = filterState.inscription ?? "";
|
||||
}
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
dispose() {
|
||||
_inscriptionTextEditingController.dispose();
|
||||
_keywordTextEditingController.dispose();
|
||||
keywordTextFieldFocusNode.dispose();
|
||||
inscriptionTextFieldFocusNode.dispose();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
// The following two getters are not required if the
|
||||
// date fields are to remain unclearable.
|
||||
Widget get _dateFromText {
|
||||
final isDateSelected = _fromDateString.isEmpty;
|
||||
return Text(
|
||||
isDateSelected ? "From..." : _fromDateString,
|
||||
style: STextStyles.fieldLabel(context).copyWith(
|
||||
color: isDateSelected
|
||||
? Theme.of(context).extension<StackColors>()!.textSubtitle2
|
||||
: Theme.of(context).extension<StackColors>()!.accentColorDark),
|
||||
);
|
||||
}
|
||||
|
||||
Widget get _dateToText {
|
||||
final isDateSelected = _toDateString.isEmpty;
|
||||
return Text(
|
||||
isDateSelected ? "To..." : _toDateString,
|
||||
style: STextStyles.fieldLabel(context).copyWith(
|
||||
color: isDateSelected
|
||||
? Theme.of(context).extension<StackColors>()!.textSubtitle2
|
||||
: Theme.of(context).extension<StackColors>()!.accentColorDark),
|
||||
);
|
||||
}
|
||||
|
||||
DateTime? _selectedFromDate = DateTime(2007);
|
||||
DateTime? _selectedToDate = DateTime.now();
|
||||
|
||||
MaterialRoundedDatePickerStyle _buildDatePickerStyle() {
|
||||
return MaterialRoundedDatePickerStyle(
|
||||
backgroundPicker: Theme.of(context).extension<StackColors>()!.popupBG,
|
||||
// backgroundHeader: Theme.of(context).extension<StackColors>()!.textSubtitle2,
|
||||
paddingMonthHeader: const EdgeInsets.only(top: 11),
|
||||
colorArrowNext: Theme.of(context).extension<StackColors>()!.textSubtitle1,
|
||||
colorArrowPrevious:
|
||||
Theme.of(context).extension<StackColors>()!.textSubtitle1,
|
||||
textStyleButtonNegative: STextStyles.datePicker600(context).copyWith(
|
||||
color: baseColor,
|
||||
),
|
||||
textStyleButtonPositive: STextStyles.datePicker600(context).copyWith(
|
||||
color: baseColor,
|
||||
),
|
||||
textStyleCurrentDayOnCalendar: STextStyles.datePicker400(context),
|
||||
textStyleDayHeader: STextStyles.datePicker600(context),
|
||||
textStyleDayOnCalendar: STextStyles.datePicker400(context).copyWith(
|
||||
color: baseColor,
|
||||
),
|
||||
textStyleDayOnCalendarDisabled:
|
||||
STextStyles.datePicker400(context).copyWith(
|
||||
color: Theme.of(context).extension<StackColors>()!.textSubtitle3,
|
||||
),
|
||||
textStyleDayOnCalendarSelected:
|
||||
STextStyles.datePicker400(context).copyWith(
|
||||
color: Theme.of(context).extension<StackColors>()!.textWhite,
|
||||
),
|
||||
textStyleMonthYearHeader: STextStyles.datePicker600(context).copyWith(
|
||||
color: Theme.of(context).extension<StackColors>()!.textSubtitle1,
|
||||
),
|
||||
textStyleYearButton: STextStyles.datePicker600(context).copyWith(
|
||||
color: Theme.of(context).extension<StackColors>()!.textWhite,
|
||||
),
|
||||
// textStyleButtonAction: GoogleFonts.inter(),
|
||||
);
|
||||
}
|
||||
|
||||
MaterialRoundedYearPickerStyle _buildYearPickerStyle() {
|
||||
return MaterialRoundedYearPickerStyle(
|
||||
backgroundPicker: Theme.of(context).extension<StackColors>()!.popupBG,
|
||||
textStyleYear: STextStyles.datePicker600(context).copyWith(
|
||||
color: Theme.of(context).extension<StackColors>()!.textSubtitle2,
|
||||
fontSize: 16,
|
||||
),
|
||||
textStyleYearSelected: STextStyles.datePicker600(context).copyWith(
|
||||
fontSize: 18,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildDateRangePicker() {
|
||||
const middleSeparatorPadding = 2.0;
|
||||
const middleSeparatorWidth = 12.0;
|
||||
final isDesktop = Util.isDesktop;
|
||||
|
||||
final width = isDesktop
|
||||
? null
|
||||
: (MediaQuery.of(context).size.width -
|
||||
(middleSeparatorWidth +
|
||||
(2 * middleSeparatorPadding) +
|
||||
(2 * Constants.size.standardPadding))) /
|
||||
2;
|
||||
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
key: const Key("OrdinalsViewFromDatePickerKey"),
|
||||
onTap: () async {
|
||||
final color =
|
||||
Theme.of(context).extension<StackColors>()!.accentColorDark;
|
||||
final height = MediaQuery.of(context).size.height;
|
||||
// check and hide keyboard
|
||||
if (FocusScope.of(context).hasFocus) {
|
||||
FocusScope.of(context).unfocus();
|
||||
await Future<void>.delayed(const Duration(milliseconds: 125));
|
||||
}
|
||||
|
||||
if (mounted) {
|
||||
final date = await showRoundedDatePicker(
|
||||
// This doesn't change statusbar color...
|
||||
// background: CFColors.starryNight.withOpacity(0.8),
|
||||
context: context,
|
||||
initialDate: DateTime.now(),
|
||||
height: height * 0.5,
|
||||
theme: ThemeData(
|
||||
primarySwatch: Util.createMaterialColor(
|
||||
color,
|
||||
),
|
||||
),
|
||||
//TODO pick a better initial date
|
||||
// 2007 chosen as that is just before bitcoin launched
|
||||
firstDate: DateTime(2007),
|
||||
lastDate: DateTime.now(),
|
||||
borderRadius: Constants.size.circularBorderRadius * 2,
|
||||
|
||||
textPositiveButton: "SELECT",
|
||||
|
||||
styleDatePicker: _buildDatePickerStyle(),
|
||||
styleYearPicker: _buildYearPickerStyle(),
|
||||
);
|
||||
if (date != null) {
|
||||
_selectedFromDate = date;
|
||||
|
||||
// flag to adjust date so from date is always before to date
|
||||
final flag = _selectedToDate != null &&
|
||||
!_selectedFromDate!.isBefore(_selectedToDate!);
|
||||
if (flag) {
|
||||
_selectedToDate = DateTime.fromMillisecondsSinceEpoch(
|
||||
_selectedFromDate!.millisecondsSinceEpoch);
|
||||
}
|
||||
|
||||
setState(() {
|
||||
if (flag) {
|
||||
_toDateString = _selectedToDate == null
|
||||
? ""
|
||||
: Format.formatDate(_selectedToDate!);
|
||||
}
|
||||
_fromDateString = _selectedFromDate == null
|
||||
? ""
|
||||
: Format.formatDate(_selectedFromDate!);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
width: width,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFieldDefaultBG,
|
||||
borderRadius:
|
||||
BorderRadius.circular(Constants.size.circularBorderRadius),
|
||||
border: Border.all(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFieldDefaultBG,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: isDesktop ? 17 : 12,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
Assets.svg.calendar,
|
||||
height: 20,
|
||||
width: 20,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textSubtitle2,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: FittedBox(
|
||||
child: _dateFromText,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: middleSeparatorPadding),
|
||||
child: Container(
|
||||
width: middleSeparatorWidth,
|
||||
// height: 1,
|
||||
// color: CFColors.smoke,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
key: const Key("OrdinalsViewToDatePickerKey"),
|
||||
onTap: () async {
|
||||
final color =
|
||||
Theme.of(context).extension<StackColors>()!.accentColorDark;
|
||||
final height = MediaQuery.of(context).size.height;
|
||||
// check and hide keyboard
|
||||
if (FocusScope.of(context).hasFocus) {
|
||||
FocusScope.of(context).unfocus();
|
||||
await Future<void>.delayed(const Duration(milliseconds: 125));
|
||||
}
|
||||
|
||||
if (mounted) {
|
||||
final date = await showRoundedDatePicker(
|
||||
// This doesn't change statusbar color...
|
||||
// background: CFColors.starryNight.withOpacity(0.8),
|
||||
context: context,
|
||||
height: height * 0.5,
|
||||
theme: ThemeData(
|
||||
primarySwatch: Util.createMaterialColor(
|
||||
color,
|
||||
),
|
||||
),
|
||||
//TODO pick a better initial date
|
||||
// 2007 chosen as that is just before bitcoin launched
|
||||
initialDate: DateTime.now(),
|
||||
firstDate: DateTime(2007),
|
||||
lastDate: DateTime.now(),
|
||||
borderRadius: Constants.size.circularBorderRadius * 2,
|
||||
|
||||
textPositiveButton: "SELECT",
|
||||
|
||||
styleDatePicker: _buildDatePickerStyle(),
|
||||
styleYearPicker: _buildYearPickerStyle(),
|
||||
);
|
||||
if (date != null) {
|
||||
_selectedToDate = date;
|
||||
|
||||
// flag to adjust date so from date is always before to date
|
||||
final flag = _selectedFromDate != null &&
|
||||
!_selectedToDate!.isAfter(_selectedFromDate!);
|
||||
if (flag) {
|
||||
_selectedFromDate = DateTime.fromMillisecondsSinceEpoch(
|
||||
_selectedToDate!.millisecondsSinceEpoch);
|
||||
}
|
||||
|
||||
setState(() {
|
||||
if (flag) {
|
||||
_fromDateString = _selectedFromDate == null
|
||||
? ""
|
||||
: Format.formatDate(_selectedFromDate!);
|
||||
}
|
||||
_toDateString = _selectedToDate == null
|
||||
? ""
|
||||
: Format.formatDate(_selectedToDate!);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
width: width,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFieldDefaultBG,
|
||||
borderRadius:
|
||||
BorderRadius.circular(Constants.size.circularBorderRadius),
|
||||
border: Border.all(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFieldDefaultBG,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: isDesktop ? 17 : 12,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
Assets.svg.calendar,
|
||||
height: 20,
|
||||
width: 20,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textSubtitle2,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: FittedBox(
|
||||
child: _dateToText,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (isDesktop)
|
||||
const SizedBox(
|
||||
width: 24,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (Util.isDesktop) {
|
||||
return DesktopDialog(
|
||||
maxWidth: 576,
|
||||
maxHeight: double.infinity,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 32,
|
||||
bottom: 32,
|
||||
),
|
||||
child: _buildContent(context),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return Background(
|
||||
child: Scaffold(
|
||||
backgroundColor:
|
||||
Theme.of(context).extension<StackColors>()!.background,
|
||||
appBar: AppBar(
|
||||
backgroundColor:
|
||||
Theme.of(context).extension<StackColors>()!.background,
|
||||
leading: AppBarBackButton(
|
||||
onPressed: () async {
|
||||
if (FocusScope.of(context).hasFocus) {
|
||||
FocusScope.of(context).unfocus();
|
||||
await Future<void>.delayed(const Duration(milliseconds: 75));
|
||||
}
|
||||
if (mounted) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
),
|
||||
title: Text(
|
||||
"Ordinals filter",
|
||||
style: STextStyles.navBarTitle(context),
|
||||
),
|
||||
),
|
||||
body: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: Constants.size.standardPadding,
|
||||
),
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
return SingleChildScrollView(
|
||||
child: ConstrainedBox(
|
||||
constraints:
|
||||
BoxConstraints(minHeight: constraints.maxHeight),
|
||||
child: IntrinsicHeight(
|
||||
child: _buildContent(context),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildContent(BuildContext context) {
|
||||
final isDesktop = Util.isDesktop;
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
if (isDesktop)
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Ordinals filter",
|
||||
style: STextStyles.desktopH3(context),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const DesktopDialogCloseButton(),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: isDesktop ? 14 : 10,
|
||||
),
|
||||
// if (!isDesktop)
|
||||
// Align(
|
||||
// alignment: Alignment.centerLeft,
|
||||
// child: FittedBox(
|
||||
// child: Text(
|
||||
// "Collection",
|
||||
// style: STextStyles.smallMed12(context),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// if (!isDesktop)
|
||||
// const SizedBox(
|
||||
// height: 12,
|
||||
// ),
|
||||
// RoundedWhiteContainer(
|
||||
// padding: EdgeInsets.all(isDesktop ? 0 : 12),
|
||||
// child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// Row(
|
||||
// children: [
|
||||
// GestureDetector(
|
||||
// onTap: () {
|
||||
// setState(() {
|
||||
// _isPunk = !_isPunk;
|
||||
// });
|
||||
// },
|
||||
// child: Container(
|
||||
// color: Colors.transparent,
|
||||
// child: Row(
|
||||
// children: [
|
||||
// SizedBox(
|
||||
// height: 20,
|
||||
// width: 20,
|
||||
// child: Checkbox(
|
||||
// key: const Key("OrdinalsPunkCheckboxKey"),
|
||||
// materialTapTargetSize:
|
||||
// MaterialTapTargetSize.shrinkWrap,
|
||||
// value: _isPunk,
|
||||
// onChanged: (newValue) {
|
||||
// setState(() {
|
||||
// _isPunk = newValue!;
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// width: 14,
|
||||
// ),
|
||||
// Align(
|
||||
// alignment: Alignment.centerLeft,
|
||||
// child: FittedBox(
|
||||
// child: Column(
|
||||
// children: [
|
||||
// Text(
|
||||
// "Punks",
|
||||
// style: isDesktop
|
||||
// ? STextStyles.desktopTextSmall(context)
|
||||
// : STextStyles.itemSubtitle12(context),
|
||||
// ),
|
||||
// if (isDesktop)
|
||||
// const SizedBox(
|
||||
// height: 4,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: isDesktop ? 4 : 10,
|
||||
// ),
|
||||
// Row(
|
||||
// children: [
|
||||
// GestureDetector(
|
||||
// onTap: () {
|
||||
// setState(() {
|
||||
// _isMoonbird = !_isMoonbird;
|
||||
// });
|
||||
// },
|
||||
// child: Container(
|
||||
// color: Colors.transparent,
|
||||
// child: Row(
|
||||
// children: [
|
||||
// SizedBox(
|
||||
// height: 20,
|
||||
// width: 20,
|
||||
// child: Checkbox(
|
||||
// key: const Key(
|
||||
// "OrdinalsFilterMoonbirdCheckboxKey",
|
||||
// ),
|
||||
// materialTapTargetSize:
|
||||
// MaterialTapTargetSize.shrinkWrap,
|
||||
// value: _isMoonbird,
|
||||
// onChanged: (newValue) {
|
||||
// setState(() {
|
||||
// _isMoonbird = newValue!;
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// width: 14,
|
||||
// ),
|
||||
// Align(
|
||||
// alignment: Alignment.centerLeft,
|
||||
// child: FittedBox(
|
||||
// child: Column(
|
||||
// children: [
|
||||
// Text(
|
||||
// "Moonbirds",
|
||||
// style: isDesktop
|
||||
// ? STextStyles.desktopTextSmall(context)
|
||||
// : STextStyles.itemSubtitle12(context),
|
||||
// ),
|
||||
// if (isDesktop)
|
||||
// const SizedBox(
|
||||
// height: 4,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: isDesktop ? 32 : 24,
|
||||
// ),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: FittedBox(
|
||||
child: Text(
|
||||
"Date",
|
||||
style: isDesktop
|
||||
? STextStyles.labelExtraExtraSmall(context)
|
||||
: STextStyles.smallMed12(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: isDesktop ? 10 : 8,
|
||||
),
|
||||
_buildDateRangePicker(),
|
||||
SizedBox(
|
||||
height: isDesktop ? 32 : 24,
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: FittedBox(
|
||||
child: Text(
|
||||
"Inscription",
|
||||
style: isDesktop
|
||||
? STextStyles.labelExtraExtraSmall(context)
|
||||
: STextStyles.smallMed12(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: isDesktop ? 10 : 8,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: isDesktop ? 32 : 0),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(
|
||||
Constants.size.circularBorderRadius,
|
||||
),
|
||||
child: TextField(
|
||||
autocorrect: Util.isDesktop ? false : true,
|
||||
enableSuggestions: Util.isDesktop ? false : true,
|
||||
key: const Key("OrdinalsInscriptionFieldKey"),
|
||||
controller: _inscriptionTextEditingController,
|
||||
focusNode: inscriptionTextFieldFocusNode,
|
||||
onChanged: (_) => setState(() {}),
|
||||
style: isDesktop
|
||||
? STextStyles.desktopTextExtraSmall(context).copyWith(
|
||||
color:
|
||||
Theme.of(context).extension<StackColors>()!.textDark,
|
||||
height: 1.8,
|
||||
)
|
||||
: STextStyles.field(context),
|
||||
decoration: standardInputDecoration(
|
||||
"Enter inscription number...",
|
||||
keywordTextFieldFocusNode,
|
||||
context,
|
||||
desktopMed: isDesktop,
|
||||
).copyWith(
|
||||
contentPadding: isDesktop
|
||||
? const EdgeInsets.symmetric(
|
||||
vertical: 10,
|
||||
horizontal: 16,
|
||||
)
|
||||
: null,
|
||||
suffixIcon: _inscriptionTextEditingController.text.isNotEmpty
|
||||
? Padding(
|
||||
padding: const EdgeInsets.only(right: 0),
|
||||
child: UnconstrainedBox(
|
||||
child: Row(
|
||||
children: [
|
||||
TextFieldIconButton(
|
||||
child: const XIcon(),
|
||||
onTap: () async {
|
||||
setState(() {
|
||||
_inscriptionTextEditingController.text = "";
|
||||
});
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: isDesktop ? 32 : 24,
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: FittedBox(
|
||||
child: Text(
|
||||
"Keyword",
|
||||
style: isDesktop
|
||||
? STextStyles.labelExtraExtraSmall(context)
|
||||
: STextStyles.smallMed12(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: isDesktop ? 10 : 8,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: isDesktop ? 32 : 0),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(
|
||||
Constants.size.circularBorderRadius,
|
||||
),
|
||||
child: TextField(
|
||||
autocorrect: Util.isDesktop ? false : true,
|
||||
enableSuggestions: Util.isDesktop ? false : true,
|
||||
key: const Key("OrdinalsViewKeywordFieldKey"),
|
||||
controller: _keywordTextEditingController,
|
||||
focusNode: keywordTextFieldFocusNode,
|
||||
style: isDesktop
|
||||
? STextStyles.desktopTextExtraSmall(context).copyWith(
|
||||
color:
|
||||
Theme.of(context).extension<StackColors>()!.textDark,
|
||||
height: 1.8,
|
||||
)
|
||||
: STextStyles.field(context),
|
||||
onChanged: (_) => setState(() {}),
|
||||
decoration: standardInputDecoration(
|
||||
"Type keyword...",
|
||||
keywordTextFieldFocusNode,
|
||||
context,
|
||||
desktopMed: isDesktop,
|
||||
).copyWith(
|
||||
contentPadding: isDesktop
|
||||
? const EdgeInsets.symmetric(
|
||||
vertical: 10,
|
||||
horizontal: 16,
|
||||
)
|
||||
: null,
|
||||
suffixIcon: _keywordTextEditingController.text.isNotEmpty
|
||||
? Padding(
|
||||
padding: const EdgeInsets.only(right: 0),
|
||||
child: UnconstrainedBox(
|
||||
child: Row(
|
||||
children: [
|
||||
TextFieldIconButton(
|
||||
child: const XIcon(),
|
||||
onTap: () async {
|
||||
setState(() {
|
||||
_keywordTextEditingController.text = "";
|
||||
});
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (!isDesktop) const Spacer(),
|
||||
SizedBox(
|
||||
height: isDesktop ? 32 : 20,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SecondaryButton(
|
||||
label: "Cancel",
|
||||
buttonHeight: isDesktop ? ButtonHeight.l : null,
|
||||
onPressed: () async {
|
||||
if (!isDesktop) {
|
||||
if (FocusScope.of(context).hasFocus) {
|
||||
FocusScope.of(context).unfocus();
|
||||
await Future<void>.delayed(
|
||||
const Duration(
|
||||
milliseconds: 75,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
if (mounted) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 16,
|
||||
),
|
||||
Expanded(
|
||||
child: PrimaryButton(
|
||||
buttonHeight: isDesktop ? ButtonHeight.l : null,
|
||||
onPressed: () async {
|
||||
await _onApplyPressed();
|
||||
},
|
||||
label: "Save",
|
||||
),
|
||||
),
|
||||
if (isDesktop)
|
||||
const SizedBox(
|
||||
width: 32,
|
||||
),
|
||||
],
|
||||
),
|
||||
if (!isDesktop)
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _onApplyPressed() async {
|
||||
final filter = OrdinalFilter(
|
||||
// isPunk: _isPunk,
|
||||
// isMoonbird: _isMoonbird,
|
||||
from: _selectedFromDate,
|
||||
to: _selectedToDate,
|
||||
inscription: _inscriptionTextEditingController.text,
|
||||
keyword: _keywordTextEditingController.text,
|
||||
);
|
||||
|
||||
ref.read(ordinalFilterProvider.state).state = filter;
|
||||
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
}
|
202
lib/pages/ordinals/ordinals_view.dart
Normal file
|
@ -0,0 +1,202 @@
|
|||
/*
|
||||
* This file is part of Stack Wallet.
|
||||
*
|
||||
* Copyright (c) 2023 Cypher Stack
|
||||
* All Rights Reserved.
|
||||
* The code is distributed under GPLv3 license, see LICENSE file for details.
|
||||
* Generated by Cypher Stack on 2023-05-26
|
||||
*
|
||||
*/
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:stackwallet/pages/ordinals/widgets/ordinals_list.dart';
|
||||
import 'package:stackwallet/providers/global/wallets_provider.dart';
|
||||
import 'package:stackwallet/services/mixins/ordinals_interface.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/show_loading.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/widgets/background.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
|
||||
class OrdinalsView extends ConsumerStatefulWidget {
|
||||
const OrdinalsView({
|
||||
super.key,
|
||||
required this.walletId,
|
||||
});
|
||||
|
||||
static const routeName = "/ordinalsView";
|
||||
|
||||
final String walletId;
|
||||
|
||||
@override
|
||||
ConsumerState<OrdinalsView> createState() => _OrdinalsViewState();
|
||||
}
|
||||
|
||||
class _OrdinalsViewState extends ConsumerState<OrdinalsView> {
|
||||
late final TextEditingController searchController;
|
||||
late final FocusNode searchFocus;
|
||||
|
||||
String _searchTerm = "";
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
searchController = TextEditingController();
|
||||
searchFocus = FocusNode();
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
searchController.dispose();
|
||||
searchFocus.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Background(
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
backgroundColor:
|
||||
Theme.of(context).extension<StackColors>()!.background,
|
||||
appBar: AppBar(
|
||||
automaticallyImplyLeading: false,
|
||||
leading: const AppBarBackButton(),
|
||||
title: Text(
|
||||
"Ordinals",
|
||||
style: STextStyles.navBarTitle(context),
|
||||
),
|
||||
titleSpacing: 0,
|
||||
actions: [
|
||||
AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: AppBarIconButton(
|
||||
size: 36,
|
||||
icon: SvgPicture.asset(
|
||||
Assets.svg.arrowRotate,
|
||||
width: 20,
|
||||
height: 20,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.topNavIconPrimary,
|
||||
),
|
||||
onPressed: () async {
|
||||
// show loading for a minimum of 2 seconds on refreshing
|
||||
await showLoading(
|
||||
whileFuture: Future.wait<void>([
|
||||
Future.delayed(const Duration(seconds: 2)),
|
||||
(ref
|
||||
.read(walletsChangeNotifierProvider)
|
||||
.getManager(widget.walletId)
|
||||
.wallet as OrdinalsInterface)
|
||||
.refreshInscriptions()
|
||||
]),
|
||||
context: context,
|
||||
message: "Refreshing...",
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
// AspectRatio(
|
||||
// aspectRatio: 1,
|
||||
// child: AppBarIconButton(
|
||||
// size: 36,
|
||||
// icon: SvgPicture.asset(
|
||||
// Assets.svg.filter,
|
||||
// width: 20,
|
||||
// height: 20,
|
||||
// color: Theme.of(context)
|
||||
// .extension<StackColors>()!
|
||||
// .topNavIconPrimary,
|
||||
// ),
|
||||
// onPressed: () {
|
||||
// Navigator.of(context).pushNamed(
|
||||
// OrdinalsFilterView.routeName,
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 16,
|
||||
right: 16,
|
||||
top: 8,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
// ClipRRect(
|
||||
// borderRadius: BorderRadius.circular(
|
||||
// Constants.size.circularBorderRadius,
|
||||
// ),
|
||||
// child: TextField(
|
||||
// autocorrect: Util.isDesktop ? false : true,
|
||||
// enableSuggestions: Util.isDesktop ? false : true,
|
||||
// controller: searchController,
|
||||
// focusNode: searchFocus,
|
||||
// onChanged: (value) {
|
||||
// setState(() {
|
||||
// _searchTerm = value;
|
||||
// });
|
||||
// },
|
||||
// style: STextStyles.field(context),
|
||||
// decoration: standardInputDecoration(
|
||||
// "Search",
|
||||
// searchFocus,
|
||||
// context,
|
||||
// ).copyWith(
|
||||
// prefixIcon: Padding(
|
||||
// padding: const EdgeInsets.symmetric(
|
||||
// horizontal: 10,
|
||||
// vertical: 16,
|
||||
// ),
|
||||
// child: SvgPicture.asset(
|
||||
// Assets.svg.search,
|
||||
// width: 16,
|
||||
// height: 16,
|
||||
// ),
|
||||
// ),
|
||||
// suffixIcon: searchController.text.isNotEmpty
|
||||
// ? Padding(
|
||||
// padding: const EdgeInsets.only(right: 0),
|
||||
// child: UnconstrainedBox(
|
||||
// child: Row(
|
||||
// children: [
|
||||
// TextFieldIconButton(
|
||||
// child: const XIcon(),
|
||||
// onTap: () async {
|
||||
// setState(() {
|
||||
// searchController.text = "";
|
||||
// _searchTerm = "";
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
// : null,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// height: 16,
|
||||
// ),
|
||||
Expanded(
|
||||
child: OrdinalsList(
|
||||
walletId: widget.walletId,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
62
lib/pages/ordinals/widgets/dialogs.dart
Normal file
|
@ -0,0 +1,62 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
|
||||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||
|
||||
class SendOrdinalUnfreezeDialog extends StatelessWidget {
|
||||
const SendOrdinalUnfreezeDialog({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return StackDialog(
|
||||
title: "This ordinal is frozen",
|
||||
icon: SvgPicture.asset(
|
||||
Assets.svg.coinControl.blocked,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: Theme.of(context).extension<StackColors>()!.textDark,
|
||||
),
|
||||
message: "To send this ordinal, you must unfreeze it first.",
|
||||
leftButton: SecondaryButton(
|
||||
label: "Cancel",
|
||||
onPressed: Navigator.of(context).pop,
|
||||
),
|
||||
rightButton: PrimaryButton(
|
||||
label: "Unfreeze",
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop("unfreeze");
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class UnfreezeOrdinalDialog extends StatelessWidget {
|
||||
const UnfreezeOrdinalDialog({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return StackDialog(
|
||||
title: "Are you sure you want to unfreeze this ordinal?",
|
||||
icon: SvgPicture.asset(
|
||||
Assets.svg.coinControl.blocked,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: Theme.of(context).extension<StackColors>()!.textDark,
|
||||
),
|
||||
leftButton: SecondaryButton(
|
||||
label: "Cancel",
|
||||
onPressed: Navigator.of(context).pop,
|
||||
),
|
||||
rightButton: PrimaryButton(
|
||||
label: "Unfreeze",
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop("unfreeze");
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
63
lib/pages/ordinals/widgets/ordinal_card.dart
Normal file
|
@ -0,0 +1,63 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:stackwallet/models/isar/ordinal.dart';
|
||||
import 'package:stackwallet/pages/ordinals/ordinal_details_view.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/ordinals/desktop_ordinal_details_view.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/utilities/util.dart';
|
||||
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||
|
||||
class OrdinalCard extends StatelessWidget {
|
||||
const OrdinalCard({
|
||||
Key? key,
|
||||
required this.walletId,
|
||||
required this.ordinal,
|
||||
}) : super(key: key);
|
||||
|
||||
final String walletId;
|
||||
final Ordinal ordinal;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RoundedWhiteContainer(
|
||||
radiusMultiplier: 2,
|
||||
onPressed: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
Util.isDesktop
|
||||
? DesktopOrdinalDetailsView.routeName
|
||||
: OrdinalDetailsView.routeName,
|
||||
arguments: (walletId: walletId, ordinal: ordinal),
|
||||
);
|
||||
},
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(
|
||||
Constants.size.circularBorderRadius,
|
||||
),
|
||||
child: Image.network(
|
||||
ordinal.content, // Use the preview URL as the image source
|
||||
fit: BoxFit.cover,
|
||||
filterQuality:
|
||||
FilterQuality.none, // Set the filter mode to nearest
|
||||
),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
Text(
|
||||
'INSC. ${ordinal.inscriptionNumber}', // infer from address associated with utxoTXID
|
||||
style: STextStyles.w500_12(context),
|
||||
),
|
||||
// const Spacer(),
|
||||
// Text(
|
||||
// "ID ${ordinal.inscriptionId}",
|
||||
// style: STextStyles.w500_8(context),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
119
lib/pages/ordinals/widgets/ordinals_list.dart
Normal file
|
@ -0,0 +1,119 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:stackwallet/models/isar/ordinal.dart';
|
||||
import 'package:stackwallet/pages/ordinals/widgets/ordinal_card.dart';
|
||||
import 'package:stackwallet/providers/db/main_db_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/utilities/util.dart';
|
||||
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||
|
||||
class OrdinalsList extends ConsumerStatefulWidget {
|
||||
const OrdinalsList({
|
||||
Key? key,
|
||||
required this.walletId,
|
||||
}) : super(key: key);
|
||||
|
||||
final String walletId;
|
||||
|
||||
@override
|
||||
ConsumerState<OrdinalsList> createState() => _OrdinalsListState();
|
||||
}
|
||||
|
||||
class _OrdinalsListState extends ConsumerState<OrdinalsList> {
|
||||
final double _spacing = Util.isDesktop ? 16 : 10;
|
||||
|
||||
late List<Ordinal> _data;
|
||||
|
||||
late final Stream<List<Ordinal>?> _stream;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_stream = ref
|
||||
.read(mainDBProvider)
|
||||
.isar
|
||||
.ordinals
|
||||
.where()
|
||||
.filter()
|
||||
.walletIdEqualTo(widget.walletId)
|
||||
.watch();
|
||||
|
||||
_data = ref
|
||||
.read(mainDBProvider)
|
||||
.isar
|
||||
.ordinals
|
||||
.where()
|
||||
.filter()
|
||||
.walletIdEqualTo(widget.walletId)
|
||||
.findAllSync();
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return StreamBuilder<List<Ordinal>?>(
|
||||
stream: _stream,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasData) {
|
||||
_data = snapshot.data!;
|
||||
}
|
||||
|
||||
if (_data.isEmpty) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
RoundedWhiteContainer(
|
||||
child: Center(
|
||||
child: Text(
|
||||
"Your ordinals will appear here",
|
||||
style: Util.isDesktop
|
||||
? STextStyles.w500_14(context).copyWith(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textSubtitle1)
|
||||
: STextStyles.label(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
if (Util.isDesktop) {
|
||||
return Wrap(
|
||||
spacing: _spacing,
|
||||
runSpacing: _spacing,
|
||||
children: _data
|
||||
.map((e) => SizedBox(
|
||||
width: 220,
|
||||
height: 270,
|
||||
child: OrdinalCard(
|
||||
walletId: widget.walletId,
|
||||
ordinal: e,
|
||||
)))
|
||||
.toList(),
|
||||
);
|
||||
} else {
|
||||
return GridView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: _data.length,
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisSpacing: _spacing,
|
||||
mainAxisSpacing: _spacing,
|
||||
crossAxisCount: Util.isDesktop ? 4 : 2,
|
||||
childAspectRatio: 6 / 7, // was 3/4, less data displayed now
|
||||
),
|
||||
itemBuilder: (_, i) => OrdinalCard(
|
||||
walletId: widget.walletId,
|
||||
ordinal: _data[i],
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
|
@ -493,51 +493,54 @@ class _ConfirmTransactionViewState
|
|||
],
|
||||
),
|
||||
),
|
||||
if (coin == Coin.epicCash)
|
||||
if (coin == Coin.epicCash &&
|
||||
(transactionInfo["onChainNote"] as String).isNotEmpty)
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
if (coin == Coin.epicCash)
|
||||
if (coin == Coin.epicCash &&
|
||||
(transactionInfo["onChainNote"] as String).isNotEmpty)
|
||||
RoundedWhiteContainer(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
"On chain note",
|
||||
style: STextStyles.smallMed12(context),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Text(
|
||||
transactionInfo["onChainNote"] as String,
|
||||
style: STextStyles.itemSubtitle12(context),
|
||||
),
|
||||
],
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
"On chain note",
|
||||
style: STextStyles.smallMed12(context),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Text(
|
||||
transactionInfo["onChainNote"] as String,
|
||||
style: STextStyles.itemSubtitle12(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
RoundedWhiteContainer(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
(coin == Coin.epicCash) ? "Local Note" :
|
||||
"Note",
|
||||
style: STextStyles.smallMed12(context),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Text(
|
||||
transactionInfo["note"] as String,
|
||||
style: STextStyles.itemSubtitle12(context),
|
||||
),
|
||||
],
|
||||
if ((transactionInfo["note"] as String).isNotEmpty)
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
if ((transactionInfo["note"] as String).isNotEmpty)
|
||||
RoundedWhiteContainer(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
(coin == Coin.epicCash) ? "Local Note" : "Note",
|
||||
style: STextStyles.smallMed12(context),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Text(
|
||||
transactionInfo["note"] as String,
|
||||
style: STextStyles.itemSubtitle12(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (isDesktop)
|
||||
|
|
|
@ -164,7 +164,7 @@ class _InstallThemeFromFileDialogState
|
|||
);
|
||||
if (mounted) {
|
||||
Navigator.of(context).pop();
|
||||
if (!result) {
|
||||
if (!result!) {
|
||||
unawaited(
|
||||
showDialog(
|
||||
context: context,
|
||||
|
|
|
@ -72,11 +72,11 @@ class _StackThemeCardState extends ConsumerState<StackThemeCard> {
|
|||
}
|
||||
|
||||
Future<void> _downloadPressed() async {
|
||||
final result = await showLoading(
|
||||
final result = (await showLoading(
|
||||
whileFuture: _downloadAndInstall(),
|
||||
context: context,
|
||||
message: "Downloading and installing theme...",
|
||||
);
|
||||
))!;
|
||||
|
||||
if (mounted) {
|
||||
final message = result
|
||||
|
|
|
@ -20,11 +20,12 @@ import 'package:stackwallet/pages/home_view/home_view.dart';
|
|||
import 'package:stackwallet/pages/pinpad_views/lock_screen_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/debug_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_preferences_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/global_settings_view/xpub_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/sub_widgets/settings_list_button.dart';
|
||||
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/change_representative_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/wallet_settings_wallet_settings_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/xpub_view.dart';
|
||||
import 'package:stackwallet/providers/global/wallets_provider.dart';
|
||||
import 'package:stackwallet/providers/ui/transaction_filter_provider.dart';
|
||||
import 'package:stackwallet/route_generator.dart';
|
||||
|
@ -231,7 +232,7 @@ class _WalletSettingsViewState extends ConsumerState<WalletSettingsView> {
|
|||
.mnemonic;
|
||||
|
||||
if (mounted) {
|
||||
Navigator.push(
|
||||
await Navigator.push(
|
||||
context,
|
||||
RouteGenerator.getRoute(
|
||||
shouldUseMaterialRoute:
|
||||
|
@ -305,6 +306,25 @@ class _WalletSettingsViewState extends ConsumerState<WalletSettingsView> {
|
|||
);
|
||||
},
|
||||
),
|
||||
if (coin == Coin.nano || coin == Coin.banano)
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
if (coin == Coin.nano || coin == Coin.banano)
|
||||
Consumer(
|
||||
builder: (_, ref, __) {
|
||||
return SettingsListButton(
|
||||
iconAssetName: Assets.svg.eye,
|
||||
title: "Change representative",
|
||||
onPressed: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
ChangeRepresentativeView.routeName,
|
||||
arguments: widget.walletId,
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
|
@ -434,18 +454,20 @@ class _EpiBoxInfoFormState extends ConsumerState<EpicBoxInfoForm> {
|
|||
TextButton(
|
||||
onPressed: () async {
|
||||
try {
|
||||
wallet.updateEpicboxConfig(
|
||||
await wallet.updateEpicboxConfig(
|
||||
hostController.text,
|
||||
int.parse(portController.text),
|
||||
);
|
||||
showFloatingFlushBar(
|
||||
context: context,
|
||||
message: "Epicbox info saved!",
|
||||
type: FlushBarType.success,
|
||||
);
|
||||
wallet.refresh();
|
||||
if (mounted) {
|
||||
await showFloatingFlushBar(
|
||||
context: context,
|
||||
message: "Epicbox info saved!",
|
||||
type: FlushBarType.success,
|
||||
);
|
||||
}
|
||||
unawaited(wallet.refresh());
|
||||
} catch (e) {
|
||||
showFloatingFlushBar(
|
||||
await showFloatingFlushBar(
|
||||
context: context,
|
||||
message: "Failed to save epicbox info: $e",
|
||||
type: FlushBarType.warning,
|
||||
|
|
|
@ -0,0 +1,402 @@
|
|||
/*
|
||||
* This file is part of Stack Wallet.
|
||||
*
|
||||
* Copyright (c) 2023 Cypher Stack
|
||||
* All Rights Reserved.
|
||||
* The code is distributed under GPLv3 license, see LICENSE file for details.
|
||||
* Generated by Cypher Stack on 2023-05-26
|
||||
*
|
||||
*/
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:stackwallet/notifications/show_flush_bar.dart';
|
||||
import 'package:stackwallet/providers/global/wallets_provider.dart';
|
||||
import 'package:stackwallet/services/coins/banano/banano_wallet.dart';
|
||||
import 'package:stackwallet/services/coins/nano/nano_wallet.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/clipboard_interface.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/show_loading.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/utilities/util.dart';
|
||||
import 'package:stackwallet/widgets/background.dart';
|
||||
import 'package:stackwallet/widgets/conditional_parent.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
import 'package:stackwallet/widgets/icon_widgets/x_icon.dart';
|
||||
import 'package:stackwallet/widgets/loading_indicator.dart';
|
||||
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||
import 'package:stackwallet/widgets/stack_text_field.dart';
|
||||
import 'package:stackwallet/widgets/textfield_icon_button.dart';
|
||||
|
||||
class ChangeRepresentativeView extends ConsumerStatefulWidget {
|
||||
const ChangeRepresentativeView({
|
||||
Key? key,
|
||||
required this.walletId,
|
||||
this.clipboardInterface = const ClipboardWrapper(),
|
||||
}) : super(key: key);
|
||||
|
||||
final String walletId;
|
||||
final ClipboardInterface clipboardInterface;
|
||||
|
||||
static const String routeName = "/changeRepresentative";
|
||||
|
||||
@override
|
||||
ConsumerState<ChangeRepresentativeView> createState() => _XPubViewState();
|
||||
}
|
||||
|
||||
class _XPubViewState extends ConsumerState<ChangeRepresentativeView> {
|
||||
final _textController = TextEditingController();
|
||||
final _textFocusNode = FocusNode();
|
||||
final bool isDesktop = Util.isDesktop;
|
||||
|
||||
late ClipboardInterface _clipboardInterface;
|
||||
|
||||
String? representative;
|
||||
|
||||
Future<String> loadRepresentative() async {
|
||||
final manager =
|
||||
ref.read(walletsChangeNotifierProvider).getManager(widget.walletId);
|
||||
|
||||
if (manager.coin == Coin.nano) {
|
||||
return (manager.wallet as NanoWallet).getCurrentRepresentative();
|
||||
} else if (manager.coin == Coin.banano) {
|
||||
return (manager.wallet as BananoWallet).getCurrentRepresentative();
|
||||
}
|
||||
throw Exception("Unsupported wallet attempted to show representative!");
|
||||
}
|
||||
|
||||
Future<void> _save() async {
|
||||
final manager =
|
||||
ref.read(walletsChangeNotifierProvider).getManager(widget.walletId);
|
||||
|
||||
final changeFuture = manager.coin == Coin.nano
|
||||
? (manager.wallet as NanoWallet).changeRepresentative
|
||||
: (manager.wallet as BananoWallet).changeRepresentative;
|
||||
|
||||
final result = await showLoading(
|
||||
whileFuture: changeFuture(_textController.text),
|
||||
context: context,
|
||||
message: "Updating representative...",
|
||||
isDesktop: Util.isDesktop,
|
||||
onException: (ex) {
|
||||
String msg = ex.toString();
|
||||
while (msg.isNotEmpty && msg.startsWith("Exception:")) {
|
||||
msg = msg.substring(10).trim();
|
||||
}
|
||||
showFloatingFlushBar(
|
||||
type: FlushBarType.warning,
|
||||
message: msg,
|
||||
context: context,
|
||||
);
|
||||
});
|
||||
|
||||
if (mounted) {
|
||||
if (result != null && result) {
|
||||
setState(() {
|
||||
representative = _textController.text;
|
||||
_textController.text = "";
|
||||
});
|
||||
await showFloatingFlushBar(
|
||||
type: FlushBarType.success,
|
||||
message: "Representative changed",
|
||||
context: context,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_clipboardInterface = widget.clipboardInterface;
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_textController.dispose();
|
||||
_textFocusNode.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> _copy() async {
|
||||
await _clipboardInterface
|
||||
.setData(ClipboardData(text: representative ?? ""));
|
||||
if (mounted) {
|
||||
unawaited(showFloatingFlushBar(
|
||||
type: FlushBarType.info,
|
||||
message: "Copied to clipboard",
|
||||
iconAsset: Assets.svg.copy,
|
||||
context: context,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ConditionalParent(
|
||||
condition: !isDesktop,
|
||||
builder: (child) => Background(
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
backgroundColor:
|
||||
Theme.of(context).extension<StackColors>()!.background,
|
||||
appBar: AppBar(
|
||||
leading: AppBarBackButton(
|
||||
onPressed: () async {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
title: Text(
|
||||
"Wallet representative",
|
||||
style: STextStyles.navBarTitle(context),
|
||||
),
|
||||
actions: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: AppBarIconButton(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.background,
|
||||
shadows: const [],
|
||||
icon: SvgPicture.asset(
|
||||
Assets.svg.copy,
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.topNavIconPrimary,
|
||||
),
|
||||
onPressed: () {
|
||||
if (representative != null) {
|
||||
_copy();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 12,
|
||||
left: 16,
|
||||
right: 16,
|
||||
),
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
child: ConditionalParent(
|
||||
condition: isDesktop,
|
||||
builder: (child) => DesktopDialog(
|
||||
maxWidth: 600,
|
||||
maxHeight: double.infinity,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 32,
|
||||
),
|
||||
child: Text(
|
||||
"Change representative",
|
||||
style: STextStyles.desktopH2(context),
|
||||
),
|
||||
),
|
||||
DesktopDialogCloseButton(
|
||||
onPressedOverride: Navigator.of(
|
||||
context,
|
||||
rootNavigator: true,
|
||||
).pop,
|
||||
),
|
||||
],
|
||||
),
|
||||
AnimatedSize(
|
||||
duration: const Duration(
|
||||
milliseconds: 150,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(32, 0, 32, 32),
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
if (isDesktop) const SizedBox(height: 24),
|
||||
ConditionalParent(
|
||||
condition: !isDesktop,
|
||||
builder: (child) => Expanded(
|
||||
child: child,
|
||||
),
|
||||
child: FutureBuilder(
|
||||
future: loadRepresentative(),
|
||||
builder: (context, AsyncSnapshot<String> snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done &&
|
||||
snapshot.hasData) {
|
||||
representative = snapshot.data!;
|
||||
}
|
||||
|
||||
const height = 600.0;
|
||||
Widget child;
|
||||
if (representative == null) {
|
||||
child = const SizedBox(
|
||||
key: Key("loadingRepresentative"),
|
||||
height: height,
|
||||
child: Center(
|
||||
child: LoadingIndicator(
|
||||
width: 100,
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
child = Column(
|
||||
children: [
|
||||
ConditionalParent(
|
||||
condition: !isDesktop,
|
||||
builder: (child) => RoundedWhiteContainer(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
child,
|
||||
],
|
||||
),
|
||||
),
|
||||
child: ConditionalParent(
|
||||
condition: isDesktop,
|
||||
builder: (child) => Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Current representative",
|
||||
style: STextStyles.desktopTextExtraExtraSmall(
|
||||
context),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
child,
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
child: SelectableText(
|
||||
representative!,
|
||||
style: isDesktop
|
||||
? STextStyles.desktopTextExtraExtraSmall(
|
||||
context)
|
||||
.copyWith(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textDark,
|
||||
)
|
||||
: STextStyles.itemSubtitle12(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(
|
||||
Constants.size.circularBorderRadius,
|
||||
),
|
||||
child: TextField(
|
||||
autocorrect: Util.isDesktop ? false : true,
|
||||
enableSuggestions: Util.isDesktop ? false : true,
|
||||
controller: _textController,
|
||||
style: isDesktop
|
||||
? STextStyles.desktopTextExtraSmall(context)
|
||||
.copyWith(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFieldActiveText,
|
||||
height: 1.8,
|
||||
)
|
||||
: STextStyles.field(context),
|
||||
focusNode: _textFocusNode,
|
||||
decoration: standardInputDecoration(
|
||||
"Enter new representative",
|
||||
_textFocusNode,
|
||||
context,
|
||||
desktopMed: isDesktop,
|
||||
).copyWith(
|
||||
contentPadding: isDesktop
|
||||
? const EdgeInsets.only(
|
||||
left: 16,
|
||||
top: 11,
|
||||
bottom: 12,
|
||||
right: 5,
|
||||
)
|
||||
: null,
|
||||
suffixIcon: _textController.text.isNotEmpty
|
||||
? Padding(
|
||||
padding: const EdgeInsets.only(right: 0),
|
||||
child: UnconstrainedBox(
|
||||
child: Row(
|
||||
children: [
|
||||
TextFieldIconButton(
|
||||
child: const XIcon(),
|
||||
onTap: () async {
|
||||
setState(() {
|
||||
_textController.text = "";
|
||||
});
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (isDesktop) const SizedBox(height: 60),
|
||||
if (!isDesktop) const Spacer(),
|
||||
PrimaryButton(
|
||||
label: "Save",
|
||||
onPressed: _save,
|
||||
),
|
||||
if (!isDesktop)
|
||||
const SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
return AnimatedSwitcher(
|
||||
duration: const Duration(
|
||||
milliseconds: 200,
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -100,7 +100,7 @@ class _MyTokenSelectItemState extends ConsumerState<MyTokenSelectItem> {
|
|||
message: "Loading ${widget.token.name}",
|
||||
);
|
||||
|
||||
if (!success) {
|
||||
if (!success!) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -121,7 +121,8 @@ class WalletBalanceToggleSheet extends ConsumerWidget {
|
|||
height: 24,
|
||||
),
|
||||
BalanceSelector(
|
||||
title: "Available balance",
|
||||
title:
|
||||
"Available${balanceSecondary != null ? " public" : ""} balance",
|
||||
coin: coin,
|
||||
balance: balance.spendable,
|
||||
onPressed: () {
|
||||
|
@ -141,6 +142,31 @@ class WalletBalanceToggleSheet extends ConsumerWidget {
|
|||
value: _BalanceType.available,
|
||||
groupValue: _bal,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
BalanceSelector(
|
||||
title:
|
||||
"Full${balanceSecondary != null ? " public" : ""} balance",
|
||||
coin: coin,
|
||||
balance: balance.total,
|
||||
onPressed: () {
|
||||
ref.read(walletBalanceToggleStateProvider.state).state =
|
||||
WalletBalanceToggleState.full;
|
||||
ref.read(publicPrivateBalanceStateProvider.state).state =
|
||||
"Public";
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
onChanged: (_) {
|
||||
ref.read(walletBalanceToggleStateProvider.state).state =
|
||||
WalletBalanceToggleState.full;
|
||||
ref.read(publicPrivateBalanceStateProvider.state).state =
|
||||
"Public";
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
value: _BalanceType.full,
|
||||
groupValue: _bal,
|
||||
),
|
||||
if (balanceSecondary != null)
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
|
@ -167,30 +193,6 @@ class WalletBalanceToggleSheet extends ConsumerWidget {
|
|||
value: _BalanceType.privateAvailable,
|
||||
groupValue: _bal,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
BalanceSelector(
|
||||
title: "Full balance",
|
||||
coin: coin,
|
||||
balance: balance.total,
|
||||
onPressed: () {
|
||||
ref.read(walletBalanceToggleStateProvider.state).state =
|
||||
WalletBalanceToggleState.full;
|
||||
ref.read(publicPrivateBalanceStateProvider.state).state =
|
||||
"Public";
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
onChanged: (_) {
|
||||
ref.read(walletBalanceToggleStateProvider.state).state =
|
||||
WalletBalanceToggleState.full;
|
||||
ref.read(publicPrivateBalanceStateProvider.state).state =
|
||||
"Public";
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
value: _BalanceType.full,
|
||||
groupValue: _bal,
|
||||
),
|
||||
if (balanceSecondary != null)
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
|
|
|
@ -52,6 +52,7 @@ class WalletSummary extends StatelessWidget {
|
|||
walletId: walletId,
|
||||
width: constraints.maxWidth,
|
||||
height: constraints.maxHeight,
|
||||
isFavorite: false,
|
||||
),
|
||||
Positioned.fill(
|
||||
child: Padding(
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
@ -19,6 +20,7 @@ import 'package:stackwallet/pages/wallet_view/sub_widgets/wallet_refresh_button.
|
|||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/providers/wallet/public_private_balance_state_provider.dart';
|
||||
import 'package:stackwallet/providers/wallet/wallet_balance_toggle_state_provider.dart';
|
||||
import 'package:stackwallet/services/coins/banano/banano_wallet.dart';
|
||||
import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
|
||||
import 'package:stackwallet/services/event_bus/events/global/balance_refreshed_event.dart';
|
||||
import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart';
|
||||
|
@ -31,6 +33,7 @@ import 'package:stackwallet/utilities/assets.dart';
|
|||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/enums/wallet_balance_toggle_state.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/widgets/conditional_parent.dart';
|
||||
|
||||
class WalletSummaryInfo extends ConsumerStatefulWidget {
|
||||
const WalletSummaryInfo({
|
||||
|
@ -49,6 +52,8 @@ class WalletSummaryInfo extends ConsumerStatefulWidget {
|
|||
class _WalletSummaryInfoState extends ConsumerState<WalletSummaryInfo> {
|
||||
late StreamSubscription<BalanceRefreshedEvent> _balanceUpdated;
|
||||
|
||||
String receivingAddress = "";
|
||||
|
||||
void showSheet() {
|
||||
showModalBottomSheet<dynamic>(
|
||||
backgroundColor: Colors.transparent,
|
||||
|
@ -72,6 +77,17 @@ class _WalletSummaryInfoState extends ConsumerState<WalletSummaryInfo> {
|
|||
}
|
||||
},
|
||||
);
|
||||
|
||||
// managerProvider = widget.managerProvider;
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
|
||||
final address = await ref
|
||||
.read(walletsChangeNotifierProvider)
|
||||
.getManager(widget.walletId)
|
||||
.currentReceivingAddress;
|
||||
setState(() {
|
||||
receivingAddress = address;
|
||||
});
|
||||
});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
@ -85,10 +101,14 @@ class _WalletSummaryInfoState extends ConsumerState<WalletSummaryInfo> {
|
|||
Widget build(BuildContext context) {
|
||||
debugPrint("BUILD: $runtimeType");
|
||||
|
||||
bool isMonkey = true;
|
||||
|
||||
final manager = ref.watch(walletsChangeNotifierProvider
|
||||
.select((value) => value.getManager(widget.walletId)));
|
||||
|
||||
final externalCalls = ref.watch(
|
||||
prefsChangeNotifierProvider.select((value) => value.externalCalls));
|
||||
final coin = ref.watch(walletsChangeNotifierProvider
|
||||
.select((value) => value.getManager(widget.walletId).coin));
|
||||
final coin = manager.coin;
|
||||
final balance = ref.watch(walletsChangeNotifierProvider
|
||||
.select((value) => value.getManager(widget.walletId).balance));
|
||||
|
||||
|
@ -125,84 +145,104 @@ class _WalletSummaryInfoState extends ConsumerState<WalletSummaryInfo> {
|
|||
title = _showAvailable ? "Available balance" : "Full balance";
|
||||
}
|
||||
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: showSheet,
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: STextStyles.subtitle500(context).copyWith(
|
||||
List<int>? imageBytes;
|
||||
|
||||
if (coin == Coin.banano) {
|
||||
imageBytes = (manager.wallet as BananoWallet).getMonkeyImageBytes();
|
||||
}
|
||||
|
||||
return ConditionalParent(
|
||||
condition: imageBytes != null,
|
||||
builder: (child) => Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
left: 150.0,
|
||||
child: SvgPicture.memory(
|
||||
Uint8List.fromList(imageBytes!),
|
||||
),
|
||||
),
|
||||
child,
|
||||
],
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: showSheet,
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: STextStyles.subtitle500(context).copyWith(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFavoriteCard,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 4,
|
||||
),
|
||||
SvgPicture.asset(
|
||||
Assets.svg.chevronDown,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFavoriteCard,
|
||||
width: 8,
|
||||
height: 4,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 4,
|
||||
),
|
||||
SvgPicture.asset(
|
||||
Assets.svg.chevronDown,
|
||||
],
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: SelectableText(
|
||||
ref.watch(pAmountFormatter(coin)).format(balanceToShow),
|
||||
style: STextStyles.pageTitleH1(context).copyWith(
|
||||
fontSize: 24,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFavoriteCard,
|
||||
width: 8,
|
||||
height: 4,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (externalCalls)
|
||||
Text(
|
||||
"${(priceTuple.item1 * balanceToShow.decimal).toAmount(
|
||||
fractionDigits: 2,
|
||||
).fiatString(
|
||||
locale: locale,
|
||||
)} $baseCurrency",
|
||||
style: STextStyles.subtitle500(context).copyWith(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFavoriteCard,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
SvgPicture.file(
|
||||
File(
|
||||
ref.watch(coinIconProvider(coin)),
|
||||
),
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
const Spacer(),
|
||||
FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: SelectableText(
|
||||
ref.watch(pAmountFormatter(coin)).format(balanceToShow),
|
||||
style: STextStyles.pageTitleH1(context).copyWith(
|
||||
fontSize: 24,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFavoriteCard,
|
||||
),
|
||||
),
|
||||
WalletRefreshButton(
|
||||
walletId: widget.walletId,
|
||||
initialSyncStatus: widget.initialSyncStatus,
|
||||
),
|
||||
if (externalCalls)
|
||||
Text(
|
||||
"${(priceTuple.item1 * balanceToShow.decimal).toAmount(
|
||||
fractionDigits: 2,
|
||||
).fiatString(
|
||||
locale: locale,
|
||||
)} $baseCurrency",
|
||||
style: STextStyles.subtitle500(context).copyWith(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFavoriteCard,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
SvgPicture.file(
|
||||
File(
|
||||
ref.watch(coinIconProvider(coin)),
|
||||
),
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
const Spacer(),
|
||||
WalletRefreshButton(
|
||||
walletId: widget.walletId,
|
||||
initialSyncStatus: widget.initialSyncStatus,
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -358,7 +358,6 @@ class _TransactionDetailsViewState
|
|||
final currentHeight = ref.watch(walletsChangeNotifierProvider
|
||||
.select((value) => value.getManager(walletId).currentHeight));
|
||||
|
||||
|
||||
print("THIS TRANSACTION IS $_transaction");
|
||||
|
||||
return ConditionalParent(
|
||||
|
@ -474,7 +473,9 @@ class _TransactionDetailsViewState
|
|||
),
|
||||
SelectableText(
|
||||
_transaction.isCancelled
|
||||
? "Cancelled"
|
||||
? coin == Coin.ethereum
|
||||
? "Failed"
|
||||
: "Cancelled"
|
||||
: whatIsIt(
|
||||
_transaction,
|
||||
currentHeight,
|
||||
|
@ -585,7 +586,9 @@ class _TransactionDetailsViewState
|
|||
// child:
|
||||
SelectableText(
|
||||
_transaction.isCancelled
|
||||
? "Cancelled"
|
||||
? coin == Coin.ethereum
|
||||
? "Failed"
|
||||
: "Cancelled"
|
||||
: whatIsIt(
|
||||
_transaction,
|
||||
currentHeight,
|
||||
|
@ -781,8 +784,8 @@ class _TransactionDetailsViewState
|
|||
isDesktop
|
||||
? const _Divider()
|
||||
: const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
height: 12,
|
||||
),
|
||||
if (coin == Coin.epicCash)
|
||||
RoundedWhiteContainer(
|
||||
padding: isDesktop
|
||||
|
@ -790,22 +793,22 @@ class _TransactionDetailsViewState
|
|||
: const EdgeInsets.all(12),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"On chain note",
|
||||
style: isDesktop
|
||||
? STextStyles
|
||||
.desktopTextExtraExtraSmall(
|
||||
context)
|
||||
.desktopTextExtraExtraSmall(
|
||||
context)
|
||||
: STextStyles.itemSubtitle(
|
||||
context),
|
||||
context),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
|
@ -814,18 +817,16 @@ class _TransactionDetailsViewState
|
|||
_transaction.otherData ?? "",
|
||||
style: isDesktop
|
||||
? STextStyles
|
||||
.desktopTextExtraExtraSmall(
|
||||
context)
|
||||
.copyWith(
|
||||
color: Theme.of(
|
||||
context)
|
||||
.extension<
|
||||
StackColors>()!
|
||||
.textDark,
|
||||
)
|
||||
: STextStyles
|
||||
.itemSubtitle12(
|
||||
context),
|
||||
.desktopTextExtraExtraSmall(
|
||||
context)
|
||||
.copyWith(
|
||||
color: Theme.of(context)
|
||||
.extension<
|
||||
StackColors>()!
|
||||
.textDark,
|
||||
)
|
||||
: STextStyles.itemSubtitle12(
|
||||
context),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -854,7 +855,9 @@ class _TransactionDetailsViewState
|
|||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
(coin == Coin.epicCash) ? "Local Note" : "Note ",
|
||||
(coin == Coin.epicCash)
|
||||
? "Local Note"
|
||||
: "Note ",
|
||||
style: isDesktop
|
||||
? STextStyles
|
||||
.desktopTextExtraExtraSmall(
|
||||
|
@ -923,7 +926,9 @@ class _TransactionDetailsViewState
|
|||
notesServiceChangeNotifierProvider(
|
||||
walletId)
|
||||
.select((value) => value.getNoteFor(
|
||||
txid: (coin == Coin.epicCash)? _transaction.slateId! : _transaction.txid ))),
|
||||
txid: (coin == Coin.epicCash)
|
||||
? _transaction.slateId!
|
||||
: _transaction.txid))),
|
||||
builder: (builderContext,
|
||||
AsyncSnapshot<String> snapshot) {
|
||||
if (snapshot.connectionState ==
|
||||
|
|
|
@ -22,7 +22,9 @@ import 'package:stackwallet/pages/buy_view/buy_in_wallet_view.dart';
|
|||
import 'package:stackwallet/pages/coin_control/coin_control_view.dart';
|
||||
import 'package:stackwallet/pages/exchange_view/wallet_initiated_exchange_view.dart';
|
||||
import 'package:stackwallet/pages/home_view/home_view.dart';
|
||||
import 'package:stackwallet/pages/monkey/monkey_view.dart';
|
||||
import 'package:stackwallet/pages/notification_views/notifications_view.dart';
|
||||
import 'package:stackwallet/pages/ordinals/ordinals_view.dart';
|
||||
import 'package:stackwallet/pages/paynym/paynym_claim_view.dart';
|
||||
import 'package:stackwallet/pages/paynym/paynym_home_view.dart';
|
||||
import 'package:stackwallet/pages/receive_view/receive_view.dart';
|
||||
|
@ -72,6 +74,7 @@ import 'package:stackwallet/widgets/stack_dialog.dart';
|
|||
import 'package:stackwallet/widgets/wallet_navigation_bar/components/icons/buy_nav_icon.dart';
|
||||
import 'package:stackwallet/widgets/wallet_navigation_bar/components/icons/coin_control_nav_icon.dart';
|
||||
import 'package:stackwallet/widgets/wallet_navigation_bar/components/icons/exchange_nav_icon.dart';
|
||||
import 'package:stackwallet/widgets/wallet_navigation_bar/components/icons/ordinals_nav_icon.dart';
|
||||
import 'package:stackwallet/widgets/wallet_navigation_bar/components/icons/paynym_nav_icon.dart';
|
||||
import 'package:stackwallet/widgets/wallet_navigation_bar/components/icons/receive_nav_icon.dart';
|
||||
import 'package:stackwallet/widgets/wallet_navigation_bar/components/icons/send_nav_icon.dart';
|
||||
|
@ -924,6 +927,22 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
);
|
||||
},
|
||||
),
|
||||
WalletNavigationBarItemData(
|
||||
icon: SvgPicture.asset(
|
||||
Assets.svg.monkey,
|
||||
height: 20,
|
||||
width: 20,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.bottomNavIconIcon,
|
||||
),
|
||||
label: "MonKey",
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
MonkeyView.routeName,
|
||||
arguments: widget.walletId,
|
||||
);
|
||||
}),
|
||||
if (ref.watch(
|
||||
walletsChangeNotifierProvider.select(
|
||||
(value) => value
|
||||
|
@ -1007,6 +1026,22 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
}
|
||||
},
|
||||
),
|
||||
if (ref.watch(
|
||||
walletsChangeNotifierProvider.select(
|
||||
(value) =>
|
||||
value.getManager(widget.walletId).hasOrdinalsSupport,
|
||||
),
|
||||
))
|
||||
WalletNavigationBarItemData(
|
||||
label: "Ordinals",
|
||||
icon: const OrdinalsNavIcon(),
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
OrdinalsView.routeName,
|
||||
arguments: widget.walletId,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
|
|
@ -149,6 +149,7 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
|
|||
walletId: widget.walletId,
|
||||
width: widget.width,
|
||||
height: widget.height,
|
||||
isFavorite: true,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
|
|
|
@ -16,12 +16,14 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:stackwallet/notifications/show_flush_bar.dart';
|
||||
import 'package:stackwallet/pages/monkey/monkey_view.dart';
|
||||
import 'package:stackwallet/pages/paynym/paynym_claim_view.dart';
|
||||
import 'package:stackwallet/pages/paynym/paynym_home_view.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/coin_control/desktop_coin_control_view.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/desktop_menu.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/desktop_wallet_view.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/more_features/more_features_dialog.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/ordinals/desktop_ordinals_view.dart';
|
||||
import 'package:stackwallet/providers/desktop/current_desktop_menu_item.dart';
|
||||
import 'package:stackwallet/providers/global/paynym_api_provider.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
|
@ -80,6 +82,8 @@ class _DesktopWalletFeaturesState extends ConsumerState<DesktopWalletFeatures> {
|
|||
onCoinControlPressed: _onCoinControlPressed,
|
||||
onAnonymizeAllPressed: _onAnonymizeAllPressed,
|
||||
onWhirlpoolPressed: _onWhirlpoolPressed,
|
||||
onOrdinalsPressed: _onOrdinalsPressed,
|
||||
onMonkeyPressed: _onMonkeyPressed,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -313,6 +317,24 @@ class _DesktopWalletFeaturesState extends ConsumerState<DesktopWalletFeatures> {
|
|||
}
|
||||
}
|
||||
|
||||
Future<void> _onMonkeyPressed() async {
|
||||
Navigator.of(context, rootNavigator: true).pop();
|
||||
|
||||
await (Navigator.of(context).pushNamed(
|
||||
MonkeyView.routeName,
|
||||
arguments: widget.walletId,
|
||||
));
|
||||
}
|
||||
|
||||
void _onOrdinalsPressed() {
|
||||
Navigator.of(context, rootNavigator: true).pop();
|
||||
|
||||
Navigator.of(context).pushNamed(
|
||||
DesktopOrdinalsView.routeName,
|
||||
arguments: widget.walletId,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final manager = ref.watch(
|
||||
|
@ -330,8 +352,9 @@ class _DesktopWalletFeaturesState extends ConsumerState<DesktopWalletFeatures> {
|
|||
)) ||
|
||||
manager.coin == Coin.firo ||
|
||||
manager.coin == Coin.firoTestNet ||
|
||||
manager.hasWhirlpoolSupport ||
|
||||
manager.coin == Coin.banano ||
|
||||
manager.hasWhirlpoolSupport;
|
||||
|
||||
return Row(
|
||||
children: [
|
||||
if (Constants.enableExchange)
|
||||
|
|
|
@ -29,6 +29,8 @@ class MoreFeaturesDialog extends ConsumerStatefulWidget {
|
|||
required this.onCoinControlPressed,
|
||||
required this.onAnonymizeAllPressed,
|
||||
required this.onWhirlpoolPressed,
|
||||
required this.onOrdinalsPressed,
|
||||
required this.onMonkeyPressed,
|
||||
}) : super(key: key);
|
||||
|
||||
final String walletId;
|
||||
|
@ -36,6 +38,8 @@ class MoreFeaturesDialog extends ConsumerStatefulWidget {
|
|||
final VoidCallback? onCoinControlPressed;
|
||||
final VoidCallback? onAnonymizeAllPressed;
|
||||
final VoidCallback? onWhirlpoolPressed;
|
||||
final VoidCallback? onOrdinalsPressed;
|
||||
final VoidCallback? onMonkeyPressed;
|
||||
|
||||
@override
|
||||
ConsumerState<MoreFeaturesDialog> createState() => _MoreFeaturesDialogState();
|
||||
|
@ -103,6 +107,20 @@ class _MoreFeaturesDialogState extends ConsumerState<MoreFeaturesDialog> {
|
|||
iconAsset: Assets.svg.robotHead,
|
||||
onPressed: () => widget.onPaynymPressed?.call(),
|
||||
),
|
||||
if (manager.hasOrdinalsSupport)
|
||||
_MoreFeaturesItem(
|
||||
label: "Ordinals",
|
||||
detail: "View and control your ordinals in Stack",
|
||||
iconAsset: Assets.svg.ordinal,
|
||||
onPressed: () => widget.onOrdinalsPressed?.call(),
|
||||
),
|
||||
if (manager.coin == Coin.banano)
|
||||
_MoreFeaturesItem(
|
||||
label: "MonKey",
|
||||
detail: "Generate Banano MonKey",
|
||||
iconAsset: Assets.svg.monkey,
|
||||
onPressed: () => widget.onMonkeyPressed?.call(),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 28,
|
||||
),
|
||||
|
|
|
@ -13,7 +13,8 @@ import 'dart:async';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:stackwallet/pages/settings_views/global_settings_view/xpub_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/change_representative_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/xpub_view.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/addresses/desktop_wallet_addresses_view.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_delete_wallet_dialog.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
|
@ -21,11 +22,13 @@ import 'package:stackwallet/route_generator.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';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
|
||||
enum _WalletOptions {
|
||||
addressList,
|
||||
deleteWallet,
|
||||
changeRepresentative,
|
||||
showXpub;
|
||||
|
||||
String get prettyName {
|
||||
|
@ -34,6 +37,8 @@ enum _WalletOptions {
|
|||
return "Address list";
|
||||
case _WalletOptions.deleteWallet:
|
||||
return "Delete wallet";
|
||||
case _WalletOptions.changeRepresentative:
|
||||
return "Change representative";
|
||||
case _WalletOptions.showXpub:
|
||||
return "Show xPub";
|
||||
}
|
||||
|
@ -70,6 +75,9 @@ class WalletOptionsButton extends StatelessWidget {
|
|||
onAddressListPressed: () async {
|
||||
Navigator.of(context).pop(_WalletOptions.addressList);
|
||||
},
|
||||
onChangeRepPressed: () async {
|
||||
Navigator.of(context).pop(_WalletOptions.changeRepresentative);
|
||||
},
|
||||
onShowXpubPressed: () async {
|
||||
Navigator.of(context).pop(_WalletOptions.showXpub);
|
||||
},
|
||||
|
@ -134,6 +142,32 @@ class WalletOptionsButton extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
|
||||
if (result == true) {
|
||||
if (context.mounted) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case _WalletOptions.changeRepresentative:
|
||||
final result = await showDialog<bool?>(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => Navigator(
|
||||
initialRoute: ChangeRepresentativeView.routeName,
|
||||
onGenerateRoute: RouteGenerator.generateRoute,
|
||||
onGenerateInitialRoutes: (_, __) {
|
||||
return [
|
||||
RouteGenerator.generateRoute(
|
||||
RouteSettings(
|
||||
name: ChangeRepresentativeView.routeName,
|
||||
arguments: walletId,
|
||||
),
|
||||
),
|
||||
];
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
if (result == true) {
|
||||
if (context.mounted) {
|
||||
Navigator.of(context).pop();
|
||||
|
@ -171,18 +205,24 @@ class WalletOptionsPopupMenu extends ConsumerWidget {
|
|||
required this.onDeletePressed,
|
||||
required this.onAddressListPressed,
|
||||
required this.onShowXpubPressed,
|
||||
required this.onChangeRepPressed,
|
||||
required this.walletId,
|
||||
}) : super(key: key);
|
||||
|
||||
final VoidCallback onDeletePressed;
|
||||
final VoidCallback onAddressListPressed;
|
||||
final VoidCallback onShowXpubPressed;
|
||||
final VoidCallback onChangeRepPressed;
|
||||
final String walletId;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final bool xpubEnabled = ref.watch(walletsChangeNotifierProvider
|
||||
.select((value) => value.getManager(walletId).hasXPub));
|
||||
final manager = ref.watch(walletsChangeNotifierProvider
|
||||
.select((value) => value.getManager(walletId)));
|
||||
final bool xpubEnabled = manager.hasXPub;
|
||||
|
||||
final bool canChangeRep =
|
||||
manager.coin == Coin.nano || manager.coin == Coin.banano;
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
|
@ -237,6 +277,43 @@ class WalletOptionsPopupMenu extends ConsumerWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
if (canChangeRep)
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
if (canChangeRep)
|
||||
TransparentButton(
|
||||
onPressed: onChangeRepPressed,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
Assets.svg.eye,
|
||||
width: 20,
|
||||
height: 20,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFieldActiveSearchIconLeft,
|
||||
),
|
||||
const SizedBox(width: 14),
|
||||
Expanded(
|
||||
child: Text(
|
||||
_WalletOptions.changeRepresentative.prettyName,
|
||||
style: STextStyles.desktopTextExtraExtraSmall(
|
||||
context)
|
||||
.copyWith(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textDark,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
if (xpubEnabled)
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
|
|
|
@ -0,0 +1,314 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:stackwallet/models/isar/models/blockchain_data/utxo.dart';
|
||||
import 'package:stackwallet/models/isar/ordinal.dart';
|
||||
import 'package:stackwallet/notifications/show_flush_bar.dart';
|
||||
import 'package:stackwallet/providers/db/main_db_provider.dart';
|
||||
import 'package:stackwallet/providers/global/wallets_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount_formatter.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart';
|
||||
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||
|
||||
class DesktopOrdinalDetailsView extends ConsumerStatefulWidget {
|
||||
const DesktopOrdinalDetailsView({
|
||||
Key? key,
|
||||
required this.walletId,
|
||||
required this.ordinal,
|
||||
}) : super(key: key);
|
||||
|
||||
final String walletId;
|
||||
final Ordinal ordinal;
|
||||
|
||||
static const routeName = "/desktopOrdinalDetailsView";
|
||||
|
||||
@override
|
||||
ConsumerState<DesktopOrdinalDetailsView> createState() =>
|
||||
_DesktopOrdinalDetailsViewState();
|
||||
}
|
||||
|
||||
class _DesktopOrdinalDetailsViewState
|
||||
extends ConsumerState<DesktopOrdinalDetailsView> {
|
||||
static const _spacing = 12.0;
|
||||
|
||||
late final UTXO? utxo;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
utxo = widget.ordinal.getUTXO(ref.read(mainDBProvider));
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final coin = ref.watch(walletsChangeNotifierProvider
|
||||
.select((value) => value.getManager(widget.walletId).coin));
|
||||
|
||||
return DesktopScaffold(
|
||||
appBar: DesktopAppBar(
|
||||
background: Theme.of(context).extension<StackColors>()!.popupBG,
|
||||
leading: Expanded(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 32,
|
||||
),
|
||||
AppBarIconButton(
|
||||
size: 32,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFieldDefaultBG,
|
||||
shadows: const [],
|
||||
icon: SvgPicture.asset(
|
||||
Assets.svg.arrowLeft,
|
||||
width: 18,
|
||||
height: 18,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.topNavIconPrimary,
|
||||
),
|
||||
onPressed: Navigator.of(context).pop,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 18,
|
||||
),
|
||||
Text(
|
||||
"Ordinal details",
|
||||
style: STextStyles.desktopH3(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
useSpacers: false,
|
||||
isCompactHeight: true,
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 24,
|
||||
top: 24,
|
||||
right: 24,
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 300,
|
||||
height: 300,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(
|
||||
Constants.size.circularBorderRadius,
|
||||
),
|
||||
child: Image.network(
|
||||
widget.ordinal
|
||||
.content, // Use the preview URL as the image source
|
||||
fit: BoxFit.cover,
|
||||
filterQuality:
|
||||
FilterQuality.none, // Set the filter mode to nearest
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 16,
|
||||
),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
children: [
|
||||
RoundedWhiteContainer(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"INSC. ${widget.ordinal.inscriptionNumber}",
|
||||
style: STextStyles.w600_20(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 16,
|
||||
),
|
||||
// PrimaryButton(
|
||||
// width: 150,
|
||||
// label: "Send",
|
||||
// icon: SvgPicture.asset(
|
||||
// Assets.svg.send,
|
||||
// width: 18,
|
||||
// height: 18,
|
||||
// color: Theme.of(context)
|
||||
// .extension<StackColors>()!
|
||||
// .buttonTextPrimary,
|
||||
// ),
|
||||
// buttonHeight: ButtonHeight.l,
|
||||
// iconSpacing: 8,
|
||||
// onPressed: () async {
|
||||
// final response = await showDialog<String?>(
|
||||
// context: context,
|
||||
// builder: (_) =>
|
||||
// const SendOrdinalUnfreezeDialog(),
|
||||
// );
|
||||
// if (response == "unfreeze") {
|
||||
// // TODO: unfreeze and go to send ord screen
|
||||
// }
|
||||
// },
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// width: 16,
|
||||
// ),
|
||||
// SecondaryButton(
|
||||
// width: 150,
|
||||
// label: "Download",
|
||||
// icon: SvgPicture.asset(
|
||||
// Assets.svg.arrowDown,
|
||||
// width: 13,
|
||||
// height: 18,
|
||||
// color: Theme.of(context)
|
||||
// .extension<StackColors>()!
|
||||
// .buttonTextSecondary,
|
||||
// ),
|
||||
// buttonHeight: ButtonHeight.l,
|
||||
// iconSpacing: 8,
|
||||
// onPressed: () {
|
||||
// // TODO: save and download image to device
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
_DetailsItemWCopy(
|
||||
title: "Inscription number",
|
||||
data: widget.ordinal.inscriptionNumber.toString(),
|
||||
),
|
||||
const SizedBox(
|
||||
height: _spacing,
|
||||
),
|
||||
_DetailsItemWCopy(
|
||||
title: "Inscription ID",
|
||||
data: widget.ordinal.inscriptionId,
|
||||
),
|
||||
const SizedBox(
|
||||
height: _spacing,
|
||||
),
|
||||
// todo: add utxo status
|
||||
const SizedBox(
|
||||
height: _spacing,
|
||||
),
|
||||
_DetailsItemWCopy(
|
||||
title: "Amount",
|
||||
data: utxo == null
|
||||
? "ERROR"
|
||||
: ref.watch(pAmountFormatter(coin)).format(
|
||||
Amount(
|
||||
rawValue: BigInt.from(utxo!.value),
|
||||
fractionDigits: coin.decimals,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: _spacing,
|
||||
),
|
||||
_DetailsItemWCopy(
|
||||
title: "Owner address",
|
||||
data: utxo?.address ?? "ERROR",
|
||||
),
|
||||
const SizedBox(
|
||||
height: _spacing,
|
||||
),
|
||||
_DetailsItemWCopy(
|
||||
title: "Transaction ID",
|
||||
data: widget.ordinal.utxoTXID,
|
||||
),
|
||||
const SizedBox(
|
||||
height: _spacing,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _DetailsItemWCopy extends StatelessWidget {
|
||||
const _DetailsItemWCopy({
|
||||
Key? key,
|
||||
required this.title,
|
||||
required this.data,
|
||||
}) : super(key: key);
|
||||
|
||||
final String title;
|
||||
final String data;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RoundedWhiteContainer(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: STextStyles.itemSubtitle(context),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
await Clipboard.setData(ClipboardData(text: data));
|
||||
if (context.mounted) {
|
||||
unawaited(
|
||||
showFloatingFlushBar(
|
||||
type: FlushBarType.info,
|
||||
message: "Copied to clipboard",
|
||||
context: context,
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
child: SvgPicture.asset(
|
||||
Assets.svg.copy,
|
||||
color:
|
||||
Theme.of(context).extension<StackColors>()!.infoItemIcons,
|
||||
width: 12,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
SelectableText(
|
||||
data,
|
||||
style: STextStyles.itemSubtitle12(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
246
lib/pages_desktop_specific/ordinals/desktop_ordinals_view.dart
Normal file
|
@ -0,0 +1,246 @@
|
|||
/*
|
||||
* This file is part of Stack Wallet.
|
||||
*
|
||||
* Copyright (c) 2023 Cypher Stack
|
||||
* All Rights Reserved.
|
||||
* The code is distributed under GPLv3 license, see LICENSE file for details.
|
||||
* Generated by Cypher Stack on 2023-05-26
|
||||
*
|
||||
*/
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:stackwallet/pages/ordinals/widgets/ordinals_list.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/services/mixins/ordinals_interface.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/show_loading.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/utilities/util.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart';
|
||||
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
|
||||
import 'package:stackwallet/widgets/icon_widgets/x_icon.dart';
|
||||
import 'package:stackwallet/widgets/stack_text_field.dart';
|
||||
import 'package:stackwallet/widgets/textfield_icon_button.dart';
|
||||
|
||||
class DesktopOrdinalsView extends ConsumerStatefulWidget {
|
||||
const DesktopOrdinalsView({
|
||||
super.key,
|
||||
required this.walletId,
|
||||
});
|
||||
|
||||
static const String routeName = "/desktopOrdinalsView";
|
||||
|
||||
final String walletId;
|
||||
|
||||
@override
|
||||
ConsumerState<DesktopOrdinalsView> createState() => _DesktopOrdinals();
|
||||
}
|
||||
|
||||
class _DesktopOrdinals extends ConsumerState<DesktopOrdinalsView> {
|
||||
late final TextEditingController searchController;
|
||||
late final FocusNode searchFocusNode;
|
||||
|
||||
String _searchTerm = "";
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
searchController = TextEditingController();
|
||||
searchFocusNode = FocusNode();
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
searchController.dispose();
|
||||
searchFocusNode.dispose();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
debugPrint("BUILD: $runtimeType");
|
||||
|
||||
return DesktopScaffold(
|
||||
appBar: DesktopAppBar(
|
||||
background: Theme.of(context).extension<StackColors>()!.popupBG,
|
||||
isCompactHeight: true,
|
||||
useSpacers: false,
|
||||
leading: Expanded(
|
||||
child: Row(
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 32,
|
||||
),
|
||||
AppBarIconButton(
|
||||
size: 32,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFieldDefaultBG,
|
||||
shadows: const [],
|
||||
icon: SvgPicture.asset(
|
||||
Assets.svg.arrowLeft,
|
||||
width: 18,
|
||||
height: 18,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.topNavIconPrimary,
|
||||
),
|
||||
onPressed: Navigator.of(context).pop,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 15,
|
||||
),
|
||||
SvgPicture.asset(
|
||||
Assets.svg.ordinal,
|
||||
width: 32,
|
||||
height: 32,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 12,
|
||||
),
|
||||
Text(
|
||||
"Ordinals",
|
||||
style: STextStyles.desktopH3(context),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
const Spacer(),
|
||||
// Expanded(
|
||||
// child: ClipRRect(
|
||||
// borderRadius: BorderRadius.circular(
|
||||
// Constants.size.circularBorderRadius,
|
||||
// ),
|
||||
// child: TextField(
|
||||
// autocorrect: Util.isDesktop ? false : true,
|
||||
// enableSuggestions: Util.isDesktop ? false : true,
|
||||
// controller: searchController,
|
||||
// focusNode: searchFocusNode,
|
||||
// onChanged: (value) {
|
||||
// setState(() {
|
||||
// _searchTerm = value;
|
||||
// });
|
||||
// },
|
||||
// style: STextStyles.field(context),
|
||||
// decoration: standardInputDecoration(
|
||||
// "Search",
|
||||
// searchFocusNode,
|
||||
// context,
|
||||
// ).copyWith(
|
||||
// prefixIcon: Padding(
|
||||
// padding: const EdgeInsets.symmetric(
|
||||
// horizontal: 10,
|
||||
// vertical: 20,
|
||||
// ),
|
||||
// child: SvgPicture.asset(
|
||||
// Assets.svg.search,
|
||||
// width: 16,
|
||||
// height: 16,
|
||||
// ),
|
||||
// ),
|
||||
// suffixIcon: searchController.text.isNotEmpty
|
||||
// ? Padding(
|
||||
// padding: const EdgeInsets.only(right: 0),
|
||||
// child: UnconstrainedBox(
|
||||
// child: Row(
|
||||
// children: [
|
||||
// TextFieldIconButton(
|
||||
// child: const XIcon(),
|
||||
// onTap: () async {
|
||||
// setState(() {
|
||||
// searchController.text = "";
|
||||
// _searchTerm = "";
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
// : null,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// width: 16,
|
||||
// ),
|
||||
// SecondaryButton(
|
||||
// width: 184,
|
||||
// label: "Filter",
|
||||
// buttonHeight: ButtonHeight.l,
|
||||
// icon: SvgPicture.asset(
|
||||
// Assets.svg.filter,
|
||||
// color: Theme.of(context)
|
||||
// .extension<StackColors>()!
|
||||
// .buttonTextSecondary,
|
||||
// ),
|
||||
// onPressed: () {
|
||||
// Navigator.of(context).pushNamed(
|
||||
// OrdinalsFilterView.routeName,
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
const SizedBox(
|
||||
width: 16,
|
||||
),
|
||||
SecondaryButton(
|
||||
width: 184,
|
||||
label: "Update",
|
||||
buttonHeight: ButtonHeight.l,
|
||||
icon: SvgPicture.asset(
|
||||
Assets.svg.arrowRotate,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.buttonTextSecondary,
|
||||
),
|
||||
onPressed: () async {
|
||||
// show loading for a minimum of 2 seconds on refreshing
|
||||
await showLoading(
|
||||
isDesktop: true,
|
||||
whileFuture: Future.wait<void>([
|
||||
Future.delayed(const Duration(seconds: 2)),
|
||||
(ref
|
||||
.read(walletsChangeNotifierProvider)
|
||||
.getManager(widget.walletId)
|
||||
.wallet as OrdinalsInterface)
|
||||
.refreshInscriptions()
|
||||
]),
|
||||
context: context,
|
||||
message: "Refreshing...");
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: OrdinalsList(
|
||||
walletId: widget.walletId,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -125,7 +125,7 @@ class _CreatePasswordViewState extends ConsumerState<CreatePasswordView> {
|
|||
}
|
||||
}
|
||||
|
||||
if (!widget.restoreFromSWB) {
|
||||
if (!widget.restoreFromSWB && mounted) {
|
||||
unawaited(showFloatingFlushBar(
|
||||
type: FlushBarType.success,
|
||||
message: "Your password is set up",
|
||||
|
|
|
@ -84,10 +84,10 @@ class _DesktopLoginViewState extends ConsumerState<DesktopLoginView> {
|
|||
unawaited(
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => Column(
|
||||
builder: (context) => const Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: const [
|
||||
children: [
|
||||
LoadingIndicator(
|
||||
width: 200,
|
||||
height: 200,
|
||||
|
|
|
@ -13,8 +13,12 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|||
import 'package:stackwallet/models/exchange/active_pair.dart';
|
||||
import 'package:stackwallet/models/exchange/response_objects/estimate.dart';
|
||||
import 'package:stackwallet/models/exchange/response_objects/range.dart';
|
||||
import 'package:stackwallet/providers/global/locale_provider.dart';
|
||||
import 'package:stackwallet/services/exchange/exchange.dart';
|
||||
import 'package:stackwallet/services/exchange/exchange_response.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount_unit.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/enums/exchange_rate_type_enum.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
|
||||
|
@ -44,7 +48,22 @@ final efSendAmountStringProvider = StateProvider<String>((ref) {
|
|||
if (refreshing && reversed) {
|
||||
return "-";
|
||||
} else {
|
||||
return ref.watch(efSendAmountProvider)?.toString() ?? "";
|
||||
final decimal = ref.watch(efSendAmountProvider);
|
||||
String string = "";
|
||||
if (decimal != null) {
|
||||
final amount = Amount.fromDecimal(decimal, fractionDigits: decimal.scale);
|
||||
final locale = ref.watch(localeServiceChangeNotifierProvider).locale;
|
||||
string = AmountUnit.normal.displayAmount(
|
||||
amount: amount,
|
||||
locale: locale,
|
||||
coin: Coin
|
||||
.nano, // use nano just to ensure decimal.scale < Coin.value.decimals
|
||||
withUnitName: false,
|
||||
maxDecimalPlaces: decimal.scale,
|
||||
);
|
||||
}
|
||||
|
||||
return string;
|
||||
}
|
||||
});
|
||||
final efReceiveAmountStringProvider = StateProvider<String>((ref) {
|
||||
|
@ -54,7 +73,22 @@ final efReceiveAmountStringProvider = StateProvider<String>((ref) {
|
|||
if (refreshing && reversed == false) {
|
||||
return "-";
|
||||
} else {
|
||||
return ref.watch(efReceiveAmountProvider)?.toString() ?? "";
|
||||
final decimal = ref.watch(efReceiveAmountProvider);
|
||||
String string = "";
|
||||
if (decimal != null) {
|
||||
final amount = Amount.fromDecimal(decimal, fractionDigits: decimal.scale);
|
||||
final locale = ref.watch(localeServiceChangeNotifierProvider).locale;
|
||||
string = AmountUnit.normal.displayAmount(
|
||||
amount: amount,
|
||||
locale: locale,
|
||||
coin: Coin
|
||||
.nano, // use nano just to ensure decimal.scale < Coin.value.decimals
|
||||
withUnitName: false,
|
||||
maxDecimalPlaces: decimal.scale,
|
||||
);
|
||||
}
|
||||
|
||||
return string;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -17,7 +17,9 @@ import 'package:stackwallet/models/add_wallet_list_entity/sub_classes/eth_token_
|
|||
import 'package:stackwallet/models/buy/response_objects/quote.dart';
|
||||
import 'package:stackwallet/models/exchange/incomplete_exchange.dart';
|
||||
import 'package:stackwallet/models/exchange/response_objects/trade.dart';
|
||||
import 'package:stackwallet/models/isar/models/contact_entry.dart';
|
||||
import 'package:stackwallet/models/isar/models/isar_models.dart';
|
||||
import 'package:stackwallet/models/isar/ordinal.dart';
|
||||
import 'package:stackwallet/models/paynym/paynym_account_lite.dart';
|
||||
import 'package:stackwallet/models/send_view_auto_fill_data.dart';
|
||||
import 'package:stackwallet/pages/add_wallet_views/add_token_view/add_custom_token_view.dart';
|
||||
|
@ -56,7 +58,11 @@ import 'package:stackwallet/pages/generic/single_field_edit_view.dart';
|
|||
import 'package:stackwallet/pages/home_view/home_view.dart';
|
||||
import 'package:stackwallet/pages/intro_view.dart';
|
||||
import 'package:stackwallet/pages/manage_favorites_view/manage_favorites_view.dart';
|
||||
import 'package:stackwallet/pages/monkey/monkey_view.dart';
|
||||
import 'package:stackwallet/pages/notification_views/notifications_view.dart';
|
||||
import 'package:stackwallet/pages/ordinals/ordinal_details_view.dart';
|
||||
import 'package:stackwallet/pages/ordinals/ordinals_filter_view.dart';
|
||||
import 'package:stackwallet/pages/ordinals/ordinals_view.dart';
|
||||
import 'package:stackwallet/pages/paynym/add_new_paynym_follow_view.dart';
|
||||
import 'package:stackwallet/pages/paynym/paynym_claim_view.dart';
|
||||
import 'package:stackwallet/pages/paynym/paynym_home_view.dart';
|
||||
|
@ -103,14 +109,15 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/support_vi
|
|||
import 'package:stackwallet/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_options_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_preferences_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/global_settings_view/syncing_preferences_views/wallet_syncing_options_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/global_settings_view/xpub_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_settings_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/change_representative_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_recovery_phrase_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_warning_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/rename_wallet_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/wallet_settings_wallet_settings_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/xpub_view.dart';
|
||||
import 'package:stackwallet/pages/stack_privacy_calls.dart';
|
||||
import 'package:stackwallet/pages/token_view/my_tokens_view.dart';
|
||||
import 'package:stackwallet/pages/token_view/token_contract_details_view.dart';
|
||||
|
@ -140,6 +147,8 @@ import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/sub
|
|||
import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/unlock_wallet_keys_desktop.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_keys_desktop_popup.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/notifications/desktop_notifications_view.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/ordinals/desktop_ordinal_details_view.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/ordinals/desktop_ordinals_view.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/password/create_password_view.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/password/delete_password_warning_view.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/password/forgot_password_desktop_view.dart';
|
||||
|
@ -164,8 +173,6 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
|||
import 'package:stackwallet/widgets/choose_coin_view.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
|
||||
import 'models/isar/models/contact_entry.dart';
|
||||
|
||||
/*
|
||||
* This file contains all the routes for the app.
|
||||
* To add a new route, add it to the switch statement in the generateRoute method.
|
||||
|
@ -375,6 +382,35 @@ class RouteGenerator {
|
|||
}
|
||||
return _routeError("${settings.name} invalid args: ${args.toString()}");
|
||||
|
||||
case MonkeyView.routeName:
|
||||
if (args is String) {
|
||||
return getRoute(
|
||||
shouldUseMaterialRoute: useMaterialPageRoute,
|
||||
builder: (_) => MonkeyView(
|
||||
walletId: args,
|
||||
),
|
||||
settings: RouteSettings(
|
||||
name: settings.name,
|
||||
),
|
||||
);
|
||||
}
|
||||
return _routeError("${settings.name} invalid args: ${args.toString()}");
|
||||
|
||||
// case MonkeyLoadedView.routeName:
|
||||
// if (args is Tuple2<String, ChangeNotifierProvider<Manager>>) {
|
||||
// return getRoute(
|
||||
// shouldUseMaterialRoute: useMaterialPageRoute,
|
||||
// builder: (_) => MonkeyLoadedView(
|
||||
// walletId: args.item1,
|
||||
// managerProvider: args.item2,
|
||||
// ),
|
||||
// settings: RouteSettings(
|
||||
// name: settings.name,
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// return _routeError("${settings.name} invalid args: ${args.toString()}");
|
||||
|
||||
case CoinControlView.routeName:
|
||||
if (args is Tuple2<String, CoinControlViewType>) {
|
||||
return getRoute(
|
||||
|
@ -404,6 +440,70 @@ class RouteGenerator {
|
|||
}
|
||||
return _routeError("${settings.name} invalid args: ${args.toString()}");
|
||||
|
||||
case OrdinalsView.routeName:
|
||||
if (args is String) {
|
||||
return getRoute(
|
||||
shouldUseMaterialRoute: useMaterialPageRoute,
|
||||
builder: (_) => OrdinalsView(
|
||||
walletId: args,
|
||||
),
|
||||
settings: RouteSettings(
|
||||
name: settings.name,
|
||||
),
|
||||
);
|
||||
}
|
||||
return _routeError("${settings.name} invalid args: ${args.toString()}");
|
||||
|
||||
case DesktopOrdinalsView.routeName:
|
||||
if (args is String) {
|
||||
return getRoute(
|
||||
shouldUseMaterialRoute: useMaterialPageRoute,
|
||||
builder: (_) => DesktopOrdinalsView(
|
||||
walletId: args,
|
||||
),
|
||||
settings: RouteSettings(
|
||||
name: settings.name,
|
||||
),
|
||||
);
|
||||
}
|
||||
return _routeError("${settings.name} invalid args: ${args.toString()}");
|
||||
|
||||
case OrdinalDetailsView.routeName:
|
||||
if (args is ({Ordinal ordinal, String walletId})) {
|
||||
return getRoute(
|
||||
shouldUseMaterialRoute: useMaterialPageRoute,
|
||||
builder: (_) => OrdinalDetailsView(
|
||||
walletId: args.walletId,
|
||||
ordinal: args.ordinal,
|
||||
),
|
||||
settings: RouteSettings(
|
||||
name: settings.name,
|
||||
),
|
||||
);
|
||||
}
|
||||
return _routeError("${settings.name} invalid args: ${args.toString()}");
|
||||
|
||||
case DesktopOrdinalDetailsView.routeName:
|
||||
if (args is ({Ordinal ordinal, String walletId})) {
|
||||
return getRoute(
|
||||
shouldUseMaterialRoute: useMaterialPageRoute,
|
||||
builder: (_) => DesktopOrdinalDetailsView(
|
||||
walletId: args.walletId,
|
||||
ordinal: args.ordinal,
|
||||
),
|
||||
settings: RouteSettings(
|
||||
name: settings.name,
|
||||
),
|
||||
);
|
||||
}
|
||||
return _routeError("${settings.name} invalid args: ${args.toString()}");
|
||||
|
||||
case OrdinalsFilterView.routeName:
|
||||
return getRoute(
|
||||
shouldUseMaterialRoute: useMaterialPageRoute,
|
||||
builder: (_) => const OrdinalsFilterView(),
|
||||
settings: RouteSettings(name: settings.name));
|
||||
|
||||
case UtxoDetailsView.routeName:
|
||||
if (args is Tuple2<Id, String>) {
|
||||
return getRoute(
|
||||
|
@ -564,6 +664,20 @@ class RouteGenerator {
|
|||
}
|
||||
return _routeError("${settings.name} invalid args: ${args.toString()}");
|
||||
|
||||
case ChangeRepresentativeView.routeName:
|
||||
if (args is String) {
|
||||
return getRoute(
|
||||
shouldUseMaterialRoute: useMaterialPageRoute,
|
||||
builder: (_) => ChangeRepresentativeView(
|
||||
walletId: args,
|
||||
),
|
||||
settings: RouteSettings(
|
||||
name: settings.name,
|
||||
),
|
||||
);
|
||||
}
|
||||
return _routeError("${settings.name} invalid args: ${args.toString()}");
|
||||
|
||||
case AppearanceSettingsView.routeName:
|
||||
return getRoute(
|
||||
shouldUseMaterialRoute: useMaterialPageRoute,
|
||||
|
|
|
@ -4,6 +4,7 @@ import 'dart:convert';
|
|||
import 'package:http/http.dart' as http;
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:nanodart/nanodart.dart';
|
||||
import 'package:stackwallet/db/hive/db.dart';
|
||||
import 'package:stackwallet/db/isar/main_db.dart';
|
||||
import 'package:stackwallet/models/balance.dart';
|
||||
import 'package:stackwallet/models/isar/models/isar_models.dart';
|
||||
|
@ -14,9 +15,9 @@ import 'package:stackwallet/services/event_bus/events/global/node_connection_sta
|
|||
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/global_event_bus.dart';
|
||||
import 'package:stackwallet/services/mixins/coin_control_interface.dart';
|
||||
import 'package:stackwallet/services/mixins/wallet_cache.dart';
|
||||
import 'package:stackwallet/services/mixins/wallet_db.dart';
|
||||
import 'package:stackwallet/services/nano_api.dart';
|
||||
import 'package:stackwallet/services/node_service.dart';
|
||||
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
|
@ -32,8 +33,7 @@ const int MINIMUM_CONFIRMATIONS = 1;
|
|||
const String DEFAULT_REPRESENTATIVE =
|
||||
"ban_1ka1ium4pfue3uxtntqsrib8mumxgazsjf58gidh1xeo5te3whsq8z476goo";
|
||||
|
||||
class BananoWallet extends CoinServiceAPI
|
||||
with WalletCache, WalletDB, CoinControlInterface {
|
||||
class BananoWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
||||
BananoWallet({
|
||||
required String walletId,
|
||||
required String walletName,
|
||||
|
@ -925,4 +925,66 @@ class BananoWallet extends CoinServiceAPI
|
|||
);
|
||||
await updateCachedChainHeight(height ?? 0);
|
||||
}
|
||||
|
||||
Future<void> updateMonkeyImageBytes(List<int> bytes) async {
|
||||
await DB.instance.put<dynamic>(
|
||||
boxName: _walletId,
|
||||
key: "monkeyImageBytesKey",
|
||||
value: bytes,
|
||||
);
|
||||
}
|
||||
|
||||
List<int>? getMonkeyImageBytes() {
|
||||
return DB.instance.get<dynamic>(
|
||||
boxName: _walletId,
|
||||
key: "monkeyImageBytesKey",
|
||||
) as List<int>?;
|
||||
}
|
||||
|
||||
Future<String> getCurrentRepresentative() async {
|
||||
final serverURI = Uri.parse(getCurrentNode().host);
|
||||
final address = await currentReceivingAddress;
|
||||
|
||||
final response = await NanoAPI.getAccountInfo(
|
||||
server: serverURI,
|
||||
representative: true,
|
||||
account: address,
|
||||
);
|
||||
|
||||
return response.accountInfo?.representative ?? DEFAULT_REPRESENTATIVE;
|
||||
}
|
||||
|
||||
Future<bool> changeRepresentative(String newRepresentative) async {
|
||||
try {
|
||||
final serverURI = Uri.parse(getCurrentNode().host);
|
||||
final balance = this.balance.spendable.raw.toString();
|
||||
final String privateKey = await getPrivateKeyFromMnemonic();
|
||||
final address = await currentReceivingAddress;
|
||||
|
||||
final response = await NanoAPI.getAccountInfo(
|
||||
server: serverURI,
|
||||
representative: true,
|
||||
account: address,
|
||||
);
|
||||
|
||||
if (response.accountInfo == null) {
|
||||
throw response.exception ?? Exception("Failed to get account info");
|
||||
}
|
||||
|
||||
final work = await requestWork(response.accountInfo!.frontier);
|
||||
|
||||
return await NanoAPI.changeRepresentative(
|
||||
server: serverURI,
|
||||
accountType: NanoAccountType.BANANO,
|
||||
account: address,
|
||||
newRepresentative: newRepresentative,
|
||||
previousBlock: response.accountInfo!.frontier,
|
||||
balance: balance,
|
||||
privateKey: privateKey,
|
||||
work: work!,
|
||||
);
|
||||
} catch (_) {
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1023,6 +1023,7 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
final response = await EthereumAPI.getEthTransactions(
|
||||
address: thisAddress,
|
||||
firstBlock: isRescan ? 0 : firstBlock,
|
||||
includeTokens: true,
|
||||
);
|
||||
|
||||
if (response.value == null) {
|
||||
|
@ -1057,8 +1058,10 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
txFailed = true;
|
||||
}
|
||||
isIncoming = false;
|
||||
} else {
|
||||
} else if (checksumEthereumAddress(element.to) == thisAddress) {
|
||||
isIncoming = true;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
//Calculate fees (GasLimit * gasPrice)
|
||||
|
|
|
@ -36,6 +36,7 @@ import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_
|
|||
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/ordinals_interface.dart';
|
||||
import 'package:stackwallet/services/mixins/wallet_cache.dart';
|
||||
import 'package:stackwallet/services/mixins/wallet_db.dart';
|
||||
import 'package:stackwallet/services/mixins/xpubable.dart';
|
||||
|
@ -109,7 +110,12 @@ String constructDerivePath({
|
|||
}
|
||||
|
||||
class LitecoinWallet extends CoinServiceAPI
|
||||
with WalletCache, WalletDB, ElectrumXParsing, CoinControlInterface
|
||||
with
|
||||
WalletCache,
|
||||
WalletDB,
|
||||
ElectrumXParsing,
|
||||
CoinControlInterface,
|
||||
OrdinalsInterface
|
||||
implements XPubAble {
|
||||
LitecoinWallet({
|
||||
required String walletId,
|
||||
|
@ -130,6 +136,7 @@ class LitecoinWallet extends CoinServiceAPI
|
|||
_secureStore = secureStore;
|
||||
initCache(walletId, coin);
|
||||
initWalletDB(mockableOverride: mockableOverride);
|
||||
initOrdinalsInterface(walletId: walletId, coin: coin, db: db);
|
||||
initCoinControlInterface(
|
||||
walletId: walletId,
|
||||
walletName: walletName,
|
||||
|
@ -1864,14 +1871,6 @@ class LitecoinWallet extends CoinServiceAPI
|
|||
String? blockReason;
|
||||
String? label;
|
||||
|
||||
final utxoAmount = jsonUTXO["value"] as int;
|
||||
|
||||
if (utxoAmount <= 10000) {
|
||||
shouldBlock = true;
|
||||
blockReason = "May contain ordinal";
|
||||
label = "Possible ordinal";
|
||||
}
|
||||
|
||||
final vout = jsonUTXO["tx_pos"] as int;
|
||||
|
||||
final outputs = txn["vout"] as List;
|
||||
|
@ -1886,6 +1885,25 @@ class LitecoinWallet extends CoinServiceAPI
|
|||
}
|
||||
}
|
||||
|
||||
final utxoAmount = jsonUTXO["value"] as int;
|
||||
|
||||
// TODO check the specific output, not just the address in general
|
||||
// TODO optimize by freezing output in OrdinalsInterface, so one ordinal API calls is made (or at least many less)
|
||||
if (utxoOwnerAddress != null) {
|
||||
if (await inscriptionInAddress(utxoOwnerAddress!)) {
|
||||
shouldBlock = true;
|
||||
blockReason = "Ordinal";
|
||||
label = "Ordinal detected at address";
|
||||
}
|
||||
} else {
|
||||
// TODO implement inscriptionInOutput
|
||||
if (utxoAmount <= 10000) {
|
||||
shouldBlock = true;
|
||||
blockReason = "May contain ordinal";
|
||||
label = "Possible ordinal";
|
||||
}
|
||||
}
|
||||
|
||||
final utxo = isar_models.UTXO(
|
||||
walletId: walletId,
|
||||
txid: txn["txid"] as String,
|
||||
|
@ -1910,7 +1928,12 @@ class LitecoinWallet extends CoinServiceAPI
|
|||
level: LogLevel.Info,
|
||||
);
|
||||
|
||||
await db.updateUTXOs(walletId, outputArray);
|
||||
bool inscriptionsRefreshNeeded =
|
||||
await db.updateUTXOs(walletId, outputArray);
|
||||
|
||||
if (inscriptionsRefreshNeeded) {
|
||||
await refreshInscriptions();
|
||||
}
|
||||
|
||||
// finally update balance
|
||||
await _updateBalance();
|
||||
|
|
|
@ -21,6 +21,7 @@ import 'package:stackwallet/services/event_bus/events/global/node_connection_sta
|
|||
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/mixins/coin_control_interface.dart';
|
||||
import 'package:stackwallet/services/mixins/ordinals_interface.dart';
|
||||
import 'package:stackwallet/services/mixins/paynym_wallet_interface.dart';
|
||||
import 'package:stackwallet/services/mixins/xpubable.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
|
@ -244,6 +245,8 @@ class Manager with ChangeNotifier {
|
|||
|
||||
bool get hasCoinControlSupport => _currentWallet is CoinControlInterface;
|
||||
|
||||
bool get hasOrdinalsSupport => _currentWallet is OrdinalsInterface;
|
||||
|
||||
bool get hasTokenSupport => _currentWallet.coin == Coin.ethereum;
|
||||
|
||||
bool get hasWhirlpoolSupport => false;
|
||||
|
|
|
@ -24,9 +24,9 @@ import 'package:stackwallet/services/event_bus/events/global/node_connection_sta
|
|||
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/global_event_bus.dart';
|
||||
import 'package:stackwallet/services/mixins/coin_control_interface.dart';
|
||||
import 'package:stackwallet/services/mixins/wallet_cache.dart';
|
||||
import 'package:stackwallet/services/mixins/wallet_db.dart';
|
||||
import 'package:stackwallet/services/nano_api.dart';
|
||||
import 'package:stackwallet/services/node_service.dart';
|
||||
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
|
@ -42,8 +42,7 @@ const int MINIMUM_CONFIRMATIONS = 1;
|
|||
const String DEFAULT_REPRESENTATIVE =
|
||||
"nano_38713x95zyjsqzx6nm1dsom1jmm668owkeb9913ax6nfgj15az3nu8xkx579";
|
||||
|
||||
class NanoWallet extends CoinServiceAPI
|
||||
with WalletCache, WalletDB, CoinControlInterface {
|
||||
class NanoWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
||||
NanoWallet({
|
||||
required String walletId,
|
||||
required String walletName,
|
||||
|
@ -937,4 +936,51 @@ class NanoWallet extends CoinServiceAPI
|
|||
);
|
||||
await updateCachedChainHeight(height ?? 0);
|
||||
}
|
||||
|
||||
Future<String> getCurrentRepresentative() async {
|
||||
final serverURI = Uri.parse(getCurrentNode().host);
|
||||
final address = await currentReceivingAddress;
|
||||
|
||||
final response = await NanoAPI.getAccountInfo(
|
||||
server: serverURI,
|
||||
representative: true,
|
||||
account: address,
|
||||
);
|
||||
|
||||
return response.accountInfo?.representative ?? DEFAULT_REPRESENTATIVE;
|
||||
}
|
||||
|
||||
Future<bool> changeRepresentative(String newRepresentative) async {
|
||||
try {
|
||||
final serverURI = Uri.parse(getCurrentNode().host);
|
||||
final balance = this.balance.spendable.raw.toString();
|
||||
final String privateKey = await getPrivateKeyFromMnemonic();
|
||||
final address = await currentReceivingAddress;
|
||||
|
||||
final response = await NanoAPI.getAccountInfo(
|
||||
server: serverURI,
|
||||
representative: true,
|
||||
account: address,
|
||||
);
|
||||
|
||||
if (response.accountInfo == null) {
|
||||
throw response.exception ?? Exception("Failed to get account info");
|
||||
}
|
||||
|
||||
final work = await requestWork(response.accountInfo!.frontier);
|
||||
|
||||
return await NanoAPI.changeRepresentative(
|
||||
server: serverURI,
|
||||
accountType: NanoAccountType.NANO,
|
||||
account: address,
|
||||
newRepresentative: newRepresentative,
|
||||
previousBlock: response.accountInfo!.frontier,
|
||||
balance: balance,
|
||||
privateKey: privateKey,
|
||||
work: work!,
|
||||
);
|
||||
} catch (_) {
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:decimal/decimal.dart';
|
||||
import 'package:http/http.dart';
|
||||
import 'package:stackwallet/dto/ethereum/eth_token_tx_dto.dart';
|
||||
import 'package:stackwallet/dto/ethereum/eth_token_tx_extra_dto.dart';
|
||||
|
@ -50,6 +49,7 @@ abstract class EthereumAPI {
|
|||
static Future<EthereumResponse<List<EthTxDTO>>> getEthTransactions({
|
||||
required String address,
|
||||
int firstBlock = 0,
|
||||
bool includeTokens = false,
|
||||
}) async {
|
||||
try {
|
||||
final response = await get(
|
||||
|
@ -67,7 +67,7 @@ abstract class EthereumAPI {
|
|||
for (final map in list!) {
|
||||
final txn = EthTxDTO.fromMap(Map<String, dynamic>.from(map as Map));
|
||||
|
||||
if (txn.hasToken == 0) {
|
||||
if (txn.hasToken == 0 || includeTokens) {
|
||||
txns.add(txn);
|
||||
}
|
||||
}
|
||||
|
@ -76,9 +76,11 @@ abstract class EthereumAPI {
|
|||
null,
|
||||
);
|
||||
} else {
|
||||
throw EthApiException(
|
||||
"getEthTransactions($address) response is empty but status code is "
|
||||
"${response.statusCode}",
|
||||
// nice that the api returns an empty body instead of being
|
||||
// consistent and returning a json object with no transactions
|
||||
return EthereumResponse(
|
||||
[],
|
||||
null,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
@ -196,9 +198,11 @@ abstract class EthereumAPI {
|
|||
null,
|
||||
);
|
||||
} else {
|
||||
throw EthApiException(
|
||||
"getEthTransactionNonces($txns) response is empty but status code is "
|
||||
"${response.statusCode}",
|
||||
// nice that the api returns an empty body instead of being
|
||||
// consistent and returning a json object with no transactions
|
||||
return EthereumResponse(
|
||||
[],
|
||||
null,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
@ -252,13 +256,13 @@ abstract class EthereumAPI {
|
|||
);
|
||||
} else {
|
||||
throw EthApiException(
|
||||
"getEthTransaction($txids) response is empty but status code is "
|
||||
"getEthTokenTransactionsByTxids($txids) response is empty but status code is "
|
||||
"${response.statusCode}",
|
||||
);
|
||||
}
|
||||
} else {
|
||||
throw EthApiException(
|
||||
"getEthTransaction($txids) failed with status code: "
|
||||
"getEthTokenTransactionsByTxids($txids) failed with status code: "
|
||||
"${response.statusCode}",
|
||||
);
|
||||
}
|
||||
|
@ -269,7 +273,7 @@ abstract class EthereumAPI {
|
|||
);
|
||||
} catch (e, s) {
|
||||
Logging.instance.log(
|
||||
"getEthTransaction($txids): $e\n$s",
|
||||
"getEthTokenTransactionsByTxids($txids): $e\n$s",
|
||||
level: LogLevel.Error,
|
||||
);
|
||||
return EthereumResponse(
|
||||
|
@ -307,9 +311,11 @@ abstract class EthereumAPI {
|
|||
null,
|
||||
);
|
||||
} else {
|
||||
throw EthApiException(
|
||||
"getTokenTransactions($address, $tokenContractAddress) response is empty but status code is "
|
||||
"${response.statusCode}",
|
||||
// nice that the api returns an empty body instead of being
|
||||
// consistent and returning a json object with no transactions
|
||||
return EthereumResponse(
|
||||
[],
|
||||
null,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
@ -424,10 +430,10 @@ abstract class EthereumAPI {
|
|||
final map = json["data"].first as Map;
|
||||
|
||||
final balance =
|
||||
Decimal.tryParse(map["balance"].toString()) ?? Decimal.zero;
|
||||
BigInt.tryParse(map["units"].toString()) ?? BigInt.zero;
|
||||
|
||||
return EthereumResponse(
|
||||
Amount.fromDecimal(balance, fractionDigits: map["decimals"] as int),
|
||||
Amount(rawValue: balance, fractionDigits: map["decimals"] as int),
|
||||
null,
|
||||
);
|
||||
} else {
|
||||
|
|
|
@ -135,6 +135,9 @@ class ExchangeDataLoadingService {
|
|||
Future<void> loadAll() async {
|
||||
if (!_locked) {
|
||||
_locked = true;
|
||||
if (_isar == null) {
|
||||
await initDB();
|
||||
}
|
||||
Logging.instance.log(
|
||||
"ExchangeDataLoadingService.loadAll starting...",
|
||||
level: LogLevel.Info,
|
||||
|
|
68
lib/services/litescribe_api.dart
Normal file
|
@ -0,0 +1,68 @@
|
|||
import 'dart:convert';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import 'package:stackwallet/dto/ordinals/inscription_data.dart';
|
||||
import 'package:stackwallet/dto/ordinals/litescribe_response.dart';
|
||||
|
||||
class LitescribeAPI {
|
||||
static final LitescribeAPI _instance = LitescribeAPI._internal();
|
||||
|
||||
factory LitescribeAPI({required String baseUrl}) {
|
||||
_instance.baseUrl = baseUrl;
|
||||
return _instance;
|
||||
}
|
||||
|
||||
LitescribeAPI._internal();
|
||||
|
||||
late String baseUrl;
|
||||
|
||||
Future<LitescribeResponse> _getResponse(String endpoint) async {
|
||||
final response = await http.get(Uri.parse('$baseUrl$endpoint'));
|
||||
if (response.statusCode == 200) {
|
||||
return LitescribeResponse(data: _validateJson(response.body));
|
||||
} else {
|
||||
throw Exception('LitescribeAPI _getResponse exception: Failed to load data');
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> _validateJson(String responseBody) {
|
||||
final parsed = jsonDecode(responseBody);
|
||||
if (parsed is Map<String, dynamic>) {
|
||||
return parsed;
|
||||
} else {
|
||||
throw const FormatException('LitescribeAPI _validateJson exception: Invalid JSON format');
|
||||
}
|
||||
}
|
||||
|
||||
Future<List<InscriptionData>> getInscriptionsByAddress(String address, {int cursor = 0, int size = 1000}) async {
|
||||
// size param determines how many inscriptions are returned per response
|
||||
// default of 1000 is used to cover most addresses (I assume)
|
||||
// if the total number of inscriptions at the address exceeds the length of the list of inscriptions returned, another call with a higher size is made
|
||||
final int defaultLimit = 1000;
|
||||
final response = await _getResponse('/address/inscriptions?address=$address&cursor=$cursor&size=$size');
|
||||
|
||||
// Check if the number of returned inscriptions equals the limit
|
||||
final list = response.data['result']['list'];
|
||||
final int total = response.data['result']['total'] as int;
|
||||
final int currentSize = list.length as int;
|
||||
|
||||
if (currentSize == size && currentSize < total) {
|
||||
// If the number of returned inscriptions equals the limit and there are more inscriptions available,
|
||||
// increment the cursor and make the next API call to fetch the remaining inscriptions.
|
||||
final int newCursor = cursor + size;
|
||||
return getInscriptionsByAddress(address, cursor: newCursor, size: size);
|
||||
|
||||
} else {
|
||||
try {
|
||||
// Iterate through the list and create InscriptionData objects from each element
|
||||
final List<InscriptionData> inscriptions = (list as List<dynamic>)
|
||||
.map((json) => InscriptionData.fromJson(json as Map<String, dynamic>))
|
||||
.toList();
|
||||
|
||||
return inscriptions;
|
||||
} catch (e) {
|
||||
throw const FormatException('LitescribeAPI getInscriptionsByAddress exception: AddressInscriptionResponse.fromJson failure');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
/*
|
||||
* This file is part of Stack Wallet.
|
||||
*
|
||||
* Copyright (c) 2023 Cypher Stack
|
||||
* All Rights Reserved.
|
||||
* The code is distributed under GPLv3 license, see LICENSE file for details.
|
||||
* Generated by Cypher Stack on 2023-05-26
|
||||
*
|
||||
*/
|
||||
|
||||
import 'package:stackwallet/db/hive/db.dart';
|
||||
|
||||
mixin FiroHive {
|
||||
late final String _walletId;
|
||||
|
||||
void initFiroHive(String walletId) {
|
||||
_walletId = walletId;
|
||||
}
|
||||
|
||||
// jindex
|
||||
List? firoGetJIndex() {
|
||||
return DB.instance.get<dynamic>(boxName: _walletId, key: "jindex") as List?;
|
||||
}
|
||||
|
||||
Future<void> firoUpdateJIndex(List jIndex) async {
|
||||
await DB.instance.put<dynamic>(
|
||||
boxName: _walletId,
|
||||
key: "jindex",
|
||||
value: jIndex,
|
||||
);
|
||||
}
|
||||
|
||||
// _lelantus_coins
|
||||
List? firoGetLelantusCoins() {
|
||||
return DB.instance.get<dynamic>(boxName: _walletId, key: "_lelantus_coins")
|
||||
as List?;
|
||||
}
|
||||
|
||||
Future<void> firoUpdateLelantusCoins(List lelantusCoins) async {
|
||||
await DB.instance.put<dynamic>(
|
||||
boxName: _walletId,
|
||||
key: "_lelantus_coins",
|
||||
value: lelantusCoins,
|
||||
);
|
||||
}
|
||||
|
||||
// mintIndex
|
||||
int firoGetMintIndex() {
|
||||
return DB.instance.get<dynamic>(boxName: _walletId, key: "mintIndex")
|
||||
as int? ??
|
||||
0;
|
||||
}
|
||||
|
||||
Future<void> firoUpdateMintIndex(int mintIndex) async {
|
||||
await DB.instance.put<dynamic>(
|
||||
boxName: _walletId,
|
||||
key: "mintIndex",
|
||||
value: mintIndex,
|
||||
);
|
||||
}
|
||||
}
|
94
lib/services/mixins/ordinals_interface.dart
Normal file
|
@ -0,0 +1,94 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:stackwallet/db/isar/main_db.dart';
|
||||
import 'package:stackwallet/dto/ordinals/inscription_data.dart';
|
||||
import 'package:stackwallet/models/isar/models/blockchain_data/utxo.dart';
|
||||
import 'package:stackwallet/models/isar/ordinal.dart';
|
||||
import 'package:stackwallet/services/litescribe_api.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
|
||||
mixin OrdinalsInterface {
|
||||
late final String _walletId;
|
||||
late final Coin _coin;
|
||||
late final MainDB _db;
|
||||
|
||||
void initOrdinalsInterface({
|
||||
required String walletId,
|
||||
required Coin coin,
|
||||
required MainDB db,
|
||||
}) {
|
||||
_walletId = walletId;
|
||||
_coin = coin;
|
||||
_db = db;
|
||||
}
|
||||
|
||||
final LitescribeAPI litescribeAPI =
|
||||
LitescribeAPI(baseUrl: 'https://litescribe.io/api');
|
||||
|
||||
Future<void> refreshInscriptions() async {
|
||||
final uniqueAddresses = await _db
|
||||
.getUTXOs(_walletId)
|
||||
.filter()
|
||||
.addressIsNotNull()
|
||||
.distinctByAddress()
|
||||
.addressProperty()
|
||||
.findAll();
|
||||
final inscriptions =
|
||||
await _getInscriptionDataFromAddresses(uniqueAddresses.cast<String>());
|
||||
|
||||
final ords = inscriptions
|
||||
.map((e) => Ordinal.fromInscriptionData(e, _walletId))
|
||||
.toList();
|
||||
|
||||
await _db.isar.writeTxn(() async {
|
||||
await _db.isar.ordinals
|
||||
.where()
|
||||
.filter()
|
||||
.walletIdEqualTo(_walletId)
|
||||
.deleteAll();
|
||||
await _db.isar.ordinals.putAll(ords);
|
||||
});
|
||||
}
|
||||
|
||||
Future<List<InscriptionData>> _getInscriptionDataFromAddresses(
|
||||
List<String> addresses) async {
|
||||
List<InscriptionData> allInscriptions = [];
|
||||
for (String address in addresses) {
|
||||
try {
|
||||
var inscriptions =
|
||||
await litescribeAPI.getInscriptionsByAddress(address);
|
||||
allInscriptions.addAll(inscriptions);
|
||||
} catch (e) {
|
||||
throw Exception("Error fetching inscriptions for address $address: $e");
|
||||
}
|
||||
}
|
||||
return allInscriptions;
|
||||
}
|
||||
|
||||
// check if an inscription is in a given <UTXO> output
|
||||
Future<bool> inscriptionInOutput(UTXO output) async {
|
||||
if (output.address != null) {
|
||||
var inscriptions =
|
||||
await litescribeAPI.getInscriptionsByAddress("${output.address}");
|
||||
if (inscriptions.isNotEmpty) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
throw UnimplementedError(
|
||||
'TODO look up utxo without address. utxo->txid:output->address');
|
||||
}
|
||||
}
|
||||
|
||||
// check if an inscription is in a given <UTXO> output
|
||||
Future<bool> inscriptionInAddress(String address) async {
|
||||
var inscriptions = await litescribeAPI.getInscriptionsByAddress(address);
|
||||
if (inscriptions.isNotEmpty) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
130
lib/services/nano_api.dart
Normal file
|
@ -0,0 +1,130 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:nanodart/nanodart.dart';
|
||||
|
||||
class NanoAPI {
|
||||
static Future<
|
||||
({
|
||||
NAccountInfo? accountInfo,
|
||||
Exception? exception,
|
||||
})> getAccountInfo({
|
||||
required Uri server,
|
||||
required bool representative,
|
||||
required String account,
|
||||
}) async {
|
||||
NAccountInfo? accountInfo;
|
||||
Exception? exception;
|
||||
|
||||
try {
|
||||
final response = await http.post(
|
||||
server,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: jsonEncode({
|
||||
"action": "account_info",
|
||||
"representative": "true",
|
||||
"account": account,
|
||||
}),
|
||||
);
|
||||
|
||||
final map = jsonDecode(response.body);
|
||||
|
||||
if (map is Map && map["error"] != null) {
|
||||
throw Exception(map["error"].toString());
|
||||
}
|
||||
|
||||
accountInfo = NAccountInfo(
|
||||
frontier: map["frontier"] as String,
|
||||
representative: map["representative"] as String,
|
||||
);
|
||||
} on Exception catch (e) {
|
||||
exception = e;
|
||||
} catch (e) {
|
||||
exception = Exception(e.toString());
|
||||
}
|
||||
|
||||
return (accountInfo: accountInfo, exception: exception);
|
||||
}
|
||||
|
||||
static Future<bool> changeRepresentative({
|
||||
required Uri server,
|
||||
required int accountType,
|
||||
required String account,
|
||||
required String newRepresentative,
|
||||
required String previousBlock,
|
||||
required String balance,
|
||||
required String privateKey,
|
||||
required String work,
|
||||
}) async {
|
||||
Map<String, String> block = {
|
||||
"type": "state",
|
||||
"account": account,
|
||||
"previous": previousBlock,
|
||||
"representative": newRepresentative,
|
||||
"balance": balance,
|
||||
"link":
|
||||
"0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"work": work,
|
||||
};
|
||||
|
||||
final String hash;
|
||||
|
||||
try {
|
||||
hash = NanoBlocks.computeStateHash(
|
||||
accountType,
|
||||
account,
|
||||
previousBlock,
|
||||
newRepresentative,
|
||||
BigInt.parse(balance),
|
||||
block["link"] as String,
|
||||
);
|
||||
} catch (e) {
|
||||
if (e is RangeError) {
|
||||
throw Exception("Invalid representative format");
|
||||
}
|
||||
rethrow;
|
||||
}
|
||||
|
||||
final signature = NanoSignatures.signBlock(hash, privateKey);
|
||||
|
||||
block["signature"] = signature;
|
||||
|
||||
final map = await postBlock(server: server, block: block);
|
||||
|
||||
if (map is Map && map["error"] != null) {
|
||||
throw Exception(map["error"].toString());
|
||||
}
|
||||
|
||||
return map["error"] == null;
|
||||
}
|
||||
|
||||
// TODO: GET RID OF DYNAMIC AND USED TYPED DATA
|
||||
static Future<dynamic> postBlock({
|
||||
required Uri server,
|
||||
required Map<String, dynamic> block,
|
||||
}) async {
|
||||
final response = await http.post(
|
||||
server,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: jsonEncode({
|
||||
"action": "process",
|
||||
"json_block": "true",
|
||||
"subtype": "change",
|
||||
"block": block,
|
||||
}),
|
||||
);
|
||||
|
||||
return jsonDecode(response.body);
|
||||
}
|
||||
}
|
||||
|
||||
class NAccountInfo {
|
||||
final String frontier;
|
||||
final String representative;
|
||||
|
||||
NAccountInfo({required this.frontier, required this.representative});
|
||||
}
|
|
@ -26,6 +26,7 @@ class NotificationApi {
|
|||
priority: Priority.high,
|
||||
ticker: 'ticker'),
|
||||
iOS: IOSNotificationDetails(),
|
||||
macOS: MacOSNotificationDetails(),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -34,8 +35,13 @@ class NotificationApi {
|
|||
const iOS = IOSInitializationSettings();
|
||||
const linux = LinuxInitializationSettings(
|
||||
defaultActionName: "temporary_stack_wallet");
|
||||
const settings =
|
||||
InitializationSettings(android: android, iOS: iOS, linux: linux);
|
||||
const macOS = MacOSInitializationSettings();
|
||||
const settings = InitializationSettings(
|
||||
android: android,
|
||||
iOS: iOS,
|
||||
linux: linux,
|
||||
macOS: macOS,
|
||||
);
|
||||
await _notifications.initialize(
|
||||
settings,
|
||||
onSelectNotification: (payload) async {
|
||||
|
@ -71,8 +77,10 @@ class NotificationApi {
|
|||
final id = prefs.currentNotificationId;
|
||||
|
||||
String confirms = "";
|
||||
if (txid != null) {
|
||||
confirms = " (${confirmations!}/${requiredConfirmations!})";
|
||||
if (txid != null &&
|
||||
confirmations != null &&
|
||||
requiredConfirmations != null) {
|
||||
confirms = " ($confirmations/$requiredConfirmations)";
|
||||
}
|
||||
|
||||
final NotificationModel model = NotificationModel(
|
||||
|
|
|
@ -22,3 +22,14 @@ final coinCardProvider = Provider.family<String?, Coin>((ref, coin) {
|
|||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
final coinCardFavoritesProvider = Provider.family<String?, Coin>((ref, coin) {
|
||||
final assets = ref.watch(themeAssetsProvider);
|
||||
|
||||
if (assets is ThemeAssetsV3) {
|
||||
return assets.coinCardFavoritesImages?[coin.mainNetVersion] ??
|
||||
assets.coinCardImages?[coin.mainNetVersion];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -70,6 +70,11 @@ class AmountFormatter {
|
|||
String string, {
|
||||
EthContract? ethContract,
|
||||
}) {
|
||||
return unit.tryParse(string, locale: locale, coin: coin);
|
||||
return unit.tryParse(
|
||||
string,
|
||||
locale: locale,
|
||||
coin: coin,
|
||||
tokenContract: ethContract,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -170,6 +170,7 @@ extension AmountUnitExt on AmountUnit {
|
|||
required String locale,
|
||||
required Coin coin,
|
||||
EthContract? tokenContract,
|
||||
bool overrideWithDecimalPlacesFromString = false,
|
||||
}) {
|
||||
final precisionLost = value.startsWith("~");
|
||||
|
||||
|
@ -203,7 +204,9 @@ extension AmountUnitExt on AmountUnit {
|
|||
return null;
|
||||
}
|
||||
|
||||
final decimalPlaces = tokenContract?.decimals ?? coin.decimals;
|
||||
final decimalPlaces = overrideWithDecimalPlacesFromString
|
||||
? decimal.scale
|
||||
: tokenContract?.decimals ?? coin.decimals;
|
||||
final realShift = math.min(shift, decimalPlaces);
|
||||
|
||||
return decimal.shift(0 - realShift).toAmount(fractionDigits: decimalPlaces);
|
||||
|
|
|
@ -92,6 +92,7 @@ class _SVG {
|
|||
|
||||
final coinControl = const _COIN_CONTROL();
|
||||
|
||||
String get monkey => "assets/svg/monkey.svg";
|
||||
String get circleSliders => "assets/svg/configuration.svg";
|
||||
String get circlePlus => "assets/svg/plus-circle.svg";
|
||||
String get circlePlusFilled => "assets/svg/circle-plus-filled.svg";
|
||||
|
@ -205,6 +206,8 @@ class _SVG {
|
|||
String get messageQuestion => "assets/svg/message-question-1.svg";
|
||||
String get list => "assets/svg/list-ul.svg";
|
||||
String get unclaimedPaynym => "assets/svg/unclaimed.svg";
|
||||
String get send => "assets/svg/send.svg";
|
||||
String get ordinal => "assets/svg/ordinal.svg";
|
||||
|
||||
String get trocadorRatingA => "assets/svg/trocador_rating_a.svg";
|
||||
String get trocadorRatingB => "assets/svg/trocador_rating_b.svg";
|
||||
|
|
|
@ -59,7 +59,7 @@ abstract class Constants {
|
|||
// Enable Logger.print statements
|
||||
static const bool disableLogger = false;
|
||||
|
||||
static const int currentDataVersion = 10;
|
||||
static const int currentDataVersion = 11;
|
||||
|
||||
static const int rescanV1 = 1;
|
||||
|
||||
|
|
|
@ -180,7 +180,6 @@ class DbVersionMigrator with WalletDB {
|
|||
// clear possible broken firo cache
|
||||
await DB.instance.clearSharedTransactionCache(coin: Coin.firo);
|
||||
|
||||
|
||||
// update version
|
||||
await DB.instance.put<dynamic>(
|
||||
boxName: DB.boxNameDBInfo, key: "hive_data_version", value: 4);
|
||||
|
@ -343,12 +342,85 @@ class DbVersionMigrator with WalletDB {
|
|||
// try to continue migrating
|
||||
return await migrate(10, secureStore: secureStore);
|
||||
|
||||
case 10:
|
||||
// migrate
|
||||
await _v10(secureStore);
|
||||
|
||||
// update version
|
||||
await DB.instance.put<dynamic>(
|
||||
boxName: DB.boxNameDBInfo, key: "hive_data_version", value: 11);
|
||||
|
||||
// try to continue migrating
|
||||
return await migrate(11, secureStore: secureStore);
|
||||
|
||||
default:
|
||||
// finally return
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _v10(SecureStorageInterface secureStore) async {
|
||||
await Hive.openBox<dynamic>(DB.boxNameAllWalletsData);
|
||||
await Hive.openBox<dynamic>(DB.boxNamePrefs);
|
||||
final walletsService = WalletsService(secureStorageInterface: secureStore);
|
||||
final prefs = Prefs.instance;
|
||||
final walletInfoList = await walletsService.walletNames;
|
||||
await prefs.init();
|
||||
await MainDB.instance.initMainDB();
|
||||
|
||||
for (final walletId in walletInfoList.keys) {
|
||||
final info = walletInfoList[walletId]!;
|
||||
assert(info.walletId == walletId);
|
||||
|
||||
if (info.coin == Coin.firo &&
|
||||
MainDB.instance.isar.lelantusCoins
|
||||
.where()
|
||||
.walletIdEqualTo(walletId)
|
||||
.countSync() ==
|
||||
0) {
|
||||
final walletBox = await Hive.openBox<dynamic>(walletId);
|
||||
|
||||
final hiveLCoins = DB.instance.get<dynamic>(
|
||||
boxName: walletId,
|
||||
key: "_lelantus_coins",
|
||||
) as List? ??
|
||||
[];
|
||||
|
||||
final jindexes = (DB.instance
|
||||
.get<dynamic>(boxName: walletId, key: "jindex") as List? ??
|
||||
[])
|
||||
.cast<int>();
|
||||
|
||||
final List<isar_models.LelantusCoin> coins = [];
|
||||
for (final e in hiveLCoins) {
|
||||
final map = e as Map;
|
||||
final lcoin = map.values.first as LelantusCoin;
|
||||
|
||||
final isJMint = jindexes.contains(lcoin.index);
|
||||
|
||||
final coin = isar_models.LelantusCoin(
|
||||
walletId: walletId,
|
||||
txid: lcoin.txId,
|
||||
value: lcoin.value.toString(),
|
||||
mintIndex: lcoin.index,
|
||||
anonymitySetId: lcoin.anonymitySetId,
|
||||
isUsed: lcoin.isUsed,
|
||||
isJMint: isJMint,
|
||||
otherData: null,
|
||||
);
|
||||
|
||||
coins.add(coin);
|
||||
}
|
||||
|
||||
if (coins.isNotEmpty) {
|
||||
await MainDB.instance.isar.writeTxn(() async {
|
||||
await MainDB.instance.isar.lelantusCoins.putAll(coins);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _v4(SecureStorageInterface secureStore) async {
|
||||
await Hive.openBox<dynamic>(DB.boxNameAllWalletsData);
|
||||
await Hive.openBox<dynamic>(DB.boxNamePrefs);
|
||||
|
|
|
@ -12,15 +12,17 @@ import 'dart:async';
|
|||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/logger.dart';
|
||||
import 'package:stackwallet/widgets/custom_loading_overlay.dart';
|
||||
|
||||
Future<T> showLoading<T>({
|
||||
Future<T?> showLoading<T>({
|
||||
required Future<T> whileFuture,
|
||||
required BuildContext context,
|
||||
required String message,
|
||||
String? subMessage,
|
||||
bool isDesktop = false,
|
||||
bool opaqueBG = false,
|
||||
void Function(Exception)? onException,
|
||||
}) async {
|
||||
unawaited(
|
||||
showDialog<void>(
|
||||
|
@ -43,10 +45,24 @@ Future<T> showLoading<T>({
|
|||
),
|
||||
);
|
||||
|
||||
final result = await whileFuture;
|
||||
Exception? ex;
|
||||
T? result;
|
||||
|
||||
try {
|
||||
result = await whileFuture;
|
||||
} catch (e, s) {
|
||||
Logging.instance.log(
|
||||
"showLoading caught: $e\n$s",
|
||||
level: LogLevel.Warning,
|
||||
);
|
||||
ex = e is Exception ? e : Exception(e.toString());
|
||||
}
|
||||
|
||||
if (context.mounted) {
|
||||
Navigator.of(context, rootNavigator: isDesktop).pop();
|
||||
if (ex != null) {
|
||||
onException?.call(ex);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -27,8 +27,8 @@ abstract class StackFileSystem {
|
|||
} else if (Platform.isWindows) {
|
||||
appDirectory = await getApplicationSupportDirectory();
|
||||
} else if (Platform.isMacOS) {
|
||||
// currently run in ipad mode??
|
||||
throw Exception("Unsupported platform");
|
||||
appDirectory = await getLibraryDirectory();
|
||||
appDirectory = Directory("${appDirectory.path}/stackwallet");
|
||||
} else if (Platform.isIOS) {
|
||||
// todo: check if we need different behaviour here
|
||||
if (Util.isDesktop) {
|
||||
|
|
|
@ -306,6 +306,17 @@ class STextStyles {
|
|||
}
|
||||
}
|
||||
|
||||
static TextStyle w600_16(BuildContext context) {
|
||||
switch (_theme(context).themeId) {
|
||||
default:
|
||||
return GoogleFonts.inter(
|
||||
color: _theme(context).textDark,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 16,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
static TextStyle w500_14(BuildContext context) {
|
||||
switch (_theme(context).themeId) {
|
||||
default:
|
||||
|
@ -339,6 +350,17 @@ class STextStyles {
|
|||
}
|
||||
}
|
||||
|
||||
static TextStyle w500_8(BuildContext context) {
|
||||
switch (_theme(context).themeId) {
|
||||
default:
|
||||
return GoogleFonts.inter(
|
||||
color: _theme(context).textSubtitle1,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 8,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
static TextStyle w600_20(BuildContext context) {
|
||||
switch (_theme(context).themeId) {
|
||||
default:
|
||||
|
|
|
@ -25,11 +25,13 @@ class CoinCard extends ConsumerWidget {
|
|||
required this.walletId,
|
||||
required this.width,
|
||||
required this.height,
|
||||
required this.isFavorite,
|
||||
});
|
||||
|
||||
final String walletId;
|
||||
final double width;
|
||||
final double height;
|
||||
final bool isFavorite;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
|
@ -38,7 +40,7 @@ class CoinCard extends ConsumerWidget {
|
|||
.select((value) => value.getManager(walletId).coin),
|
||||
);
|
||||
|
||||
final bool hasCardImageBg = ref.watch(coinCardProvider(coin)) != null;
|
||||
final bool hasCardImageBg = (isFavorite) ? ref.watch(coinCardFavoritesProvider(coin)) != null : ref.watch(coinCardProvider(coin)) != null;
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
|
@ -54,7 +56,9 @@ class CoinCard extends ConsumerWidget {
|
|||
fit: BoxFit.cover,
|
||||
image: FileImage(
|
||||
File(
|
||||
ref.watch(coinCardProvider(coin))!,
|
||||
(isFavorite)
|
||||
? ref.watch(coinCardFavoritesProvider(coin))!
|
||||
: ref.watch(coinCardProvider(coin))!,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -13,6 +13,7 @@ import 'dart:async';
|
|||
import 'package:event_bus/event_bus.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/services/notifications_api.dart';
|
||||
import 'package:stackwallet/themes/coin_icon_provider.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
|
@ -84,6 +85,8 @@ class _CryptoNotificationsState extends ConsumerState<CryptoNotifications> {
|
|||
|
||||
@override
|
||||
void initState() {
|
||||
NotificationApi.prefs = ref.read(prefsChangeNotifierProvider);
|
||||
NotificationApi.notificationsService = ref.read(notificationsProvider);
|
||||
_streamSubscription = CryptoNotificationsEventBus.instance
|
||||
.on<CryptoNotificationEvent>()
|
||||
.listen(
|
||||
|
|
|
@ -230,7 +230,9 @@ class _TransactionCardState extends ConsumerState<TransactionCard> {
|
|||
fit: BoxFit.scaleDown,
|
||||
child: Text(
|
||||
_transaction.isCancelled
|
||||
? "Cancelled"
|
||||
? coin == Coin.ethereum
|
||||
? "Failed"
|
||||
: "Cancelled"
|
||||
: whatIsIt(
|
||||
_transaction.type,
|
||||
coin,
|
||||
|
|
|
@ -140,7 +140,7 @@ class SimpleWalletCard extends ConsumerWidget {
|
|||
isDesktop: Util.isDesktop,
|
||||
);
|
||||
|
||||
if (!success) {
|
||||
if (!success!) {
|
||||
// TODO: show error dialog here?
|
||||
Logging.instance.log(
|
||||
"Failed to load token wallet for $contract",
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* This file is part of Stack Wallet.
|
||||
*
|
||||
* Copyright (c) 2023 Cypher Stack
|
||||
* All Rights Reserved.
|
||||
* The code is distributed under GPLv3 license, see LICENSE file for details.
|
||||
* Generated by Cypher Stack on 2023-05-26
|
||||
*
|
||||
*/
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
|
||||
class OrdinalsNavIcon extends StatelessWidget {
|
||||
const OrdinalsNavIcon({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SvgPicture.asset(
|
||||
Assets.svg.ordinal,
|
||||
height: 20,
|
||||
width: 20,
|
||||
color: Theme.of(context).extension<StackColors>()!.bottomNavIconIcon,
|
||||
);
|
||||
}
|
||||
}
|
|
@ -6,6 +6,9 @@ import FlutterMacOS
|
|||
import Foundation
|
||||
|
||||
import connectivity_plus
|
||||
import cw_monero
|
||||
import cw_shared_external
|
||||
import cw_wownero
|
||||
import desktop_drop
|
||||
import device_info_plus
|
||||
import devicelocale
|
||||
|
@ -13,10 +16,10 @@ import flutter_libepiccash
|
|||
import flutter_local_notifications
|
||||
import flutter_secure_storage_macos
|
||||
import isar_flutter_libs
|
||||
import lelantus
|
||||
import package_info_plus
|
||||
import path_provider_foundation
|
||||
import share_plus
|
||||
import shared_preferences_foundation
|
||||
import stack_wallet_backup
|
||||
import url_launcher_macos
|
||||
import wakelock_macos
|
||||
|
@ -24,6 +27,9 @@ import window_size
|
|||
|
||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
|
||||
CwMoneroPlugin.register(with: registry.registrar(forPlugin: "CwMoneroPlugin"))
|
||||
CwSharedExternalPlugin.register(with: registry.registrar(forPlugin: "CwSharedExternalPlugin"))
|
||||
CwWowneroPlugin.register(with: registry.registrar(forPlugin: "CwWowneroPlugin"))
|
||||
DesktopDropPlugin.register(with: registry.registrar(forPlugin: "DesktopDropPlugin"))
|
||||
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
|
||||
DevicelocalePlugin.register(with: registry.registrar(forPlugin: "DevicelocalePlugin"))
|
||||
|
@ -31,10 +37,10 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
|||
FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))
|
||||
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
|
||||
IsarFlutterLibsPlugin.register(with: registry.registrar(forPlugin: "IsarFlutterLibsPlugin"))
|
||||
LelantusPlugin.register(with: registry.registrar(forPlugin: "LelantusPlugin"))
|
||||
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
|
||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||
StackWalletBackupPlugin.register(with: registry.registrar(forPlugin: "StackWalletBackupPlugin"))
|
||||
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
||||
WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin"))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
platform :osx, '10.11'
|
||||
platform :osx, '10.14'
|
||||
|
||||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||
|
@ -31,6 +31,9 @@ target 'Runner' do
|
|||
use_modular_headers!
|
||||
|
||||
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
|
||||
target 'RunnerTests' do
|
||||
inherit! :search_paths
|
||||
end
|
||||
end
|
||||
|
||||
post_install do |installer|
|
||||
|
|
|
@ -1,24 +1,76 @@
|
|||
PODS:
|
||||
- connectivity_plus_macos (0.0.1):
|
||||
- connectivity_plus (0.0.1):
|
||||
- FlutterMacOS
|
||||
- ReachabilitySwift
|
||||
- cw_monero (0.0.1):
|
||||
- cw_monero/Boost (= 0.0.1)
|
||||
- cw_monero/Monero (= 0.0.1)
|
||||
- cw_monero/OpenSSL (= 0.0.1)
|
||||
- cw_monero/Sodium (= 0.0.1)
|
||||
- cw_monero/Unbound (= 0.0.1)
|
||||
- FlutterMacOS
|
||||
- cw_monero/Boost (0.0.1):
|
||||
- FlutterMacOS
|
||||
- cw_monero/Monero (0.0.1):
|
||||
- FlutterMacOS
|
||||
- cw_monero/OpenSSL (0.0.1):
|
||||
- FlutterMacOS
|
||||
- cw_monero/Sodium (0.0.1):
|
||||
- FlutterMacOS
|
||||
- cw_monero/Unbound (0.0.1):
|
||||
- FlutterMacOS
|
||||
- cw_shared_external (0.0.1):
|
||||
- cw_shared_external/Boost (= 0.0.1)
|
||||
- cw_shared_external/OpenSSL (= 0.0.1)
|
||||
- cw_shared_external/Sodium (= 0.0.1)
|
||||
- FlutterMacOS
|
||||
- cw_shared_external/Boost (0.0.1):
|
||||
- FlutterMacOS
|
||||
- cw_shared_external/OpenSSL (0.0.1):
|
||||
- FlutterMacOS
|
||||
- cw_shared_external/Sodium (0.0.1):
|
||||
- FlutterMacOS
|
||||
- cw_wownero (0.0.1):
|
||||
- cw_wownero/Boost (= 0.0.1)
|
||||
- cw_wownero/OpenSSL (= 0.0.1)
|
||||
- cw_wownero/Sodium (= 0.0.1)
|
||||
- cw_wownero/Unbound (= 0.0.1)
|
||||
- cw_wownero/Wownero (= 0.0.1)
|
||||
- FlutterMacOS
|
||||
- cw_wownero/Boost (0.0.1):
|
||||
- FlutterMacOS
|
||||
- cw_wownero/OpenSSL (0.0.1):
|
||||
- FlutterMacOS
|
||||
- cw_wownero/Sodium (0.0.1):
|
||||
- FlutterMacOS
|
||||
- cw_wownero/Unbound (0.0.1):
|
||||
- FlutterMacOS
|
||||
- cw_wownero/Wownero (0.0.1):
|
||||
- FlutterMacOS
|
||||
- desktop_drop (0.0.1):
|
||||
- FlutterMacOS
|
||||
- device_info_plus (0.0.1):
|
||||
- FlutterMacOS
|
||||
- devicelocale (0.0.1):
|
||||
- FlutterMacOS
|
||||
- flutter_libepiccash (0.0.1):
|
||||
- FlutterMacOS
|
||||
- flutter_local_notifications (0.0.1):
|
||||
- FlutterMacOS
|
||||
- flutter_secure_storage_macos (3.3.1):
|
||||
- flutter_secure_storage_macos (6.1.1):
|
||||
- FlutterMacOS
|
||||
- FlutterMacOS (1.0.0)
|
||||
- isar_flutter_libs (1.0.0):
|
||||
- FlutterMacOS
|
||||
- package_info_plus_macos (0.0.1):
|
||||
- lelantus (0.0.1):
|
||||
- FlutterMacOS
|
||||
- path_provider_macos (0.0.1):
|
||||
- package_info_plus (0.0.1):
|
||||
- FlutterMacOS
|
||||
- path_provider_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- ReachabilitySwift (5.0.0)
|
||||
- share_plus_macos (0.0.1):
|
||||
- FlutterMacOS
|
||||
- shared_preferences_macos (0.0.1):
|
||||
- share_plus (0.0.1):
|
||||
- FlutterMacOS
|
||||
- stack_wallet_backup (0.0.1):
|
||||
- FlutterMacOS
|
||||
|
@ -30,16 +82,22 @@ PODS:
|
|||
- FlutterMacOS
|
||||
|
||||
DEPENDENCIES:
|
||||
- connectivity_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus_macos/macos`)
|
||||
- connectivity_plus (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos`)
|
||||
- cw_monero (from `Flutter/ephemeral/.symlinks/plugins/cw_monero/macos`)
|
||||
- cw_shared_external (from `Flutter/ephemeral/.symlinks/plugins/cw_shared_external/macos`)
|
||||
- cw_wownero (from `Flutter/ephemeral/.symlinks/plugins/cw_wownero/macos`)
|
||||
- desktop_drop (from `Flutter/ephemeral/.symlinks/plugins/desktop_drop/macos`)
|
||||
- device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`)
|
||||
- devicelocale (from `Flutter/ephemeral/.symlinks/plugins/devicelocale/macos`)
|
||||
- flutter_libepiccash (from `Flutter/ephemeral/.symlinks/plugins/flutter_libepiccash/macos`)
|
||||
- flutter_local_notifications (from `Flutter/ephemeral/.symlinks/plugins/flutter_local_notifications/macos`)
|
||||
- flutter_secure_storage_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos`)
|
||||
- FlutterMacOS (from `Flutter/ephemeral`)
|
||||
- isar_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/isar_flutter_libs/macos`)
|
||||
- package_info_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos`)
|
||||
- path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`)
|
||||
- share_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/share_plus_macos/macos`)
|
||||
- shared_preferences_macos (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos`)
|
||||
- lelantus (from `Flutter/ephemeral/.symlinks/plugins/lelantus/macos`)
|
||||
- package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`)
|
||||
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
|
||||
- share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`)
|
||||
- stack_wallet_backup (from `Flutter/ephemeral/.symlinks/plugins/stack_wallet_backup/macos`)
|
||||
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
|
||||
- wakelock_macos (from `Flutter/ephemeral/.symlinks/plugins/wakelock_macos/macos`)
|
||||
|
@ -50,8 +108,20 @@ SPEC REPOS:
|
|||
- ReachabilitySwift
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
connectivity_plus_macos:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/connectivity_plus_macos/macos
|
||||
connectivity_plus:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos
|
||||
cw_monero:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/cw_monero/macos
|
||||
cw_shared_external:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/cw_shared_external/macos
|
||||
cw_wownero:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/cw_wownero/macos
|
||||
desktop_drop:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/desktop_drop/macos
|
||||
device_info_plus:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos
|
||||
devicelocale:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/devicelocale/macos
|
||||
flutter_libepiccash:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/flutter_libepiccash/macos
|
||||
flutter_local_notifications:
|
||||
|
@ -62,14 +132,14 @@ EXTERNAL SOURCES:
|
|||
:path: Flutter/ephemeral
|
||||
isar_flutter_libs:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/isar_flutter_libs/macos
|
||||
package_info_plus_macos:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos
|
||||
path_provider_macos:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos
|
||||
share_plus_macos:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/share_plus_macos/macos
|
||||
shared_preferences_macos:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos
|
||||
lelantus:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/lelantus/macos
|
||||
package_info_plus:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos
|
||||
path_provider_foundation:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
|
||||
share_plus:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos
|
||||
stack_wallet_backup:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/stack_wallet_backup/macos
|
||||
url_launcher_macos:
|
||||
|
@ -80,22 +150,28 @@ EXTERNAL SOURCES:
|
|||
:path: Flutter/ephemeral/.symlinks/plugins/window_size/macos
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
connectivity_plus_macos: f6e86fd000e971d361e54b5afcadc8c8fa773308
|
||||
flutter_libepiccash: b33f7396504712b513b8ff019a3f6f3bdae54cfb
|
||||
connectivity_plus: 18d3c32514c886e046de60e9c13895109866c747
|
||||
cw_monero: a3442556ad3c06365c912735e4a23942a28692b1
|
||||
cw_shared_external: 1f631d1132521baac5f4caed43176fa10d4e0d8b
|
||||
cw_wownero: b4adb1e701fc363de27fa222fcaf4eff6f5fa63a
|
||||
desktop_drop: 69eeff437544aa619c8db7f4481b3a65f7696898
|
||||
device_info_plus: 5401765fde0b8d062a2f8eb65510fb17e77cf07f
|
||||
devicelocale: 9f0f36ac651cabae2c33f32dcff4f32b61c38225
|
||||
flutter_libepiccash: 9113ac75dd325f8bcf00bc3ab583c7fc2780cf3c
|
||||
flutter_local_notifications: 3805ca215b2fb7f397d78b66db91f6a747af52e4
|
||||
flutter_secure_storage_macos: 6ceee8fbc7f484553ad17f79361b556259df89aa
|
||||
FlutterMacOS: ae6af50a8ea7d6103d888583d46bd8328a7e9811
|
||||
isar_flutter_libs: 1948109973b6c2e46d6196b1537688a36a6edeac
|
||||
package_info_plus_macos: f010621b07802a241d96d01876d6705f15e77c1c
|
||||
path_provider_macos: 3c0c3b4b0d4a76d2bf989a913c2de869c5641a19
|
||||
flutter_secure_storage_macos: d56e2d218c1130b262bef8b4a7d64f88d7f9c9ea
|
||||
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
|
||||
isar_flutter_libs: 43385c99864c168fadba7c9adeddc5d38838ca6a
|
||||
lelantus: 3dfbf92b1e66b3573494dfe3d6a21c4988b5361b
|
||||
package_info_plus: 02d7a575e80f194102bef286361c6c326e4c29ce
|
||||
path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8
|
||||
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
|
||||
share_plus_macos: 853ee48e7dce06b633998ca0735d482dd671ade4
|
||||
shared_preferences_macos: a64dc611287ed6cbe28fd1297898db1336975727
|
||||
share_plus: 76dd39142738f7a68dd57b05093b5e8193f220f7
|
||||
stack_wallet_backup: 6ebc60b1bdcf11cf1f1cbad9aa78332e1e15778c
|
||||
url_launcher_macos: 597e05b8e514239626bcf4a850fcf9ef5c856ec3
|
||||
url_launcher_macos: 5335912b679c073563f29d89d33d10d459f95451
|
||||
wakelock_macos: bc3f2a9bd8d2e6c89fee1e1822e7ddac3bd004a9
|
||||
window_size: 339dafa0b27a95a62a843042038fa6c3c48de195
|
||||
|
||||
PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c
|
||||
PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367
|
||||
|
||||
COCOAPODS: 1.11.3
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 51;
|
||||
objectVersion = 54;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXAggregateTarget section */
|
||||
|
@ -21,15 +21,27 @@
|
|||
/* End PBXAggregateTarget section */
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; };
|
||||
335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; };
|
||||
33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; };
|
||||
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
|
||||
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
|
||||
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
|
||||
36299DF6FDF6725B2B9C51D5 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BB87EF657A3ADFB1CE3E959 /* Pods_Runner.framework */; };
|
||||
B98151812A674022009D013C /* mobileliblelantus.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B98151802A674022009D013C /* mobileliblelantus.framework */; };
|
||||
B98151822A67402A009D013C /* mobileliblelantus.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = B98151802A674022009D013C /* mobileliblelantus.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
B98151842A674143009D013C /* libsqlite3.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = B98151832A674143009D013C /* libsqlite3.0.tbd */; };
|
||||
BFD0376C00E1FFD46376BB9D /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9206484E84CB0AD93E3E68CA /* Pods_RunnerTests.framework */; };
|
||||
F653CA022D33E8B60E11A9F3 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E6036BF01BF05EA773C76D22 /* Pods_Runner.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 33CC10E52044A3C60003C045 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 33CC10EC2044A3C60003C045;
|
||||
remoteInfo = Runner;
|
||||
};
|
||||
33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 33CC10E52044A3C60003C045 /* Project object */;
|
||||
|
@ -46,6 +58,7 @@
|
|||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
B98151822A67402A009D013C /* mobileliblelantus.framework in Bundle Framework */,
|
||||
);
|
||||
name = "Bundle Framework";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -53,9 +66,14 @@
|
|||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0FA914E59929120BA65E8403 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||
174539D042E7AC2AB25A83EB /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
27CB73AACA5743180CC6CD50 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
|
||||
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
|
||||
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
|
||||
33CC10ED2044A3C60003C045 /* Stack Wallet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Stack Wallet.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
33CC10ED2044A3C60003C045 /* Stack Wallet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Stack Wallet.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
|
||||
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
|
@ -67,26 +85,47 @@
|
|||
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
|
||||
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
|
||||
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
|
||||
6BB87EF657A3ADFB1CE3E959 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
41EE721BF40B8DE895352A2C /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
|
||||
937DF254AD7EDA15AFE96BD9 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||
9206484E84CB0AD93E3E68CA /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
|
||||
BC4589C48A71C3A1A477DD76 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
EA2D897BC13EBFB1DE697D5C /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
ACB8E553D75AA4AC9A7656CE /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
B98151802A674022009D013C /* mobileliblelantus.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = mobileliblelantus.framework; path = ../crypto_plugins/flutter_liblelantus/scripts/macos/mobileliblelantus/mobileliblelantus.framework; sourceTree = "<group>"; };
|
||||
B98151832A674143009D013C /* libsqlite3.0.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.0.tbd; path = usr/lib/libsqlite3.0.tbd; sourceTree = SDKROOT; };
|
||||
BF5E76865ACB46314AC27D8F /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
E6036BF01BF05EA773C76D22 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
331C80D2294CF70F00263BE5 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
BFD0376C00E1FFD46376BB9D /* Pods_RunnerTests.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
33CC10EA2044A3C60003C045 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
36299DF6FDF6725B2B9C51D5 /* Pods_Runner.framework in Frameworks */,
|
||||
B98151842A674143009D013C /* libsqlite3.0.tbd in Frameworks */,
|
||||
B98151812A674022009D013C /* mobileliblelantus.framework in Frameworks */,
|
||||
F653CA022D33E8B60E11A9F3 /* Pods_Runner.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
331C80D6294CF71000263BE5 /* RunnerTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
331C80D7294CF71000263BE5 /* RunnerTests.swift */,
|
||||
);
|
||||
path = RunnerTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
33BA886A226E78AF003329D5 /* Configs */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -103,9 +142,10 @@
|
|||
children = (
|
||||
33FAB671232836740065AC1E /* Runner */,
|
||||
33CEB47122A05771004F2AC0 /* Flutter */,
|
||||
331C80D6294CF71000263BE5 /* RunnerTests */,
|
||||
33CC10EE2044A3C60003C045 /* Products */,
|
||||
D73912EC22F37F3D000D13A0 /* Frameworks */,
|
||||
9000119722579F22067B9BC0 /* Pods */,
|
||||
F0D4A0626F78BE1EF2A1E0D6 /* Pods */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
|
@ -113,6 +153,7 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
33CC10ED2044A3C60003C045 /* Stack Wallet.app */,
|
||||
331C80D5294CF71000263BE5 /* RunnerTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
|
@ -152,39 +193,63 @@
|
|||
path = Runner;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9000119722579F22067B9BC0 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
EA2D897BC13EBFB1DE697D5C /* Pods-Runner.debug.xcconfig */,
|
||||
937DF254AD7EDA15AFE96BD9 /* Pods-Runner.release.xcconfig */,
|
||||
BC4589C48A71C3A1A477DD76 /* Pods-Runner.profile.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6BB87EF657A3ADFB1CE3E959 /* Pods_Runner.framework */,
|
||||
B98151832A674143009D013C /* libsqlite3.0.tbd */,
|
||||
B98151802A674022009D013C /* mobileliblelantus.framework */,
|
||||
E6036BF01BF05EA773C76D22 /* Pods_Runner.framework */,
|
||||
9206484E84CB0AD93E3E68CA /* Pods_RunnerTests.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F0D4A0626F78BE1EF2A1E0D6 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
41EE721BF40B8DE895352A2C /* Pods-Runner.debug.xcconfig */,
|
||||
0FA914E59929120BA65E8403 /* Pods-Runner.release.xcconfig */,
|
||||
ACB8E553D75AA4AC9A7656CE /* Pods-Runner.profile.xcconfig */,
|
||||
BF5E76865ACB46314AC27D8F /* Pods-RunnerTests.debug.xcconfig */,
|
||||
174539D042E7AC2AB25A83EB /* Pods-RunnerTests.release.xcconfig */,
|
||||
27CB73AACA5743180CC6CD50 /* Pods-RunnerTests.profile.xcconfig */,
|
||||
);
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
331C80D4294CF70F00263BE5 /* RunnerTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
|
||||
buildPhases = (
|
||||
FF8CC09C83E12FC1C6EE6A8F /* [CP] Check Pods Manifest.lock */,
|
||||
331C80D1294CF70F00263BE5 /* Sources */,
|
||||
331C80D2294CF70F00263BE5 /* Frameworks */,
|
||||
331C80D3294CF70F00263BE5 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
331C80DA294CF71000263BE5 /* PBXTargetDependency */,
|
||||
);
|
||||
name = RunnerTests;
|
||||
productName = RunnerTests;
|
||||
productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
33CC10EC2044A3C60003C045 /* Runner */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||
buildPhases = (
|
||||
DF80A3E256A63BF2D2008937 /* [CP] Check Pods Manifest.lock */,
|
||||
AAFD86C9DC38B4393BC9D8E0 /* [CP] Check Pods Manifest.lock */,
|
||||
33CC10E92044A3C60003C045 /* Sources */,
|
||||
33CC10EA2044A3C60003C045 /* Frameworks */,
|
||||
33CC10EB2044A3C60003C045 /* Resources */,
|
||||
33CC110E2044A8840003C045 /* Bundle Framework */,
|
||||
3399D490228B24CF009A79C7 /* ShellScript */,
|
||||
8D7CC24E5AE846869656D4D1 /* [CP] Embed Pods Frameworks */,
|
||||
529691D83C3BADE14E2EAC03 /* [CP] Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
|
@ -206,6 +271,10 @@
|
|||
LastUpgradeCheck = 1300;
|
||||
ORGANIZATIONNAME = "";
|
||||
TargetAttributes = {
|
||||
331C80D4294CF70F00263BE5 = {
|
||||
CreatedOnToolsVersion = 14.0;
|
||||
TestTargetID = 33CC10EC2044A3C60003C045;
|
||||
};
|
||||
33CC10EC2044A3C60003C045 = {
|
||||
CreatedOnToolsVersion = 9.2;
|
||||
LastSwiftMigration = 1100;
|
||||
|
@ -236,12 +305,20 @@
|
|||
projectRoot = "";
|
||||
targets = (
|
||||
33CC10EC2044A3C60003C045 /* Runner */,
|
||||
331C80D4294CF70F00263BE5 /* RunnerTests */,
|
||||
33CC111A2044C6BA0003C045 /* Flutter Assemble */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
331C80D3294CF70F00263BE5 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
33CC10EB2044A3C60003C045 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
|
@ -256,6 +333,7 @@
|
|||
/* Begin PBXShellScriptBuildPhase section */
|
||||
3399D490228B24CF009A79C7 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
alwaysOutOfDate = 1;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
|
@ -291,7 +369,7 @@
|
|||
shellPath = /bin/sh;
|
||||
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
|
||||
};
|
||||
8D7CC24E5AE846869656D4D1 /* [CP] Embed Pods Frameworks */ = {
|
||||
529691D83C3BADE14E2EAC03 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
|
@ -308,7 +386,7 @@
|
|||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
DF80A3E256A63BF2D2008937 /* [CP] Check Pods Manifest.lock */ = {
|
||||
AAFD86C9DC38B4393BC9D8E0 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
|
@ -330,9 +408,39 @@
|
|||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
FF8CC09C83E12FC1C6EE6A8F /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
331C80D1294CF70F00263BE5 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
33CC10E92044A3C60003C045 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
|
@ -346,6 +454,11 @@
|
|||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
331C80DA294CF71000263BE5 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 33CC10EC2044A3C60003C045 /* Runner */;
|
||||
targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */;
|
||||
};
|
||||
33CC11202044C79F0003C045 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */;
|
||||
|
@ -366,6 +479,51 @@
|
|||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
331C80DB294CF71000263BE5 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = BF5E76865ACB46314AC27D8F /* Pods-RunnerTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackWallet.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Stack Wallet.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/stack_wallet";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
331C80DC294CF71000263BE5 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 174539D042E7AC2AB25A83EB /* Pods-RunnerTests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackWallet.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Stack Wallet.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/stack_wallet";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
331C80DD294CF71000263BE5 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 27CB73AACA5743180CC6CD50 /* Pods-RunnerTests.profile.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackWallet.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Stack Wallet.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/stack_wallet";
|
||||
};
|
||||
name = Profile;
|
||||
};
|
||||
338D0CE9231458BD00FA5F75 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
|
@ -404,9 +562,11 @@
|
|||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
};
|
||||
|
@ -421,6 +581,30 @@
|
|||
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/ReachabilitySwift\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/connectivity_plus\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/cw_monero\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/cw_shared_external\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/cw_wownero\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/desktop_drop\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/device_info_plus\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/devicelocale\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_libepiccash\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_local_notifications\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_secure_storage_macos\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/isar_flutter_libs\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/lelantus\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/package_info_plus\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/path_provider_foundation\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/share_plus\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/stack_wallet_backup\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/url_launcher_macos\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/wakelock_macos\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/window_size\"",
|
||||
"\"${PROJECT_DIR}/../crypto_plugins/flutter_liblelantus/scripts/macos/mobileliblelantus\"",
|
||||
);
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
|
@ -483,10 +667,11 @@
|
|||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
|
@ -530,9 +715,11 @@
|
|||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
};
|
||||
|
@ -547,6 +734,30 @@
|
|||
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/ReachabilitySwift\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/connectivity_plus\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/cw_monero\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/cw_shared_external\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/cw_wownero\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/desktop_drop\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/device_info_plus\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/devicelocale\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_libepiccash\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_local_notifications\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_secure_storage_macos\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/isar_flutter_libs\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/lelantus\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/package_info_plus\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/path_provider_foundation\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/share_plus\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/stack_wallet_backup\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/url_launcher_macos\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/wakelock_macos\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/window_size\"",
|
||||
"\"${PROJECT_DIR}/../crypto_plugins/flutter_liblelantus/scripts/macos/mobileliblelantus\"",
|
||||
);
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
|
@ -567,6 +778,30 @@
|
|||
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/ReachabilitySwift\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/connectivity_plus\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/cw_monero\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/cw_shared_external\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/cw_wownero\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/desktop_drop\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/device_info_plus\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/devicelocale\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_libepiccash\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_local_notifications\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/flutter_secure_storage_macos\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/isar_flutter_libs\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/lelantus\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/package_info_plus\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/path_provider_foundation\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/share_plus\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/stack_wallet_backup\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/url_launcher_macos\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/wakelock_macos\"",
|
||||
"\"${PODS_CONFIGURATION_BUILD_DIR}/window_size\"",
|
||||
"\"${PROJECT_DIR}/../crypto_plugins/flutter_liblelantus/scripts/macos/mobileliblelantus\"",
|
||||
);
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
|
@ -596,6 +831,16 @@
|
|||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
331C80DB294CF71000263BE5 /* Debug */,
|
||||
331C80DC294CF71000263BE5 /* Release */,
|
||||
331C80DD294CF71000263BE5 /* Profile */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
|
|
@ -37,6 +37,17 @@
|
|||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO"
|
||||
parallelizable = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "331C80D4294CF70F00263BE5"
|
||||
BuildableName = "RunnerTests.xctest"
|
||||
BlueprintName = "RunnerTests"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
|
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 926 B After Width: | Height: | Size: 577 B |
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.2 KiB |