WIP: Widget testing

This commit is contained in:
Likho 2022-10-07 10:34:30 +02:00
parent 5827b13fe3
commit efc5582fb2
6 changed files with 820 additions and 225 deletions

View file

@ -929,11 +929,11 @@ class RouteGenerator {
builder: (_) => const DesktopHomeView(),
settings: RouteSettings(name: settings.name));
case DesktopSettingsView.routeName:
return getRoute(
shouldUseMaterialRoute: useMaterialPageRoute,
builder: (_) => const DesktopSettingsView(),
settings: RouteSettings(name: settings.name));
// case DesktopSettingsView.routeName:
// return getRoute(
// shouldUseMaterialRoute: useMaterialPageRoute,
// builder: (_) => const DesktopSettingsView(),
// settings: RouteSettings(name: settings.name));
case MyStackView.routeName:
return getRoute(

View file

@ -2,18 +2,18 @@
// in stackwallet/test/services/coins/bitcoincash/bitcoincash_wallet_test.dart.
// Do not manually edit this file.
import 'dart:async' as _i7;
import 'dart:async' as _i6;
import 'package:decimal/decimal.dart' as _i4;
import 'package:http/http.dart' as _i3;
import 'package:decimal/decimal.dart' as _i2;
import 'package:http/http.dart' as _i4;
import 'package:mockito/mockito.dart' as _i1;
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i5;
import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i6;
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i7;
import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i5;
import 'package:stackwallet/services/price.dart' as _i9;
import 'package:stackwallet/services/transaction_notification_tracker.dart'
as _i11;
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i8;
import 'package:stackwallet/utilities/prefs.dart' as _i2;
import 'package:stackwallet/utilities/prefs.dart' as _i3;
import 'package:tuple/tuple.dart' as _i10;
// ignore_for_file: type=lint
@ -26,16 +26,208 @@ import 'package:tuple/tuple.dart' as _i10;
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types
class _FakePrefs_0 extends _i1.Fake implements _i2.Prefs {}
class _FakeDecimal_0 extends _i1.Fake implements _i2.Decimal {}
class _FakeClient_1 extends _i1.Fake implements _i3.Client {}
class _FakePrefs_1 extends _i1.Fake implements _i3.Prefs {}
class _FakeDecimal_2 extends _i1.Fake implements _i4.Decimal {}
class _FakeClient_2 extends _i1.Fake implements _i4.Client {}
/// A class which mocks [ElectrumX].
///
/// See the documentation for Mockito's code generation for more information.
class MockElectrumX extends _i1.Mock implements _i5.ElectrumX {
MockElectrumX() {
_i1.throwOnMissingStub(this);
}
@override
set failovers(List<_i5.ElectrumXNode>? _failovers) =>
super.noSuchMethod(Invocation.setter(#failovers, _failovers),
returnValueForMissingStub: null);
@override
int get currentFailoverIndex =>
(super.noSuchMethod(Invocation.getter(#currentFailoverIndex),
returnValue: 0) as int);
@override
set currentFailoverIndex(int? _currentFailoverIndex) => super.noSuchMethod(
Invocation.setter(#currentFailoverIndex, _currentFailoverIndex),
returnValueForMissingStub: null);
@override
String get host =>
(super.noSuchMethod(Invocation.getter(#host), returnValue: '') as String);
@override
int get port =>
(super.noSuchMethod(Invocation.getter(#port), returnValue: 0) as int);
@override
bool get useSSL =>
(super.noSuchMethod(Invocation.getter(#useSSL), returnValue: false)
as bool);
@override
_i6.Future<dynamic> request(
{String? command,
List<dynamic>? args = const [],
Duration? connectionTimeout = const Duration(seconds: 60),
String? requestID,
int? retries = 2}) =>
(super.noSuchMethod(
Invocation.method(#request, [], {
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#requestID: requestID,
#retries: retries
}),
returnValue: Future<dynamic>.value()) as _i6.Future<dynamic>);
@override
_i6.Future<List<Map<String, dynamic>>> batchRequest(
{String? command,
Map<String, List<dynamic>>? args,
Duration? connectionTimeout = const Duration(seconds: 60),
int? retries = 2}) =>
(super.noSuchMethod(
Invocation.method(#batchRequest, [], {
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#retries: retries
}),
returnValue: Future<List<Map<String, dynamic>>>.value(
<Map<String, dynamic>>[]))
as _i6.Future<List<Map<String, dynamic>>>);
@override
_i6.Future<bool> ping({String? requestID, int? retryCount = 1}) =>
(super.noSuchMethod(
Invocation.method(
#ping, [], {#requestID: requestID, #retryCount: retryCount}),
returnValue: Future<bool>.value(false)) as _i6.Future<bool>);
@override
_i6.Future<Map<String, dynamic>> getBlockHeadTip({String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#getBlockHeadTip, [], {#requestID: requestID}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i6.Future<Map<String, dynamic>>);
@override
_i6.Future<Map<String, dynamic>> getServerFeatures({String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#getServerFeatures, [], {#requestID: requestID}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{})) as _i6
.Future<Map<String, dynamic>>);
@override
_i6.Future<String> broadcastTransaction({String? rawTx, String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#broadcastTransaction, [],
{#rawTx: rawTx, #requestID: requestID}),
returnValue: Future<String>.value('')) as _i6.Future<String>);
@override
_i6.Future<Map<String, dynamic>> getBalance(
{String? scripthash, String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#getBalance, [],
{#scripthash: scripthash, #requestID: requestID}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i6.Future<Map<String, dynamic>>);
@override
_i6.Future<List<Map<String, dynamic>>> getHistory(
{String? scripthash, String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#getHistory, [],
{#scripthash: scripthash, #requestID: requestID}),
returnValue: Future<List<Map<String, dynamic>>>.value(
<Map<String, dynamic>>[]))
as _i6.Future<List<Map<String, dynamic>>>);
@override
_i6.Future<Map<String, List<Map<String, dynamic>>>> getBatchHistory(
{Map<String, List<dynamic>>? args}) =>
(super.noSuchMethod(
Invocation.method(#getBatchHistory, [], {#args: args}),
returnValue: Future<Map<String, List<Map<String, dynamic>>>>.value(
<String, List<Map<String, dynamic>>>{})) as _i6
.Future<Map<String, List<Map<String, dynamic>>>>);
@override
_i6.Future<List<Map<String, dynamic>>> getUTXOs(
{String? scripthash, String? requestID}) =>
(super.noSuchMethod(
Invocation.method(
#getUTXOs, [], {#scripthash: scripthash, #requestID: requestID}),
returnValue: Future<List<Map<String, dynamic>>>.value(
<Map<String, dynamic>>[])) as _i6
.Future<List<Map<String, dynamic>>>);
@override
_i6.Future<Map<String, List<Map<String, dynamic>>>> getBatchUTXOs(
{Map<String, List<dynamic>>? args}) =>
(super.noSuchMethod(Invocation.method(#getBatchUTXOs, [], {#args: args}),
returnValue: Future<Map<String, List<Map<String, dynamic>>>>.value(
<String, List<Map<String, dynamic>>>{})) as _i6
.Future<Map<String, List<Map<String, dynamic>>>>);
@override
_i6.Future<Map<String, dynamic>> getTransaction(
{String? txHash, bool? verbose = true, String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#getTransaction, [],
{#txHash: txHash, #verbose: verbose, #requestID: requestID}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i6.Future<Map<String, dynamic>>);
@override
_i6.Future<Map<String, dynamic>> getAnonymitySet(
{String? groupId = r'1',
String? blockhash = r'',
String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#getAnonymitySet, [], {
#groupId: groupId,
#blockhash: blockhash,
#requestID: requestID
}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i6.Future<Map<String, dynamic>>);
@override
_i6.Future<dynamic> getMintData({dynamic mints, String? requestID}) =>
(super.noSuchMethod(
Invocation.method(
#getMintData, [], {#mints: mints, #requestID: requestID}),
returnValue: Future<dynamic>.value()) as _i6.Future<dynamic>);
@override
_i6.Future<Map<String, dynamic>> getUsedCoinSerials(
{String? requestID, int? startNumber}) =>
(super.noSuchMethod(
Invocation.method(#getUsedCoinSerials, [],
{#requestID: requestID, #startNumber: startNumber}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i6.Future<Map<String, dynamic>>);
@override
_i6.Future<int> getLatestCoinId({String? requestID}) => (super.noSuchMethod(
Invocation.method(#getLatestCoinId, [], {#requestID: requestID}),
returnValue: Future<int>.value(0)) as _i6.Future<int>);
@override
_i6.Future<Map<String, dynamic>> getFeeRate({String? requestID}) => (super
.noSuchMethod(Invocation.method(#getFeeRate, [], {#requestID: requestID}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{})) as _i6
.Future<Map<String, dynamic>>);
@override
_i6.Future<_i2.Decimal> estimateFee({String? requestID, int? blocks}) =>
(super.noSuchMethod(
Invocation.method(
#estimateFee, [], {#requestID: requestID, #blocks: blocks}),
returnValue: Future<_i2.Decimal>.value(_FakeDecimal_0()))
as _i6.Future<_i2.Decimal>);
@override
_i6.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod(
Invocation.method(#relayFee, [], {#requestID: requestID}),
returnValue: Future<_i2.Decimal>.value(_FakeDecimal_0()))
as _i6.Future<_i2.Decimal>);
}
/// A class which mocks [CachedElectrumX].
///
/// See the documentation for Mockito's code generation for more information.
class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX {
class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX {
MockCachedElectrumX() {
_i1.throwOnMissingStub(this);
}
@ -52,44 +244,44 @@ class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX {
(super.noSuchMethod(Invocation.getter(#useSSL), returnValue: false)
as bool);
@override
_i2.Prefs get prefs => (super.noSuchMethod(Invocation.getter(#prefs),
returnValue: _FakePrefs_0()) as _i2.Prefs);
_i3.Prefs get prefs => (super.noSuchMethod(Invocation.getter(#prefs),
returnValue: _FakePrefs_1()) as _i3.Prefs);
@override
List<_i6.ElectrumXNode> get failovers =>
List<_i5.ElectrumXNode> get failovers =>
(super.noSuchMethod(Invocation.getter(#failovers),
returnValue: <_i6.ElectrumXNode>[]) as List<_i6.ElectrumXNode>);
returnValue: <_i5.ElectrumXNode>[]) as List<_i5.ElectrumXNode>);
@override
_i7.Future<Map<String, dynamic>> getAnonymitySet(
_i6.Future<Map<String, dynamic>> getAnonymitySet(
{String? groupId, String? blockhash = r'', _i8.Coin? coin}) =>
(super.noSuchMethod(
Invocation.method(#getAnonymitySet, [],
{#groupId: groupId, #blockhash: blockhash, #coin: coin}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i7.Future<Map<String, dynamic>>);
as _i6.Future<Map<String, dynamic>>);
@override
_i7.Future<Map<String, dynamic>> getTransaction(
_i6.Future<Map<String, dynamic>> getTransaction(
{String? txHash, _i8.Coin? coin, bool? verbose = true}) =>
(super.noSuchMethod(
Invocation.method(#getTransaction, [],
{#txHash: txHash, #coin: coin, #verbose: verbose}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i7.Future<Map<String, dynamic>>);
as _i6.Future<Map<String, dynamic>>);
@override
_i7.Future<List<dynamic>> getUsedCoinSerials(
_i6.Future<List<dynamic>> getUsedCoinSerials(
{_i8.Coin? coin, int? startNumber = 0}) =>
(super.noSuchMethod(
Invocation.method(#getUsedCoinSerials, [],
{#coin: coin, #startNumber: startNumber}),
returnValue: Future<List<dynamic>>.value(<dynamic>[]))
as _i7.Future<List<dynamic>>);
as _i6.Future<List<dynamic>>);
@override
_i7.Future<void> clearSharedTransactionCache({_i8.Coin? coin}) =>
_i6.Future<void> clearSharedTransactionCache({_i8.Coin? coin}) =>
(super.noSuchMethod(
Invocation.method(#clearSharedTransactionCache, [], {#coin: coin}),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i7.Future<void>);
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
}
/// A class which mocks [PriceAPI].
@ -101,21 +293,21 @@ class MockPriceAPI extends _i1.Mock implements _i9.PriceAPI {
}
@override
_i3.Client get client => (super.noSuchMethod(Invocation.getter(#client),
returnValue: _FakeClient_1()) as _i3.Client);
_i4.Client get client => (super.noSuchMethod(Invocation.getter(#client),
returnValue: _FakeClient_2()) as _i4.Client);
@override
void resetLastCalledToForceNextCallToUpdateCache() => super.noSuchMethod(
Invocation.method(#resetLastCalledToForceNextCallToUpdateCache, []),
returnValueForMissingStub: null);
@override
_i7.Future<Map<_i8.Coin, _i10.Tuple2<_i4.Decimal, double>>>
_i6.Future<Map<_i8.Coin, _i10.Tuple2<_i2.Decimal, double>>>
getPricesAnd24hChange({String? baseCurrency}) => (super.noSuchMethod(
Invocation.method(
#getPricesAnd24hChange, [], {#baseCurrency: baseCurrency}),
returnValue:
Future<Map<_i8.Coin, _i10.Tuple2<_i4.Decimal, double>>>.value(
<_i8.Coin, _i10.Tuple2<_i4.Decimal, double>>{}))
as _i7.Future<Map<_i8.Coin, _i10.Tuple2<_i4.Decimal, double>>>);
Future<Map<_i8.Coin, _i10.Tuple2<_i2.Decimal, double>>>.value(
<_i8.Coin, _i10.Tuple2<_i2.Decimal, double>>{}))
as _i6.Future<Map<_i8.Coin, _i10.Tuple2<_i2.Decimal, double>>>);
}
/// A class which mocks [TransactionNotificationTracker].
@ -144,205 +336,17 @@ class MockTransactionNotificationTracker extends _i1.Mock
(super.noSuchMethod(Invocation.method(#wasNotifiedPending, [txid]),
returnValue: false) as bool);
@override
_i7.Future<void> addNotifiedPending(String? txid) =>
_i6.Future<void> addNotifiedPending(String? txid) =>
(super.noSuchMethod(Invocation.method(#addNotifiedPending, [txid]),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i7.Future<void>);
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
@override
bool wasNotifiedConfirmed(String? txid) =>
(super.noSuchMethod(Invocation.method(#wasNotifiedConfirmed, [txid]),
returnValue: false) as bool);
@override
_i7.Future<void> addNotifiedConfirmed(String? txid) =>
_i6.Future<void> addNotifiedConfirmed(String? txid) =>
(super.noSuchMethod(Invocation.method(#addNotifiedConfirmed, [txid]),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i7.Future<void>);
}
/// A class which mocks [ElectrumX].
///
/// See the documentation for Mockito's code generation for more information.
class MockElectrumX extends _i1.Mock implements _i6.ElectrumX {
@override
set failovers(List<_i6.ElectrumXNode>? _failovers) =>
super.noSuchMethod(Invocation.setter(#failovers, _failovers),
returnValueForMissingStub: null);
@override
int get currentFailoverIndex =>
(super.noSuchMethod(Invocation.getter(#currentFailoverIndex),
returnValue: 0) as int);
@override
set currentFailoverIndex(int? _currentFailoverIndex) => super.noSuchMethod(
Invocation.setter(#currentFailoverIndex, _currentFailoverIndex),
returnValueForMissingStub: null);
@override
String get host =>
(super.noSuchMethod(Invocation.getter(#host), returnValue: '') as String);
@override
int get port =>
(super.noSuchMethod(Invocation.getter(#port), returnValue: 0) as int);
@override
bool get useSSL =>
(super.noSuchMethod(Invocation.getter(#useSSL), returnValue: false)
as bool);
@override
_i7.Future<dynamic> request(
{String? command,
List<dynamic>? args = const [],
Duration? connectionTimeout = const Duration(seconds: 60),
String? requestID,
int? retries = 2}) =>
(super.noSuchMethod(
Invocation.method(#request, [], {
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#requestID: requestID,
#retries: retries
}),
returnValue: Future<dynamic>.value()) as _i7.Future<dynamic>);
@override
_i7.Future<List<Map<String, dynamic>>> batchRequest(
{String? command,
Map<String, List<dynamic>>? args,
Duration? connectionTimeout = const Duration(seconds: 60),
int? retries = 2}) =>
(super.noSuchMethod(
Invocation.method(#batchRequest, [], {
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#retries: retries
}),
returnValue: Future<List<Map<String, dynamic>>>.value(
<Map<String, dynamic>>[]))
as _i7.Future<List<Map<String, dynamic>>>);
@override
_i7.Future<bool> ping({String? requestID, int? retryCount = 1}) =>
(super.noSuchMethod(
Invocation.method(
#ping, [], {#requestID: requestID, #retryCount: retryCount}),
returnValue: Future<bool>.value(false)) as _i7.Future<bool>);
@override
_i7.Future<Map<String, dynamic>> getBlockHeadTip({String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#getBlockHeadTip, [], {#requestID: requestID}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i7.Future<Map<String, dynamic>>);
@override
_i7.Future<Map<String, dynamic>> getServerFeatures({String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#getServerFeatures, [], {#requestID: requestID}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{})) as _i7
.Future<Map<String, dynamic>>);
@override
_i7.Future<String> broadcastTransaction({String? rawTx, String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#broadcastTransaction, [],
{#rawTx: rawTx, #requestID: requestID}),
returnValue: Future<String>.value('')) as _i7.Future<String>);
@override
_i7.Future<Map<String, dynamic>> getBalance(
{String? scripthash, String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#getBalance, [],
{#scripthash: scripthash, #requestID: requestID}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i7.Future<Map<String, dynamic>>);
@override
_i7.Future<List<Map<String, dynamic>>> getHistory(
{String? scripthash, String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#getHistory, [],
{#scripthash: scripthash, #requestID: requestID}),
returnValue: Future<List<Map<String, dynamic>>>.value(
<Map<String, dynamic>>[]))
as _i7.Future<List<Map<String, dynamic>>>);
@override
_i7.Future<Map<String, List<Map<String, dynamic>>>> getBatchHistory(
{Map<String, List<dynamic>>? args}) =>
(super.noSuchMethod(
Invocation.method(#getBatchHistory, [], {#args: args}),
returnValue: Future<Map<String, List<Map<String, dynamic>>>>.value(
<String, List<Map<String, dynamic>>>{})) as _i7
.Future<Map<String, List<Map<String, dynamic>>>>);
@override
_i7.Future<List<Map<String, dynamic>>> getUTXOs(
{String? scripthash, String? requestID}) =>
(super.noSuchMethod(
Invocation.method(
#getUTXOs, [], {#scripthash: scripthash, #requestID: requestID}),
returnValue: Future<List<Map<String, dynamic>>>.value(
<Map<String, dynamic>>[])) as _i7
.Future<List<Map<String, dynamic>>>);
@override
_i7.Future<Map<String, List<Map<String, dynamic>>>> getBatchUTXOs(
{Map<String, List<dynamic>>? args}) =>
(super.noSuchMethod(Invocation.method(#getBatchUTXOs, [], {#args: args}),
returnValue: Future<Map<String, List<Map<String, dynamic>>>>.value(
<String, List<Map<String, dynamic>>>{})) as _i7
.Future<Map<String, List<Map<String, dynamic>>>>);
@override
_i7.Future<Map<String, dynamic>> getTransaction(
{String? txHash, bool? verbose = true, String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#getTransaction, [],
{#txHash: txHash, #verbose: verbose, #requestID: requestID}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i7.Future<Map<String, dynamic>>);
@override
_i7.Future<Map<String, dynamic>> getAnonymitySet(
{String? groupId = r'1',
String? blockhash = r'',
String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#getAnonymitySet, [], {
#groupId: groupId,
#blockhash: blockhash,
#requestID: requestID
}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i7.Future<Map<String, dynamic>>);
@override
_i7.Future<dynamic> getMintData({dynamic mints, String? requestID}) =>
(super.noSuchMethod(
Invocation.method(
#getMintData, [], {#mints: mints, #requestID: requestID}),
returnValue: Future<dynamic>.value()) as _i7.Future<dynamic>);
@override
_i7.Future<Map<String, dynamic>> getUsedCoinSerials(
{String? requestID, int? startNumber}) =>
(super.noSuchMethod(
Invocation.method(#getUsedCoinSerials, [],
{#requestID: requestID, #startNumber: startNumber}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i7.Future<Map<String, dynamic>>);
@override
_i7.Future<int> getLatestCoinId({String? requestID}) => (super.noSuchMethod(
Invocation.method(#getLatestCoinId, [], {#requestID: requestID}),
returnValue: Future<int>.value(0)) as _i7.Future<int>);
@override
_i7.Future<Map<String, dynamic>> getFeeRate({String? requestID}) => (super
.noSuchMethod(Invocation.method(#getFeeRate, [], {#requestID: requestID}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{})) as _i7
.Future<Map<String, dynamic>>);
@override
_i7.Future<_i4.Decimal> estimateFee({String? requestID, int? blocks}) =>
(super.noSuchMethod(
Invocation.method(
#estimateFee, [], {#requestID: requestID, #blocks: blocks}),
returnValue: Future<_i4.Decimal>.value(_FakeDecimal_2()))
as _i7.Future<_i4.Decimal>);
@override
_i7.Future<_i4.Decimal> relayFee({String? requestID}) => (super.noSuchMethod(
Invocation.method(#relayFee, [], {#requestID: requestID}),
returnValue: Future<_i4.Decimal>.value(_FakeDecimal_2()))
as _i7.Future<_i4.Decimal>);
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
}

View file

@ -0,0 +1,54 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart';
import 'package:stackwallet/models/contact.dart';
import 'package:stackwallet/models/contact_address_entry.dart';
import 'package:stackwallet/providers/global/address_book_service_provider.dart';
import 'package:stackwallet/services/address_book_service.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/theme/light_colors.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/address_book_card.dart';
import 'address_book_card_test.mocks.dart';
@GenerateMocks([AddressBookService])
void main() {
testWidgets('test returns Contact Address Entry', (widgetTester) async {
final service = MockAddressBookService();
when(service.getContactById("some id"))
.thenAnswer((realInvocation) => Contact(
name: "John Doe",
addresses: [
const ContactAddressEntry(
coin: Coin.bitcoincash,
address: "some bch address",
label: "Bills")
],
isFavorite: true));
await widgetTester.pumpWidget(
ProviderScope(
overrides: [
addressBookServiceProvider.overrideWithValue(
service,
),
],
child: MaterialApp(
theme: ThemeData(
extensions: [
StackColors.fromStackColorTheme(
LightColors(),
),
],
),
home: const AddressBookCard(
contactId: "some id",
),
),
),
);
});
}

View file

@ -0,0 +1,87 @@
// Mocks generated by Mockito 5.2.0 from annotations
// in stackwallet/test/widget_tests/address_book_card_test.dart.
// Do not manually edit this file.
import 'dart:async' as _i4;
import 'dart:ui' as _i5;
import 'package:mockito/mockito.dart' as _i1;
import 'package:stackwallet/models/contact.dart' as _i2;
import 'package:stackwallet/services/address_book_service.dart' as _i3;
// ignore_for_file: type=lint
// ignore_for_file: avoid_redundant_argument_values
// ignore_for_file: avoid_setters_without_getters
// ignore_for_file: comment_references
// ignore_for_file: implementation_imports
// ignore_for_file: invalid_use_of_visible_for_testing_member
// ignore_for_file: prefer_const_constructors
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types
class _FakeContact_0 extends _i1.Fake implements _i2.Contact {}
/// A class which mocks [AddressBookService].
///
/// See the documentation for Mockito's code generation for more information.
class MockAddressBookService extends _i1.Mock
implements _i3.AddressBookService {
MockAddressBookService() {
_i1.throwOnMissingStub(this);
}
@override
List<_i2.Contact> get contacts =>
(super.noSuchMethod(Invocation.getter(#contacts),
returnValue: <_i2.Contact>[]) as List<_i2.Contact>);
@override
_i4.Future<List<_i2.Contact>> get addressBookEntries =>
(super.noSuchMethod(Invocation.getter(#addressBookEntries),
returnValue: Future<List<_i2.Contact>>.value(<_i2.Contact>[]))
as _i4.Future<List<_i2.Contact>>);
@override
bool get hasListeners =>
(super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false)
as bool);
@override
_i2.Contact getContactById(String? id) =>
(super.noSuchMethod(Invocation.method(#getContactById, [id]),
returnValue: _FakeContact_0()) as _i2.Contact);
@override
_i4.Future<List<_i2.Contact>> search(String? text) =>
(super.noSuchMethod(Invocation.method(#search, [text]),
returnValue: Future<List<_i2.Contact>>.value(<_i2.Contact>[]))
as _i4.Future<List<_i2.Contact>>);
@override
bool matches(String? term, _i2.Contact? contact) =>
(super.noSuchMethod(Invocation.method(#matches, [term, contact]),
returnValue: false) as bool);
@override
_i4.Future<bool> addContact(_i2.Contact? contact) =>
(super.noSuchMethod(Invocation.method(#addContact, [contact]),
returnValue: Future<bool>.value(false)) as _i4.Future<bool>);
@override
_i4.Future<bool> editContact(_i2.Contact? editedContact) =>
(super.noSuchMethod(Invocation.method(#editContact, [editedContact]),
returnValue: Future<bool>.value(false)) as _i4.Future<bool>);
@override
_i4.Future<void> removeContact(String? id) =>
(super.noSuchMethod(Invocation.method(#removeContact, [id]),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i4.Future<void>);
@override
void addListener(_i5.VoidCallback? listener) =>
super.noSuchMethod(Invocation.method(#addListener, [listener]),
returnValueForMissingStub: null);
@override
void removeListener(_i5.VoidCallback? listener) =>
super.noSuchMethod(Invocation.method(#removeListener, [listener]),
returnValueForMissingStub: null);
@override
void dispose() => super.noSuchMethod(Invocation.method(#dispose, []),
returnValueForMissingStub: null);
@override
void notifyListeners() =>
super.noSuchMethod(Invocation.method(#notifyListeners, []),
returnValueForMissingStub: null);
}

View file

@ -0,0 +1,57 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/services/coins/manager.dart';
import 'package:stackwallet/services/wallets.dart';
import 'package:stackwallet/services/wallets_service.dart';
import 'package:stackwallet/widgets/wallet_info_row/sub_widgets/wallet_info_row_balance_future.dart';
import 'package:stackwallet/widgets/wallet_info_row/wallet_info_row.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/theme/light_colors.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
// import '../screen_tests/lockscreen_view_screen_test.mocks.dart';
import 'wallet_info_row_test.mocks.dart';
@GenerateMocks([WalletsService],
customMocks: [MockSpec<Manager>(returnNullOnMissingStub: true)])
void main() {
testWidgets("returns wallet info for given wallet id", (widgetTester) async {
final service = MockWalletsService();
// final mockManager = MockManager();
// String? walletId = await service.addNewWallet(
// name: "Test", coin: Coin.bitcoin, shouldNotifyListeners: false);
// final managerProvider = ChangeNotifierProvider<Manager>((ref) => {
// return service.get;
// });
when(service.addNewWallet(
name: "Test", coin: Coin.bitcoin, shouldNotifyListeners: false))
.thenAnswer((_) => Future(() => "some wallet id"));
// when(service.getWalletId(walletName))
await widgetTester.pumpWidget(
ProviderScope(
overrides: [
walletsServiceChangeNotifierProvider.overrideWithValue(service),
],
child: MaterialApp(
theme: ThemeData(
extensions: [
StackColors.fromStackColorTheme(
LightColors(),
),
],
),
home: const WalletInfoRowBalanceFuture(
walletId: "some wallet id",
),
),
),
);
});
}

View file

@ -0,0 +1,393 @@
// Mocks generated by Mockito 5.2.0 from annotations
// in stackwallet/test/widget_tests/wallet_info_row_test.dart.
// Do not manually edit this file.
import 'dart:async' as _i6;
import 'dart:ui' as _i8;
import 'package:decimal/decimal.dart' as _i4;
import 'package:mockito/mockito.dart' as _i1;
import 'package:stackwallet/models/models.dart' as _i3;
import 'package:stackwallet/services/coins/coin_service.dart' as _i2;
import 'package:stackwallet/services/coins/manager.dart' as _i9;
import 'package:stackwallet/services/wallets_service.dart' as _i5;
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i7;
// ignore_for_file: type=lint
// ignore_for_file: avoid_redundant_argument_values
// ignore_for_file: avoid_setters_without_getters
// ignore_for_file: comment_references
// ignore_for_file: implementation_imports
// ignore_for_file: invalid_use_of_visible_for_testing_member
// ignore_for_file: prefer_const_constructors
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types
class _FakeCoinServiceAPI_0 extends _i1.Fake implements _i2.CoinServiceAPI {}
class _FakeFeeObject_1 extends _i1.Fake implements _i3.FeeObject {}
class _FakeDecimal_2 extends _i1.Fake implements _i4.Decimal {}
class _FakeTransactionData_3 extends _i1.Fake implements _i3.TransactionData {}
/// A class which mocks [WalletsService].
///
/// See the documentation for Mockito's code generation for more information.
class MockWalletsService extends _i1.Mock implements _i5.WalletsService {
MockWalletsService() {
_i1.throwOnMissingStub(this);
}
@override
_i6.Future<Map<String, _i5.WalletInfo>> get walletNames =>
(super.noSuchMethod(Invocation.getter(#walletNames),
returnValue: Future<Map<String, _i5.WalletInfo>>.value(
<String, _i5.WalletInfo>{}))
as _i6.Future<Map<String, _i5.WalletInfo>>);
@override
bool get hasListeners =>
(super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false)
as bool);
@override
_i6.Future<bool> renameWallet(
{String? from, String? to, bool? shouldNotifyListeners}) =>
(super.noSuchMethod(
Invocation.method(#renameWallet, [], {
#from: from,
#to: to,
#shouldNotifyListeners: shouldNotifyListeners
}),
returnValue: Future<bool>.value(false)) as _i6.Future<bool>);
@override
_i6.Future<void> addExistingStackWallet(
{String? name,
String? walletId,
_i7.Coin? coin,
bool? shouldNotifyListeners}) =>
(super.noSuchMethod(
Invocation.method(#addExistingStackWallet, [], {
#name: name,
#walletId: walletId,
#coin: coin,
#shouldNotifyListeners: shouldNotifyListeners
}),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
@override
_i6.Future<String?> addNewWallet(
{String? name, _i7.Coin? coin, bool? shouldNotifyListeners}) =>
(super.noSuchMethod(
Invocation.method(#addNewWallet, [], {
#name: name,
#coin: coin,
#shouldNotifyListeners: shouldNotifyListeners
}),
returnValue: Future<String?>.value()) as _i6.Future<String?>);
@override
_i6.Future<List<String>> getFavoriteWalletIds() =>
(super.noSuchMethod(Invocation.method(#getFavoriteWalletIds, []),
returnValue: Future<List<String>>.value(<String>[]))
as _i6.Future<List<String>>);
@override
_i6.Future<void> saveFavoriteWalletIds(List<String>? walletIds) => (super
.noSuchMethod(Invocation.method(#saveFavoriteWalletIds, [walletIds]),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
@override
_i6.Future<void> addFavorite(String? walletId) =>
(super.noSuchMethod(Invocation.method(#addFavorite, [walletId]),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
@override
_i6.Future<void> removeFavorite(String? walletId) =>
(super.noSuchMethod(Invocation.method(#removeFavorite, [walletId]),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
@override
_i6.Future<void> moveFavorite({int? fromIndex, int? toIndex}) =>
(super.noSuchMethod(
Invocation.method(
#moveFavorite, [], {#fromIndex: fromIndex, #toIndex: toIndex}),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
@override
_i6.Future<bool> checkForDuplicate(String? name) =>
(super.noSuchMethod(Invocation.method(#checkForDuplicate, [name]),
returnValue: Future<bool>.value(false)) as _i6.Future<bool>);
@override
_i6.Future<String?> getWalletId(String? walletName) =>
(super.noSuchMethod(Invocation.method(#getWalletId, [walletName]),
returnValue: Future<String?>.value()) as _i6.Future<String?>);
@override
_i6.Future<bool> isMnemonicVerified({String? walletId}) =>
(super.noSuchMethod(
Invocation.method(#isMnemonicVerified, [], {#walletId: walletId}),
returnValue: Future<bool>.value(false)) as _i6.Future<bool>);
@override
_i6.Future<void> setMnemonicVerified({String? walletId}) =>
(super.noSuchMethod(
Invocation.method(#setMnemonicVerified, [], {#walletId: walletId}),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
@override
_i6.Future<int> deleteWallet(String? name, bool? shouldNotifyListeners) =>
(super.noSuchMethod(
Invocation.method(#deleteWallet, [name, shouldNotifyListeners]),
returnValue: Future<int>.value(0)) as _i6.Future<int>);
@override
_i6.Future<void> refreshWallets(bool? shouldNotifyListeners) => (super
.noSuchMethod(Invocation.method(#refreshWallets, [shouldNotifyListeners]),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
@override
void addListener(_i8.VoidCallback? listener) =>
super.noSuchMethod(Invocation.method(#addListener, [listener]),
returnValueForMissingStub: null);
@override
void removeListener(_i8.VoidCallback? listener) =>
super.noSuchMethod(Invocation.method(#removeListener, [listener]),
returnValueForMissingStub: null);
@override
void dispose() => super.noSuchMethod(Invocation.method(#dispose, []),
returnValueForMissingStub: null);
@override
void notifyListeners() =>
super.noSuchMethod(Invocation.method(#notifyListeners, []),
returnValueForMissingStub: null);
}
/// A class which mocks [Manager].
///
/// See the documentation for Mockito's code generation for more information.
class MockManager extends _i1.Mock implements _i9.Manager {
@override
bool get isActiveWallet => (super
.noSuchMethod(Invocation.getter(#isActiveWallet), returnValue: false)
as bool);
@override
set isActiveWallet(bool? isActive) =>
super.noSuchMethod(Invocation.setter(#isActiveWallet, isActive),
returnValueForMissingStub: null);
@override
_i2.CoinServiceAPI get wallet =>
(super.noSuchMethod(Invocation.getter(#wallet),
returnValue: _FakeCoinServiceAPI_0()) as _i2.CoinServiceAPI);
@override
bool get hasBackgroundRefreshListener =>
(super.noSuchMethod(Invocation.getter(#hasBackgroundRefreshListener),
returnValue: false) as bool);
@override
_i7.Coin get coin => (super.noSuchMethod(Invocation.getter(#coin),
returnValue: _i7.Coin.bitcoin) as _i7.Coin);
@override
bool get isRefreshing =>
(super.noSuchMethod(Invocation.getter(#isRefreshing), returnValue: false)
as bool);
@override
bool get shouldAutoSync => (super
.noSuchMethod(Invocation.getter(#shouldAutoSync), returnValue: false)
as bool);
@override
set shouldAutoSync(bool? shouldAutoSync) =>
super.noSuchMethod(Invocation.setter(#shouldAutoSync, shouldAutoSync),
returnValueForMissingStub: null);
@override
bool get isFavorite =>
(super.noSuchMethod(Invocation.getter(#isFavorite), returnValue: false)
as bool);
@override
set isFavorite(bool? markFavorite) =>
super.noSuchMethod(Invocation.setter(#isFavorite, markFavorite),
returnValueForMissingStub: null);
@override
_i6.Future<_i3.FeeObject> get fees =>
(super.noSuchMethod(Invocation.getter(#fees),
returnValue: Future<_i3.FeeObject>.value(_FakeFeeObject_1()))
as _i6.Future<_i3.FeeObject>);
@override
_i6.Future<int> get maxFee => (super.noSuchMethod(Invocation.getter(#maxFee),
returnValue: Future<int>.value(0)) as _i6.Future<int>);
@override
_i6.Future<String> get currentReceivingAddress =>
(super.noSuchMethod(Invocation.getter(#currentReceivingAddress),
returnValue: Future<String>.value('')) as _i6.Future<String>);
@override
_i6.Future<_i4.Decimal> get availableBalance =>
(super.noSuchMethod(Invocation.getter(#availableBalance),
returnValue: Future<_i4.Decimal>.value(_FakeDecimal_2()))
as _i6.Future<_i4.Decimal>);
@override
_i4.Decimal get cachedAvailableBalance =>
(super.noSuchMethod(Invocation.getter(#cachedAvailableBalance),
returnValue: _FakeDecimal_2()) as _i4.Decimal);
@override
_i6.Future<_i4.Decimal> get pendingBalance =>
(super.noSuchMethod(Invocation.getter(#pendingBalance),
returnValue: Future<_i4.Decimal>.value(_FakeDecimal_2()))
as _i6.Future<_i4.Decimal>);
@override
_i6.Future<_i4.Decimal> get balanceMinusMaxFee =>
(super.noSuchMethod(Invocation.getter(#balanceMinusMaxFee),
returnValue: Future<_i4.Decimal>.value(_FakeDecimal_2()))
as _i6.Future<_i4.Decimal>);
@override
_i6.Future<_i4.Decimal> get totalBalance =>
(super.noSuchMethod(Invocation.getter(#totalBalance),
returnValue: Future<_i4.Decimal>.value(_FakeDecimal_2()))
as _i6.Future<_i4.Decimal>);
@override
_i4.Decimal get cachedTotalBalance =>
(super.noSuchMethod(Invocation.getter(#cachedTotalBalance),
returnValue: _FakeDecimal_2()) as _i4.Decimal);
@override
_i6.Future<List<String>> get allOwnAddresses =>
(super.noSuchMethod(Invocation.getter(#allOwnAddresses),
returnValue: Future<List<String>>.value(<String>[]))
as _i6.Future<List<String>>);
@override
_i6.Future<_i3.TransactionData> get transactionData =>
(super.noSuchMethod(Invocation.getter(#transactionData),
returnValue:
Future<_i3.TransactionData>.value(_FakeTransactionData_3()))
as _i6.Future<_i3.TransactionData>);
@override
_i6.Future<List<_i3.UtxoObject>> get unspentOutputs => (super.noSuchMethod(
Invocation.getter(#unspentOutputs),
returnValue: Future<List<_i3.UtxoObject>>.value(<_i3.UtxoObject>[]))
as _i6.Future<List<_i3.UtxoObject>>);
@override
set walletName(String? newName) =>
super.noSuchMethod(Invocation.setter(#walletName, newName),
returnValueForMissingStub: null);
@override
String get walletName =>
(super.noSuchMethod(Invocation.getter(#walletName), returnValue: '')
as String);
@override
String get walletId =>
(super.noSuchMethod(Invocation.getter(#walletId), returnValue: '')
as String);
@override
_i6.Future<List<String>> get mnemonic =>
(super.noSuchMethod(Invocation.getter(#mnemonic),
returnValue: Future<List<String>>.value(<String>[]))
as _i6.Future<List<String>>);
@override
bool get isConnected =>
(super.noSuchMethod(Invocation.getter(#isConnected), returnValue: false)
as bool);
@override
bool get hasListeners =>
(super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false)
as bool);
@override
_i6.Future<void> updateNode(bool? shouldRefresh) =>
(super.noSuchMethod(Invocation.method(#updateNode, [shouldRefresh]),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
@override
void dispose() => super.noSuchMethod(Invocation.method(#dispose, []),
returnValueForMissingStub: null);
@override
_i6.Future<Map<String, dynamic>> prepareSend(
{String? address, int? satoshiAmount, Map<String, dynamic>? args}) =>
(super.noSuchMethod(
Invocation.method(#prepareSend, [], {
#address: address,
#satoshiAmount: satoshiAmount,
#args: args
}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i6.Future<Map<String, dynamic>>);
@override
_i6.Future<String> confirmSend({Map<String, dynamic>? txData}) => (super
.noSuchMethod(Invocation.method(#confirmSend, [], {#txData: txData}),
returnValue: Future<String>.value('')) as _i6.Future<String>);
@override
_i6.Future<String> send(
{String? toAddress,
int? amount,
Map<String, String>? args = const {}}) =>
(super.noSuchMethod(
Invocation.method(
#send, [], {#toAddress: toAddress, #amount: amount, #args: args}),
returnValue: Future<String>.value('')) as _i6.Future<String>);
@override
_i6.Future<void> refresh() =>
(super.noSuchMethod(Invocation.method(#refresh, []),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
@override
bool validateAddress(String? address) =>
(super.noSuchMethod(Invocation.method(#validateAddress, [address]),
returnValue: false) as bool);
@override
_i6.Future<bool> testNetworkConnection() =>
(super.noSuchMethod(Invocation.method(#testNetworkConnection, []),
returnValue: Future<bool>.value(false)) as _i6.Future<bool>);
@override
_i6.Future<void> initializeNew() =>
(super.noSuchMethod(Invocation.method(#initializeNew, []),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
@override
_i6.Future<void> initializeExisting() =>
(super.noSuchMethod(Invocation.method(#initializeExisting, []),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
@override
_i6.Future<void> recoverFromMnemonic(
{String? mnemonic,
int? maxUnusedAddressGap,
int? maxNumberOfIndexesToCheck,
int? height}) =>
(super.noSuchMethod(
Invocation.method(#recoverFromMnemonic, [], {
#mnemonic: mnemonic,
#maxUnusedAddressGap: maxUnusedAddressGap,
#maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck,
#height: height
}),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
@override
_i6.Future<void> exitCurrentWallet() =>
(super.noSuchMethod(Invocation.method(#exitCurrentWallet, []),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
@override
_i6.Future<void> fullRescan(
int? maxUnusedAddressGap, int? maxNumberOfIndexesToCheck) =>
(super.noSuchMethod(
Invocation.method(
#fullRescan, [maxUnusedAddressGap, maxNumberOfIndexesToCheck]),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
@override
_i6.Future<bool> isOwnAddress(String? address) =>
(super.noSuchMethod(Invocation.method(#isOwnAddress, [address]),
returnValue: Future<bool>.value(false)) as _i6.Future<bool>);
@override
_i6.Future<int> estimateFeeFor(int? satoshiAmount, int? feeRate) =>
(super.noSuchMethod(
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
returnValue: Future<int>.value(0)) as _i6.Future<int>);
@override
_i6.Future<bool> generateNewAddress() =>
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
returnValue: Future<bool>.value(false)) as _i6.Future<bool>);
@override
void addListener(_i8.VoidCallback? listener) =>
super.noSuchMethod(Invocation.method(#addListener, [listener]),
returnValueForMissingStub: null);
@override
void removeListener(_i8.VoidCallback? listener) =>
super.noSuchMethod(Invocation.method(#removeListener, [listener]),
returnValueForMissingStub: null);
@override
void notifyListeners() =>
super.noSuchMethod(Invocation.method(#notifyListeners, []),
returnValueForMissingStub: null);
}