Skip to content

Commit 9d77e36

Browse files
authored
hamed/update_dependency_injector_package (#249)
- update dependency injector package
1 parent 756411a commit 9d77e36

File tree

210 files changed

+212
-212
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

210 files changed

+212
-212
lines changed

README.md

Lines changed: 2 additions & 2 deletions

lib/api/api_initializer.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import 'package:deriv_dependency_injector/dependency_injector.dart';
55
class APIInitializer {
66
/// Initialize injector
77
Injector initialize({required BaseAPI api}) => Injector()
8-
..map<BaseAPI>(
8+
..register<BaseAPI>(
99
factoryFunction: (_) => api,
1010
isSingleton: true,
1111
);

lib/api/manually/ohlc_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class OHLC extends TickBase {
7777
/// Open time
7878
final DateTime? openTime;
7979

80-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
80+
static final BaseAPI _api = Injector()<BaseAPI>();
8181

8282
/// Unsubscribes all OHLC.
8383
///

lib/api/manually/tick.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Tick extends TickBase {
5656
/// Market value at the epoch
5757
final double? quote;
5858

59-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
59+
static final BaseAPI _api = Injector()<BaseAPI>();
6060

6161
/// Subscribes to a tick for given [TickRequest]
6262
///

lib/api/manually/tick_base.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class TickBase extends TickBaseModel {
6464
/// Subscription information
6565
final SubscriptionModel? subscriptionInformation;
6666

67-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
67+
static final BaseAPI _api = Injector()<BaseAPI>();
6868

6969
/// Unsubscribes from tick stream
7070
///

lib/api/manually/tick_history_subscription.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class TickHistorySubscription {
1919
/// The stream of the tick
2020
final Stream<TickBase?>? tickStream;
2121

22-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
22+
static final BaseAPI _api = Injector()<BaseAPI>();
2323

2424
/// Unsubscribes from tick history stream
2525
///

lib/api/response/active_symbols_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class ActiveSymbolsResponse extends ActiveSymbolsResponseModel {
5858
return resultMap;
5959
}
6060

61-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
61+
static final BaseAPI _api = Injector()<BaseAPI>();
6262

6363
/// Gets the list of active symbols.
6464
///

lib/api/response/api_token_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class ApiTokenResponse extends ApiTokenResponseModel {
4848
return resultMap;
4949
}
5050

51-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
51+
static final BaseAPI _api = Injector()<BaseAPI>();
5252

5353
/// Creates an API tokens
5454
///

lib/api/response/app_delete_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class AppDeleteResponse extends AppDeleteResponseModel {
4646
return resultMap;
4747
}
4848

49-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
49+
static final BaseAPI _api = Injector()<BaseAPI>();
5050

5151
/// Deletes the application by appId specified in [AppDeleteRequest.appDelete].
5252
///

lib/api/response/app_get_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class AppGetResponse extends AppGetResponseModel {
6161
return resultMap;
6262
}
6363

64-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
64+
static final BaseAPI _api = Injector()<BaseAPI>();
6565

6666
/// Gets the information of the OAuth application specified by [appId] in [request]
6767
///

lib/api/response/app_list_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class AppListResponse extends AppListResponseModel {
5959
return resultMap;
6060
}
6161

62-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
62+
static final BaseAPI _api = Injector()<BaseAPI>();
6363

6464
/// Gets all of the account's OAuth applications.
6565
///

lib/api/response/app_markup_details_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class AppMarkupDetailsResponse extends AppMarkupDetailsResponseModel {
5050
return resultMap;
5151
}
5252

53-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
53+
static final BaseAPI _api = Injector()<BaseAPI>();
5454

5555
/// Retrieve details of app markup according to criteria specified.
5656
///

lib/api/response/app_register_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class AppRegisterResponse extends AppRegisterResponseModel {
5151
return resultMap;
5252
}
5353

54-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
54+
static final BaseAPI _api = Injector()<BaseAPI>();
5555

5656
/// Registers a new OAuth application.
5757
///

lib/api/response/app_update_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class AppUpdateResponse extends AppUpdateResponseModel {
5050
return resultMap;
5151
}
5252

53-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
53+
static final BaseAPI _api = Injector()<BaseAPI>();
5454

5555
/// Updates the application specified in [request].
5656
///

lib/api/response/asset_index_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class AssetIndexResponse extends AssetIndexResponseModel {
5959
return resultMap;
6060
}
6161

62-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
62+
static final BaseAPI _api = Injector()<BaseAPI>();
6363

6464
/// Retrieves a list of all available underlyings and the corresponding contract types and duration boundaries.
6565
///

lib/api/response/authorize_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class AuthorizeResponse extends AuthorizeResponseModel {
5050
return resultMap;
5151
}
5252

53-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
53+
static final BaseAPI _api = Injector()<BaseAPI>();
5454

5555
/// Authorizes current WebSocket session to act on behalf of the owner of a given token.
5656
///

lib/api/response/balance_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class BalanceResponse extends BalanceResponseModel {
6969
return resultMap;
7070
}
7171

72-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
72+
static final BaseAPI _api = Injector()<BaseAPI>();
7373

7474
/// Gets the balance of account
7575
///

lib/api/response/buy_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class BuyResponse extends BuyResponseModel {
6969
return resultMap;
7070
}
7171

72-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
72+
static final BaseAPI _api = Injector()<BaseAPI>();
7373

7474
/// Buys a contract with parameters specified in given [BuyRequest]
7575
///

lib/api/response/cancel_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class CancelResponse extends CancelResponseModel {
4949
return resultMap;
5050
}
5151

52-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
52+
static final BaseAPI _api = Injector()<BaseAPI>();
5353

5454
/// Cancels a contract with parameters specified in [CancelRequest].
5555
///

lib/api/response/cashier_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class CashierResponse extends CashierResponseModel {
6262
return resultMap;
6363
}
6464

65-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
65+
static final BaseAPI _api = Injector()<BaseAPI>();
6666

6767
/// Gets the cashier URL for given [CashierRequest]
6868
static Future<CashierResponse> fetchInformation(

lib/api/response/contract_update_history_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class ContractUpdateHistoryResponse extends ContractUpdateHistoryResponseModel {
5959
return resultMap;
6060
}
6161

62-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
62+
static final BaseAPI _api = Injector()<BaseAPI>();
6363

6464
/// Gets update history for contract as List of [HistorySpotPriceModel]
6565
///

lib/api/response/contract_update_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class ContractUpdateResponse extends ContractUpdateResponseModel {
5151
return resultMap;
5252
}
5353

54-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
54+
static final BaseAPI _api = Injector()<BaseAPI>();
5555

5656
/// updates a contract with parameters specified in [ContractUpdateRequest].
5757
///

lib/api/response/contracts_for_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class ContractsForResponse extends ContractsForResponseModel {
5151
return resultMap;
5252
}
5353

54-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
54+
static final BaseAPI _api = Injector()<BaseAPI>();
5555

5656
/// Gets available contracts for given symbol in [ContractsForRequest]
5757
///

lib/api/response/copy_start_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class CopyStartResponse extends CopyStartResponseModel {
4747
return resultMap;
4848
}
4949

50-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
50+
static final BaseAPI _api = Injector()<BaseAPI>();
5151

5252
/// Starts copy trader bets.
5353
///

lib/api/response/copy_stop_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class CopyStopResponse extends CopyStopResponseModel {
4747
return resultMap;
4848
}
4949

50-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
50+
static final BaseAPI _api = Injector()<BaseAPI>();
5151

5252
/// Stops copy trader bets.
5353
///

lib/api/response/copytrading_list_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class CopytradingListResponse extends CopytradingListResponseModel {
5151
return resultMap;
5252
}
5353

54-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
54+
static final BaseAPI _api = Injector()<BaseAPI>();
5555

5656
/// Gets the list of active copiers and/or traders for Copy Trading
5757
///

lib/api/response/copytrading_statistics_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class CopytradingStatisticsResponse extends CopytradingStatisticsResponseModel {
5151
return resultMap;
5252
}
5353

54-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
54+
static final BaseAPI _api = Injector()<BaseAPI>();
5555

5656
/// Gets the copy trading statistics for given `traderId` in [request]
5757
///

lib/api/response/exchange_rates_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class ExchangeRatesResponse extends ExchangeRatesResponseModel {
6464
return resultMap;
6565
}
6666

67-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
67+
static final BaseAPI _api = Injector()<BaseAPI>();
6868

6969
/// Retrieves the exchange rates from a base currency to all currencies supported by the system.
7070
///

lib/api/response/forget_all_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class ForgetAllResponse extends ForgetAllResponseModel {
5959
return resultMap;
6060
}
6161

62-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
62+
static final BaseAPI _api = Injector()<BaseAPI>();
6363

6464
/// Immediately cancels the real-time streams of messages of given type.
6565
///

lib/api/response/forget_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ForgetResponse extends ForgetResponseModel {
4747
return resultMap;
4848
}
4949

50-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
50+
static final BaseAPI _api = Injector()<BaseAPI>();
5151

5252
/// Immediately cancels the real-time stream of messages with a specific id.
5353
///

lib/api/response/get_account_status_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class GetAccountStatusResponse extends GetAccountStatusResponseModel {
5151
return resultMap;
5252
}
5353

54-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
54+
static final BaseAPI _api = Injector()<BaseAPI>();
5555

5656
/// Gets the account's status.
5757
///

lib/api/response/get_financial_assessment_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class GetFinancialAssessmentResponse
5252
return resultMap;
5353
}
5454

55-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
55+
static final BaseAPI _api = Injector()<BaseAPI>();
5656

5757
/// Gets the financial assessment details.
5858
///

lib/api/response/get_limits_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class GetLimitsResponse extends GetLimitsResponseModel {
5050
return resultMap;
5151
}
5252

53-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
53+
static final BaseAPI _api = Injector()<BaseAPI>();
5454

5555
/// Gets the trading and withdrawal limits for logged in account
5656
///

lib/api/response/get_self_exclusion_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class GetSelfExclusionResponse extends GetSelfExclusionResponseModel {
5353
return resultMap;
5454
}
5555

56-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
56+
static final BaseAPI _api = Injector()<BaseAPI>();
5757

5858
/// Allows users to exclude themselves from the website for certain periods of time,
5959
/// or to set limits on their trading activities.

lib/api/response/get_settings_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class GetSettingsResponse extends GetSettingsResponseModel {
5454
return resultMap;
5555
}
5656

57-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
57+
static final BaseAPI _api = Injector()<BaseAPI>();
5858

5959
/// Gets user's settings (email, date of birth, address etc).
6060
///

lib/api/response/landing_company_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class LandingCompanyResponse extends LandingCompanyResponseModel {
5454
return resultMap;
5555
}
5656

57-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
57+
static final BaseAPI _api = Injector()<BaseAPI>();
5858

5959
/// Gets landing companies for given [LandingCompanyRequest]
6060
///

lib/api/response/login_history_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class LoginHistoryResponse extends LoginHistoryResponseModel {
5959
return resultMap;
6060
}
6161

62-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
62+
static final BaseAPI _api = Injector()<BaseAPI>();
6363

6464
/// Retrieves a summary of login history for user.
6565
///

lib/api/response/logout_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class LogoutResponse extends LogoutResponseModel {
4747
return resultMap;
4848
}
4949

50-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
50+
static final BaseAPI _api = Injector()<BaseAPI>();
5151

5252
/// Logs out from the web-socket's session.
5353
///

lib/api/response/mt5_deposit_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Mt5DepositResponse extends Mt5DepositResponseModel {
5656
return resultMap;
5757
}
5858

59-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
59+
static final BaseAPI _api = Injector()<BaseAPI>();
6060

6161
/// Allows deposit into MT5 account from binary account.
6262
///

lib/api/response/mt5_get_settings_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Mt5GetSettingsResponse extends Mt5GetSettingsResponseModel {
5151
return resultMap;
5252
}
5353

54-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
54+
static final BaseAPI _api = Injector()<BaseAPI>();
5555

5656
/// Gets MT5 user account settings.
5757
///

lib/api/response/mt5_login_list_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class Mt5LoginListResponse extends Mt5LoginListResponseModel {
5959
return resultMap;
6060
}
6161

62-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
62+
static final BaseAPI _api = Injector()<BaseAPI>();
6363

6464
/// Gets the list of MT5 accounts for client.
6565
///

lib/api/response/mt5_new_account_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Mt5NewAccountResponse extends Mt5NewAccountResponseModel {
6464
return resultMap;
6565
}
6666

67-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
67+
static final BaseAPI _api = Injector()<BaseAPI>();
6868

6969
/// Creates new MT5 user, either demo or real money user.
7070
///

lib/api/response/mt5_password_change_response_result.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Mt5PasswordChangeResponse extends Mt5PasswordChangeResponseModel {
4747
return resultMap;
4848
}
4949

50-
static final BaseAPI _api = Injector().get<BaseAPI>()!;
50+
static final BaseAPI _api = Injector()<BaseAPI>();
5151

5252
/// Changes the password of the MT5 account.
5353
///

0 commit comments

Comments
 (0)