Merge branch 'balanceMultiqueries' into dev
This commit is contained in:
commit
fe76beaaef
|
@ -93,7 +93,7 @@ class SubstrateSdk with ChangeNotifier {
|
||||||
try {
|
try {
|
||||||
return await sdk.webView!.evalJavascript('api.query.$call');
|
return await sdk.webView!.evalJavascript('api.query.$call');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log.i("catched _getStorage error");
|
log.e("_getStorage error: $e");
|
||||||
return Future(() {});
|
return Future(() {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,6 +200,16 @@ class SubstrateSdk with ChangeNotifier {
|
||||||
return balanceRatio;
|
return balanceRatio;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future getBalanceMulti(List addresses) async {
|
||||||
|
List stringifyAddresses = [];
|
||||||
|
for (var element in addresses) {
|
||||||
|
stringifyAddresses.add('"$element"');
|
||||||
|
}
|
||||||
|
final List balanceGlobal =
|
||||||
|
await _getStorage('system.account.multi($stringifyAddresses)');
|
||||||
|
log.d('debug multi: $balanceGlobal');
|
||||||
|
}
|
||||||
|
|
||||||
Future<Map<String, double>> getBalance(String address) async {
|
Future<Map<String, double>> getBalance(String address) async {
|
||||||
if (!nodeConnected) {
|
if (!nodeConnected) {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -118,6 +118,15 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||||
isTall = true;
|
isTall = true;
|
||||||
ratio = 1.125;
|
ratio = 1.125;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: finish to implement multiqueries
|
||||||
|
|
||||||
|
// final sub = Provider.of<SubstrateSdk>(context, listen: false);
|
||||||
|
// sub.getBalanceMulti([
|
||||||
|
// '5CQ8T4qpbYJq7uVsxGPQ5q2df7x3Wa4aRY6HUWMBYjfLZhnn',
|
||||||
|
// '5Dq8xjvkmbz7q4g2LbZgyExD26VSCutfEc6n4W4AfQeVHZqz'
|
||||||
|
// ]);
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
drawer: MainDrawer(isWalletsExists: isWalletsExists),
|
drawer: MainDrawer(isWalletsExists: isWalletsExists),
|
||||||
|
|
|
@ -145,6 +145,7 @@ void paymentPopup(BuildContext context, String toAddress, String username) {
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Consumer<SubstrateSdk>(builder: (context, sub, _) {
|
Consumer<SubstrateSdk>(builder: (context, sub, _) {
|
||||||
|
// TODO: about keyboard dismiss issue, should try this: https://stackoverflow.com/a/76352647/8301867
|
||||||
return DropdownButton(
|
return DropdownButton(
|
||||||
dropdownColor: const Color(0xffffeed1),
|
dropdownColor: const Color(0xffffeed1),
|
||||||
elevation: 12,
|
elevation: 12,
|
||||||
|
|
476
pubspec.lock
476
pubspec.lock
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue