Skip to content

Commit

Permalink
refactor: update linter (#1030)
Browse files Browse the repository at this point in the history
  • Loading branch information
ookami-kb authored Jul 16, 2023
1 parent 1f03fdd commit 2e08971
Show file tree
Hide file tree
Showing 29 changed files with 31 additions and 55 deletions.
2 changes: 1 addition & 1 deletion packages/borsh/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ dependencies:
dev_dependencies:
build_runner: ^2.0.6
dart_code_metrics: ^5.7.3
mews_pedantic: ^0.15.0
mews_pedantic: ^0.16.0
test: ^1.17.10
2 changes: 1 addition & 1 deletion packages/borsh_annotation/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ environment:

dev_dependencies:
dart_code_metrics: ^5.7.3
mews_pedantic: ^0.15.0
mews_pedantic: ^0.16.0
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,10 @@ class _PendingISKPListenerState extends State<PendingISKPListener> {
case SplitKeySource.qr:
sl<AnalyticsManager>().firstLinkReceived();
context.router.push(FirstPartQrScreen.route()).ignore();
break;
case SplitKeySource.other:
sl<PendingISKPRepository>().save(firstPartLink);
sl<AnalyticsManager>().firstLinkReceived();
_openFirstPartReadyScreen();
break;
}

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,8 @@ class OSKPService {
switch (apiVersion) {
case SplitKeyApiVersion.manual:
response = await _client.createPayment(dto);
break;
case SplitKeyApiVersion.smartContract:
response = await _client.createPaymentEc(dto);
break;
}
final tx = await response.transaction
.let(SignedTx.decode)
Expand Down Expand Up @@ -172,15 +170,13 @@ class OSKPService {
tx = await transaction
.let(SignedTx.decode)
.let((it) => it.resign(LocalWallet(escrow)));
break;
case SplitKeyApiVersion.smartContract:
final response = await _client.cancelPaymentEc(dto);
transaction = response.transaction;
slot = response.slot;
tx = await transaction
.let(SignedTx.decode)
.let((it) => it.resign(account));
break;
}

return OSKPStatus.cancelTxCreated(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ class TxReadyWatcher {
switch (payment.apiVersion) {
case SplitKeyApiVersion.manual:
destinationAccounts = tx.getDestinations();
break;
case SplitKeyApiVersion.smartContract:
destinationAccounts = txDetails.getInnerDestinations();
break;
}

final newStatus = await destinationAccounts.let(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,8 @@ class _CreateSwapScreenState extends State<CreateSwapScreen> {
switch (widget.operation) {
case SwapOperation.buy:
label = context.l10n.pressAndHoldToBuy(widget.outputToken.symbol);
break;
case SwapOperation.sell:
label = context.l10n.pressAndHoldToSell(widget.inputToken.symbol);
break;
}

return BlocListener<CreateSwapBloc, CreateSwapState>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,8 @@ class _State extends State<WalletFlowScreen> {
switch (operation) {
case WalletOperation.request:
_errorMessage = context.l10n.minimumAmountToRequest(r'$0.20');
break;
case WalletOperation.pay:
_errorMessage = context.l10n.minimumAmountToSend(r'$0.20');
break;
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,8 @@ class _ScreenState extends State<WalletMainScreen> {
switch (_action) {
case WalletOperation.pay:
widget.onPay();
break;
case WalletOperation.request:
widget.onRequest();
break;
}
},
size: CpButtonSize.big,
Expand Down
3 changes: 0 additions & 3 deletions packages/espressocash_app/lib/ui/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,12 @@ class CpButton extends StatelessWidget {
switch (size) {
case CpButtonSize.micro:
horizontalPadding = 8;
break;
case CpButtonSize.wide:
horizontalPadding = 4;
break;
case CpButtonSize.normal:
case CpButtonSize.big:
case CpButtonSize.small:
horizontalPadding = 16;
break;
}

final button = TextButton(
Expand Down
6 changes: 3 additions & 3 deletions packages/espressocash_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1083,13 +1083,13 @@ packages:
source: hosted
version: "1.9.1"
mews_pedantic:
dependency: "direct main"
dependency: "direct dev"
description:
name: mews_pedantic
sha256: b1e57633e02789e54bf4db54b1a5ce4d6e2df3c9d7458d9cb48b7a1c731094df
sha256: "95386812dceeafab5fa0612e7c0d2a35c709c84c4143224e6b1a4b46007b1c51"
url: "https://pub.dev"
source: hosted
version: "0.15.0"
version: "0.16.0"
mime:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion packages/espressocash_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ dependencies:
localizely_sdk: ^2.5.1
logging: ^1.1.0
meta: ^1.7.0
mews_pedantic: ^0.15.0
mobile_scanner: ^3.0.0-beta.4
nested: ^1.0.0
package_info_plus: ^4.0.1
Expand Down Expand Up @@ -97,6 +96,7 @@ dev_dependencies:
integration_test:
sdk: flutter
json_serializable: ^6.1.4
mews_pedantic: ^0.16.0
mockito: ^5.4.1
recase: ^4.1.0
retrofit_generator: ^4.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ dev_dependencies:
dart_code_metrics: ^5.7.3
freezed: ^2.0.2
json_serializable: ^6.3.1
mews_pedantic: ^0.15.0
mews_pedantic: ^0.16.0
retrofit_generator: ^4.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ dev_dependencies:
dart_code_metrics: ^5.7.3
freezed: ^2.2.0
json_serializable: ^6.5.2
mews_pedantic: ^0.15.0
mews_pedantic: ^0.16.0
retrofit_generator: ^4.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@ Future<Response> commonHandler(
switch (platform) {
case Platform.android:
app = candidate.androidOptions == null ? espressoCashApp : candidate;
break;
case Platform.ios:
app = candidate.iOSOptions == null ? espressoCashApp : candidate;
break;
case Platform.web:
app = candidate;
break;
}

final template = Template(
Expand All @@ -52,10 +49,8 @@ Future<Response> commonHandler(
case Platform.android:
case Platform.web:
shouldCopy = false;
break;
case Platform.ios:
shouldCopy = true;
break;
}

final data = <String, dynamic>{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,10 @@ extension SwapSlippageExt on SwapSlippage {
switch (this) {
case SwapSlippage.zpOne:
slippage = 0.1;
break;
case SwapSlippage.zpFive:
slippage = 0.5;
break;
case SwapSlippage.onePercent:
slippage = 1.0;
break;
}

return slippage.ceil().toDouble().toInt() * 100;
Expand Down
6 changes: 3 additions & 3 deletions packages/espressocash_backend/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ packages:
source: hosted
version: "0.12.16"
meta:
dependency: transitive
dependency: "direct main"
description:
name: meta
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
Expand All @@ -443,10 +443,10 @@ packages:
dependency: "direct dev"
description:
name: mews_pedantic
sha256: b1e57633e02789e54bf4db54b1a5ce4d6e2df3c9d7458d9cb48b7a1c731094df
sha256: "95386812dceeafab5fa0612e7c0d2a35c709c84c4143224e6b1a4b46007b1c51"
url: "https://pub.dev"
source: hosted
version: "0.15.0"
version: "0.16.0"
mime:
dependency: transitive
description:
Expand Down
3 changes: 2 additions & 1 deletion packages/espressocash_backend/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies:
path: espressocash_api
freezed_annotation: ^2.2.0
json_annotation: ^4.8.1
meta: ^1.9.1
mustache_template: ^2.0.0
sentry: ^7.8.0
shelf: ^1.4.0
Expand All @@ -28,5 +29,5 @@ dev_dependencies:
dart_code_metrics: ^5.7.3
freezed: ^2.1.0+1
json_serializable: ^6.7.1
mews_pedantic: ^0.15.0
mews_pedantic: ^0.16.0
test: ^1.24.2
2 changes: 1 addition & 1 deletion packages/espressocash_backend/test/payments/utils.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ignore_for_file: deprecated_member_use

import 'package:mews_pedantic/mews_pedantic.dart';
import 'package:meta/meta.dart';
import 'package:solana/encoder.dart';
import 'package:solana/solana.dart';

Expand Down
2 changes: 1 addition & 1 deletion packages/jsonrpc_client/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ dependencies:

dev_dependencies:
dart_code_metrics: ^5.7.3
mews_pedantic: ^0.15.0
mews_pedantic: ^0.16.0
test: ^1.16.0
2 changes: 1 addition & 1 deletion packages/solana/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ dev_dependencies:
json_serializable: ^6.0.0
jsonrpc_client:
path: ../jsonrpc_client
mews_pedantic: ^0.15.0
mews_pedantic: ^0.16.0
test: ^1.17.11
6 changes: 3 additions & 3 deletions packages/solana_mobile_client/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,10 @@ packages:
dependency: "direct dev"
description:
name: mews_pedantic
sha256: b1e57633e02789e54bf4db54b1a5ce4d6e2df3c9d7458d9cb48b7a1c731094df
sha256: "95386812dceeafab5fa0612e7c0d2a35c709c84c4143224e6b1a4b46007b1c51"
url: "https://pub.dev"
source: hosted
version: "0.15.0"
version: "0.16.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -744,5 +744,5 @@ packages:
source: hosted
version: "3.1.1"
sdks:
dart: ">=3.0.0-0 <4.0.0"
dart: ">=3.0.0 <4.0.0"
flutter: ">=2.5.0"
2 changes: 1 addition & 1 deletion packages/solana_mobile_client/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dev_dependencies:
flutter_test:
sdk: flutter
freezed: ^2.1.0+1
mews_pedantic: ^0.15.0
mews_pedantic: ^0.16.0

flutter:
uses-material-design: true
2 changes: 1 addition & 1 deletion packages/solana_mobile_client/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dev_dependencies:
sdk: flutter
freezed: ^2.1.0+1
json_serializable: ^6.3.1
mews_pedantic: ^0.15.0
mews_pedantic: ^0.16.0
pigeon: ^7.1.1

flutter:
Expand Down
6 changes: 3 additions & 3 deletions packages/solana_mobile_wallet/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,10 @@ packages:
dependency: "direct dev"
description:
name: mews_pedantic
sha256: b1e57633e02789e54bf4db54b1a5ce4d6e2df3c9d7458d9cb48b7a1c731094df
sha256: "95386812dceeafab5fa0612e7c0d2a35c709c84c4143224e6b1a4b46007b1c51"
url: "https://pub.dev"
source: hosted
version: "0.15.0"
version: "0.16.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -861,5 +861,5 @@ packages:
source: hosted
version: "3.1.1"
sdks:
dart: ">=3.0.0-0 <4.0.0"
dart: ">=3.0.0 <4.0.0"
flutter: ">=3.0.0"
2 changes: 1 addition & 1 deletion packages/solana_mobile_wallet/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dev_dependencies:
flutter_test:
sdk: flutter
freezed: ^2.1.0+1
mews_pedantic: ^0.15.0
mews_pedantic: ^0.16.0

flutter:
uses-material-design: true
2 changes: 1 addition & 1 deletion packages/solana_mobile_wallet/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dev_dependencies:
sdk: flutter
freezed: ^2.1.0+1
json_serializable: ^6.3.1
mews_pedantic: ^0.15.0
mews_pedantic: ^0.16.0
pigeon: ^7.1.1

flutter:
Expand Down
6 changes: 3 additions & 3 deletions packages/solana_seed_vault/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,10 @@ packages:
dependency: "direct dev"
description:
name: mews_pedantic
sha256: b1e57633e02789e54bf4db54b1a5ce4d6e2df3c9d7458d9cb48b7a1c731094df
sha256: "95386812dceeafab5fa0612e7c0d2a35c709c84c4143224e6b1a4b46007b1c51"
url: "https://pub.dev"
source: hosted
version: "0.15.0"
version: "0.16.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -744,5 +744,5 @@ packages:
source: hosted
version: "3.1.1"
sdks:
dart: ">=3.0.0-0 <4.0.0"
dart: ">=3.0.0 <4.0.0"
flutter: ">=2.5.0"
2 changes: 1 addition & 1 deletion packages/solana_seed_vault/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dev_dependencies:
flutter_test:
sdk: flutter
freezed: ^2.2.0
mews_pedantic: ^0.15.0
mews_pedantic: ^0.16.0

flutter:
uses-material-design: true
2 changes: 1 addition & 1 deletion packages/solana_seed_vault/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dev_dependencies:
sdk: flutter
freezed: ^2.1.0+1
json_serializable: ^6.3.1
mews_pedantic: ^0.15.0
mews_pedantic: ^0.16.0
mockito: ^5.3.2
pigeon: ^7.1.1

Expand Down

0 comments on commit 2e08971

Please sign in to comment.