refactor of money utils with new money2 package
This commit is contained in:
@@ -5,14 +5,16 @@ import 'package:flutter/foundation.dart';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
|
||||
import 'package:pshared/models/currency.dart';
|
||||
import 'package:pshared/models/describable.dart';
|
||||
import 'package:pshared/models/payment/chain_network.dart';
|
||||
import 'package:pshared/models/payment/wallet.dart';
|
||||
import 'package:pshared/models/wallet/chain_asset.dart';
|
||||
import 'package:pshared/provider/organizations.dart';
|
||||
import 'package:pshared/provider/resource.dart';
|
||||
import 'package:pshared/service/payment/wallets.dart';
|
||||
import 'package:pshared/utils/exception.dart';
|
||||
|
||||
|
||||
class WalletsProvider with ChangeNotifier {
|
||||
final WalletsService _service;
|
||||
OrganizationsProvider? _organizations;
|
||||
@@ -180,7 +182,8 @@ class WalletsProvider with ChangeNotifier {
|
||||
|
||||
Future<void> create({
|
||||
required Describable describable,
|
||||
required ChainAsset asset,
|
||||
required ChainNetwork chain,
|
||||
required CurrencyCode currency,
|
||||
required String? ownerRef,
|
||||
}) async {
|
||||
final org = _organizations;
|
||||
@@ -195,7 +198,8 @@ class WalletsProvider with ChangeNotifier {
|
||||
await _service.create(
|
||||
organizationRef: org.current.id,
|
||||
describable: describable,
|
||||
asset: asset,
|
||||
chain: chain,
|
||||
currency: currency,
|
||||
ownerRef: ownerRef,
|
||||
);
|
||||
await loadWalletsWithBalances();
|
||||
|
||||
Reference in New Issue
Block a user