Skip to content

Commit

Permalink
refactor: Bringing the code in line with the linter's suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor-pelykh committed Feb 2, 2022
1 parent 8431882 commit fce9817
Show file tree
Hide file tree
Showing 53 changed files with 85 additions and 85 deletions.
2 changes: 1 addition & 1 deletion lib/coingecko_result.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CoinGeckoResult<T> {
this.isError = false,
this.errorMessage,
this.errorCode,
}) {}
});

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/asset_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class AssetPlatform {
: this.id = Convert.toNotNullableString(json['id'], ''),
this.chainIdentifier = Convert.toInt(json['chain_identifier']),
this.name = Convert.toNotNullableString(json['name'], ''),
this.shortName = Convert.toNotNullableString(json['shortName'], '') {}
this.shortName = Convert.toNotNullableString(json['shortName'], '');

@override
String toString() {
Expand Down
4 changes: 2 additions & 2 deletions lib/data/category.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class Category {
this.marketCapChange24h =
Convert.toDouble(json['market_cap_change_24h']) ?? 0,
this.volume24h = Convert.toDouble(json['volume_24h']) ?? 0,
this.updatedAt = Convert.toDateTime(json['updated_at']) ??
Helpers.defaultDateTime() {}
this.updatedAt =
Convert.toDateTime(json['updated_at']) ?? Helpers.defaultDateTime();

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/category_short.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CategoryShort {

CategoryShort.fromJson(Map<String, dynamic> json)
: this.id = Convert.toNotNullableString(json['category_id'], ''),
this.name = Convert.toNotNullableString(json['name'], '') {}
this.name = Convert.toNotNullableString(json['name'], '');

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/coin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class Coin {
: null,
this.statusUpdates = _parseStatusUpdates(json['status_updates']),
this.lastUpdated = Convert.toDateTime(json['last_updated']),
this.tickers = _parseTickers(json['tickers']) {}
this.tickers = _parseTickers(json['tickers']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/coin_community_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CoinCommunityData {
this.redditAccountsActive48h =
Convert.toDouble(json['reddit_accounts_active_48h']),
this.telegramChannelUserCount =
Convert.toInt(json['telegram_channel_user_count']) {}
Convert.toInt(json['telegram_channel_user_count']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/coin_developer_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class CoinDeveloperData {
: null,
this.commitCount4Weeks = Convert.toInt(json['commit_count_4_weeks']),
this.last4WeeksCommitActivitySeries =
Helpers.parseListInt(json['last_4_weeks_commit_activity_series']) {}
Helpers.parseListInt(json['last_4_weeks_commit_activity_series']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/coin_developer_data_code_changes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CoinDeveloperDataCodeChanges {

CoinDeveloperDataCodeChanges.fromJson(Map<String, dynamic> json)
: this.additions = Convert.toInt(json['additions']),
this.deletions = Convert.toInt(json['deletions']) {}
this.deletions = Convert.toInt(json['deletions']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/coin_history.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class CoinHistory {
: null,
this.publicInterestStats = json.containsKey('public_interest_stats')
? CoinPublicInterestsStats.fromJson(json['public_interest_stats'])
: null {}
: null;

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/coin_links.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class CoinLinks {
this.subredditUrl = Convert.toNullableString(json['subreddit_url']),
this.reposUrl = json.containsKey('repos_url')
? CoinReposUrl.fromJson(json['repos_url'])
: null {}
: null;

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/coin_market_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class CoinMarketData {
this.sparkline7d = json.containsKey('sparkline_7d')
? MarketSparkline.fromJson(json['sparkline_7d'])
: null,
this.lastUpdated = Convert.toDateTime(json['last_updated']) {}
this.lastUpdated = Convert.toDateTime(json['last_updated']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/coin_public_interests_stats.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CoinPublicInterestsStats {

CoinPublicInterestsStats.fromJson(Map<String, dynamic> json)
: this.alexaRank = Convert.toInt(json['alexa_rank']),
this.bingMatches = Convert.toInt(json['bing_matches']) {}
this.bingMatches = Convert.toInt(json['bing_matches']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/coin_repos_url.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CoinReposUrl {

CoinReposUrl.fromJson(Map<String, dynamic> json)
: this.github = Helpers.parseListString(json['homepage']),
this.bitbucket = Helpers.parseListString(json['bitbucket']) {}
this.bitbucket = Helpers.parseListString(json['bitbucket']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/coin_short.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CoinShort {
: this.id = Convert.toNotNullableString(json['id'], ''),
this.symbol = Convert.toNotNullableString(json['symbol'], ''),
this.name = Convert.toNotNullableString(json['name'], ''),
this.platforms = Helpers.parseMapStringString(json['platforms']) {}
this.platforms = Helpers.parseMapStringString(json['platforms']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/companies_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class CompaniesData {
this.totalValueUsd = Convert.toDouble(json['total_value_usd']) ?? 0,
this.marketCapDominance =
Convert.toDouble(json['market_cap_dominance']) ?? 0,
this.companies = _parseCompanies(json['companies']) {}
this.companies = _parseCompanies(json['companies']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/company.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Company {
this.totalCurrentValueUsd =
Convert.toDouble(json['total_current_value_usd']) ?? 0,
this.percentageOfTotalSupply =
Convert.toDouble(json['percentage_of_total_supply']) ?? 0 {}
Convert.toDouble(json['percentage_of_total_supply']) ?? 0;

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/country.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Country {

Country.fromJson(Map<String, dynamic> json)
: this.country = Convert.toNullableString(json['country']),
this.code = Convert.toNotNullableString(json['code'], '') {}
this.code = Convert.toNotNullableString(json['code'], '');

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/derivative.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Derivative {
this.volume24h = Convert.toDouble(json['volume_24h']) ?? 0,
this.lastTradedAt = Convert.toDateTime(json['last_traded_at']) ??
Helpers.defaultDateTime(),
this.expiredAt = Convert.toDateTime(json['expired_at']) {}
this.expiredAt = Convert.toDateTime(json['expired_at']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/derivative_exchange.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class DerivativeExchange {
this.yearEstablished = Convert.toInt(json['year_established']) ?? 0,
this.country = Convert.toNullableString(json['country']),
this.description = Convert.toNotNullableString(json['description'], ''),
this.url = Convert.toNotNullableString(json['url'], '') {}
this.url = Convert.toNotNullableString(json['url'], '');

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/derivative_exchange_extended.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class DerivativeExchangeExtended {
this.country = Convert.toNullableString(json['country']),
this.description = Convert.toNotNullableString(json['description'], ''),
this.url = Convert.toNotNullableString(json['url'], ''),
this.tickers = _parseTickers(json['tickers']) {}
this.tickers = _parseTickers(json['tickers']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/derivative_exchange_short.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class DerivativeExchangeShort {

DerivativeExchangeShort.fromJson(Map<String, dynamic> json)
: this.id = Convert.toNotNullableString(json['id'], ''),
this.name = Convert.toNotNullableString(json['name'], '') {}
this.name = Convert.toNotNullableString(json['name'], '');

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/derivative_ticker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class DerivativeTicker {
Helpers.parseMapStringDouble(json['converted_last']) ?? {},
this.lastTraded = Convert.toDateTime(json['last_traded']) ??
Helpers.defaultDateTime(),
this.expiredAt = Convert.toDateTime(json['expired_at']) {}
this.expiredAt = Convert.toDateTime(json['expired_at']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Event {
this.address = Convert.toNotNullableString(json['address'], ''),
this.city = Convert.toNotNullableString(json['city'], ''),
this.country = Convert.toNotNullableString(json['country'], ''),
this.screenshot = Convert.toNotNullableString(json['screenshot'], '') {}
this.screenshot = Convert.toNotNullableString(json['screenshot'], '');

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/exchange.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Exchange {
this.tradeVolume24hBtc =
Convert.toDouble(json['trade_volume_24h_btc']) ?? 0,
this.tradeVolume24hBtcNormalized =
Convert.toDouble(json['trade_volume_24h_btc_normalized']) ?? 0 {}
Convert.toDouble(json['trade_volume_24h_btc_normalized']) ?? 0;

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/exchange_extended.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class ExchangeExtended {
this.tradeVolume24hBtcNormalized =
Convert.toDouble(json['trade_volume_24h_btc_normalized']) ?? 0,
this.tickers = _parseTickers(json['tickers']),
this.statusUpdates = _parseStatusUpdates(json['status_updates']) {}
this.statusUpdates = _parseStatusUpdates(json['status_updates']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/exchange_market.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ExchangeMarket {
this.identifier = Convert.toNotNullableString(json['identifier'], ''),
this.hasTradingIncentive =
Convert.toNotNullableBoolean(json['has_trading_incentive'], false),
this.logo = Convert.toNullableString(json['logo']) {}
this.logo = Convert.toNullableString(json['logo']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/exchange_rate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ExchangeRate {
: this.name = Convert.toNotNullableString(json['name'], ''),
this.unit = Convert.toNotNullableString(json['unit'], ''),
this.value = Convert.toDouble(json['value']) ?? 0,
this.type = Convert.toNotNullableString(json['type'], '') {}
this.type = Convert.toNotNullableString(json['type'], '');

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/exchange_short.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ExchangeShort {

ExchangeShort.fromJson(Map<String, dynamic> json)
: this.id = Convert.toNotNullableString(json['id'], ''),
this.name = Convert.toNotNullableString(json['name'], '') {}
this.name = Convert.toNotNullableString(json['name'], '');

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/exchange_volume_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ExchangeVolumeData {

ExchangeVolumeData.fromArray(List<dynamic> array)
: this.date = Convert.toDateTime(array[0]) ?? Helpers.defaultDateTime(),
this.volume = Convert.toDouble(array[1]) ?? 0 {}
this.volume = Convert.toDouble(array[1]) ?? 0;

@override
String toString() {
Expand Down
3 changes: 1 addition & 2 deletions lib/data/finance_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ class FinancePlatform {
this.category = Convert.toNotNullableString(json['category'], ''),
this.centralized =
Convert.toNotNullableBoolean(json['centralized'], false),
this.websiteUrl =
Convert.toNotNullableString(json['website_url'], '') {}
this.websiteUrl = Convert.toNotNullableString(json['website_url'], '');

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/finance_product.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class FinanceProduct {
this.startAt = _parseDate(json['start_at']),
this.endAt = _parseDate(json['end_at']),
this.valueAt = _parseDate(json['value_at']),
this.redeemAt = _parseDate(json['redeem_at']) {}
this.redeemAt = _parseDate(json['redeem_at']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/global_coin_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class GlobalCoinData {
Helpers.parseMapStringDouble(json['market_cap_percentage']),
this.marketCapChangePercentage24hUsd =
Convert.toDouble(json['market_cap_change_percentage_24h_usd']),
this.updatedAt = Convert.toDateTime(json['updated_at']) {}
this.updatedAt = Convert.toDateTime(json['updated_at']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/global_defi_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class GlobalDefiData {
this.defiDominance = Convert.toDouble(json['defi_dominance']) ?? 0,
this.topCoinName = Convert.toNullableString(json['top_coin_name']),
this.topCoinDefiDominance =
Convert.toDouble(json['top_coin_defi_dominance']) ?? 0 {}
Convert.toDouble(json['top_coin_defi_dominance']) ?? 0;

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/image_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ImageInfo {
ImageInfo.fromJson(Map<String, dynamic> json)
: this.thumb = Convert.toNullableString(json['thumb']),
this.small = Convert.toNullableString(json['small']),
this.large = Convert.toNullableString(json['large']) {}
this.large = Convert.toNullableString(json['large']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/localized_string.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class LocalizedString {

LocalizedString.fromJson(Map<String, dynamic> json)
: this.id = Convert.toNotNullableString(json['id'], ''),
this.translations = _parseTranslations(json) {}
this.translations = _parseTranslations(json);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/market.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class Market {
Convert.toDouble(json['price_change_percentage_1y_in_currency']),
this.sparklineIn7d = json.containsKey('sparkline_in_7d')
? MarketSparkline.fromJson(json['sparkline_in_7d'])
: null {}
: null;

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/market_chart_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class MarketChartData {
this.price,
this.marketCap,
this.totalVolume,
}) {}
});

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/market_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class MarketData {
this.priceChangePercentage1yInCurrency,
this.marketCapChange24hInCurrency,
this.marketCapChangePercentage24hInCurrency,
}) {}
});

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/market_index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MarketIndex {
this.market = Convert.toNotNullableString(json['market'], ''),
this.last = Convert.toDouble(json['last']) ?? 0,
this.isMultiAssetComposite =
Convert.toNullableBoolean(json['is_multi_asset_composite']) {}
Convert.toNullableBoolean(json['is_multi_asset_composite']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/market_index_identified.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class MarketIndexIdentified {
this.market = Convert.toNotNullableString(json['market'], ''),
this.last = Convert.toDouble(json['last']) ?? 0,
this.isMultiAssetComposite =
Convert.toNullableBoolean(json['is_multi_asset_composite']) {}
Convert.toNullableBoolean(json['is_multi_asset_composite']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/market_index_short.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MarketIndexShort {

MarketIndexShort.fromJson(Map<String, dynamic> json)
: this.id = Convert.toNotNullableString(json['id'], ''),
this.name = Convert.toNotNullableString(json['name'], '') {}
this.name = Convert.toNotNullableString(json['name'], '');

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/market_sparkline.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class MarketSparkline {
final List<double> price;

MarketSparkline.fromJson(Map<String, dynamic> json)
: this.price = Helpers.parseListDouble(json['price']) {}
: this.price = Helpers.parseListDouble(json['price']);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/ohlc_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class OHLCInfo {
this.open = Convert.toDouble(array[1]) ?? 0,
this.high = Convert.toDouble(array[2]) ?? 0,
this.low = Convert.toDouble(array[3]) ?? 0,
this.close = Convert.toDouble(array[4]) ?? 0 {}
this.close = Convert.toDouble(array[4]) ?? 0;

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/price_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ class PriceInfo {

@override
String toString() {
return '${Helpers.getTypeName(PriceInfo)}: id = ${id}';
return '${Helpers.getTypeName(PriceInfo)}: id = $id';
}
}
Loading

0 comments on commit fce9817

Please sign in to comment.