Skip to content

Commit

Permalink
refactor: remove common package (#1360)
Browse files Browse the repository at this point in the history
Co-authored-by: ookami-kb <[email protected]>
  • Loading branch information
justinenerio and ookami-kb authored Apr 1, 2024
1 parent f374001 commit 773d756
Show file tree
Hide file tree
Showing 97 changed files with 214 additions and 1,396 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:math';

import 'package:espressocash_common/espressocash_common.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

Expand All @@ -15,6 +14,7 @@ import '../../../ui/theme.dart';
import '../../activities/services/tx_updater.dart';
import '../../activities/widgets/recent_activity.dart';
import '../../balances/widgets/refresh_balance_wrapper.dart';
import '../../currency/models/currency.dart';
import '../../profile/screens/profile_screen.dart';
import '../../qr_scanner/widgets/build_context_ext.dart';
import '../widgets/home_carousel.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:decimal/decimal.dart';
import 'package:dfunc/dfunc.dart';
import 'package:espressocash_common/espressocash_common.dart';

import 'package:flutter/material.dart';

import '../../../di.dart';
Expand All @@ -13,7 +13,9 @@ import '../../../ui/info_icon.dart';
import '../../../ui/value_stream_builder.dart';
import '../../conversion_rates/services/watch_user_fiat_balance.dart';
import '../../conversion_rates/widgets/extensions.dart';
import '../../currency/models/amount.dart';
import '../../ramp/widgets/ramp_buttons.dart';
import '../../tokens/token.dart';
import '../../tokens/widgets/token_icon.dart';
import '../../wallet_flow/screens/wallet_screen.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import 'dart:async';

import 'package:espressocash_common/espressocash_common.dart';
import 'package:flutter/material.dart';
import 'package:injectable/injectable.dart';
import 'package:rxdart/rxdart.dart';
import 'package:shared_preferences/shared_preferences.dart';

import '../../authenticated/auth_scope.dart';
import '../../currency/models/amount.dart';
import '../../currency/models/currency.dart';
import '../../tokens/token.dart';

@Singleton(scope: authScope)
class BalancesRepository extends ChangeNotifier {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:async';

import 'package:bloc_concurrency/bloc_concurrency.dart';
import 'package:espressocash_common/espressocash_common.dart';

import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:injectable/injectable.dart';
Expand All @@ -12,6 +12,9 @@ import 'package:solana/solana.dart';
import '../../../utils/disposable_bloc.dart';
import '../../../utils/processing_state.dart';
import '../../authenticated/auth_scope.dart';
import '../../currency/models/amount.dart';
import '../../currency/models/currency.dart';
import '../../tokens/token.dart';
import '../data/balances_repository.dart';

part 'balances_bloc.freezed.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:dfunc/dfunc.dart';
import 'package:espressocash_common/espressocash_common.dart';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
Expand All @@ -11,6 +11,7 @@ import '../../../l10n/l10n.dart';
import '../../../ui/snackbar.dart';
import '../../../utils/processing_state.dart';
import '../../conversion_rates/services/conversion_rates_bloc.dart';
import '../../currency/models/currency.dart';
import '../services/balances_bloc.dart';
import 'context_ext.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import 'package:decimal/decimal.dart';
import 'package:dfunc/dfunc.dart';
import 'package:dio/dio.dart';
import 'package:espressocash_common/espressocash_common.dart';

import 'package:fast_immutable_collections/fast_immutable_collections.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:injectable/injectable.dart';
import 'package:retrofit/retrofit.dart';

import '../../currency/models/currency.dart';
import 'coingecko_client.dart';

part 'conversion_rates_client.freezed.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import 'package:decimal/decimal.dart';
import 'package:dfunc/dfunc.dart';
import 'package:espressocash_common/espressocash_common.dart';

import 'package:fast_immutable_collections/fast_immutable_collections.dart';
import 'package:flutter/material.dart';
import 'package:injectable/injectable.dart';
import 'package:rxdart/rxdart.dart';
import 'package:shared_preferences/shared_preferences.dart';

import '../../authenticated/auth_scope.dart';
import '../../currency/models/currency.dart';
import '../../tokens/token.dart';
import 'conversion_rates_client.dart';

@Singleton(scope: authScope)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:espressocash_common/espressocash_common.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:nested/nested.dart';
import 'package:provider/provider.dart';

import '../../di.dart';
import '../currency/models/currency.dart';
import 'data/repository.dart';
import 'services/conversion_rates_bloc.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import 'package:decimal/decimal.dart';
import 'package:espressocash_common/espressocash_common.dart';

import '../../../di.dart';
import '../../currency/models/amount.dart';
import '../../currency/models/currency.dart';
import '../../tokens/token.dart';
import '../data/repository.dart';

extension CryptoAmountExt on CryptoAmount {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import 'dart:async';

import 'package:bloc_concurrency/bloc_concurrency.dart';
import 'package:dfunc/dfunc.dart';
import 'package:espressocash_common/espressocash_common.dart';

import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:injectable/injectable.dart';
import 'package:logging/logging.dart';

import '../../../utils/processing_state.dart';
import '../../currency/models/currency.dart';
import '../data/repository.dart';

part 'conversion_rates_bloc.freezed.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'package:espressocash_common/espressocash_common.dart';
import 'package:injectable/injectable.dart';

import '../../currency/models/amount.dart';
import '../../currency/models/currency.dart';
import '../../tokens/token.dart';
import '../data/repository.dart';

@injectable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import 'package:dfunc/dfunc.dart';
import 'package:espressocash_common/espressocash_common.dart';

import 'package:injectable/injectable.dart';
import 'package:rxdart/rxdart.dart';

import '../../balances/data/balances_repository.dart';

import '../../currency/models/amount.dart';
import '../../currency/models/currency.dart';
import '../data/repository.dart';

@injectable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:dfunc/dfunc.dart';
import 'package:espressocash_common/espressocash_common.dart';

import 'package:flutter/material.dart';

import '../../../l10n/decimal_separator.dart';
Expand All @@ -10,6 +10,9 @@ import '../../../ui/colors.dart';
import '../../../ui/number_formatter.dart';
import '../../../ui/shake.dart';
import '../../../ui/usdc_info.dart';
import '../../currency/models/amount.dart';
import '../../currency/models/currency.dart';
import '../../tokens/token.dart';
import '../../wallet_flow/widgets/extensions.dart';
import '../services/amount_ext.dart';
import 'extensions.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import 'package:decimal/decimal.dart';
import 'package:espressocash_common/espressocash_common.dart';

import 'package:flutter/widgets.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';

import '../../../l10n/device_locale.dart';
import '../../currency/models/amount.dart';
import '../../currency/models/currency.dart';
import '../data/repository.dart';

extension ConversionRates on BuildContext {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:decimal/decimal.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

import '../../tokens/token.dart';
import 'currency.dart';
import 'token.dart';

part 'amount.freezed.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import 'package:decimal/decimal.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

import 'token.dart';
import '../../tokens/token.dart';

part 'currency.freezed.dart';

@freezed
@Freezed(
when: FreezedWhenOptions.none,
map: FreezedMapOptions.none,
)
sealed class Currency with _$Currency {
const factory Currency.fiat({
required String name,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import 'dart:math';

import 'package:espressocash_api/espressocash_api.dart';
import 'package:espressocash_common/espressocash_common.dart';

import 'package:injectable/injectable.dart';
import 'package:solana/solana.dart';

import '../../currency/models/amount.dart';
import '../../currency/models/currency.dart';
import '../../ramp/models/ramp_partner.dart';
import '../../tokens/token.dart';
import '../models/fee_type.dart';

@injectable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import 'package:dfunc/dfunc.dart';
import 'package:drift/drift.dart';
import 'package:espressocash_common/espressocash_common.dart';

import 'package:fast_immutable_collections/fast_immutable_collections.dart';
import 'package:get_it/get_it.dart';
import 'package:injectable/injectable.dart';
Expand All @@ -13,6 +13,8 @@ import 'package:solana/encoder.dart';
import '../../../data/db/db.dart';
import '../../../data/db/mixins.dart';
import '../../authenticated/auth_scope.dart';
import '../../currency/models/amount.dart';
import '../../currency/models/currency.dart';
import '../../escrow/models/escrow_private_key.dart';
import '../../transactions/models/tx_results.dart';
import '../models/incoming_link_payment.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:espressocash_common/espressocash_common.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:solana/encoder.dart';

import '../../currency/models/amount.dart';
import '../../escrow/models/escrow_private_key.dart';
import '../../transactions/models/tx_results.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:dfunc/dfunc.dart';
import 'package:espressocash_common/espressocash_common.dart';

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

Expand All @@ -11,6 +11,7 @@ import '../../../ui/info_icon.dart';
import '../../../ui/message_info_widget.dart';
import '../../authenticated/authenticated_navigator_key.dart';
import '../../conversion_rates/widgets/extensions.dart';
import '../../currency/models/amount.dart';
import '../../transactions/models/tx_results.dart';
import '../../transactions/widgets/transfer_error.dart';
import '../../transactions/widgets/transfer_progress.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ import 'dart:async';

import 'package:dfunc/dfunc.dart';
import 'package:espressocash_api/espressocash_api.dart';
import 'package:espressocash_common/espressocash_common.dart';

import 'package:fast_immutable_collections/fast_immutable_collections.dart';
import 'package:injectable/injectable.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:solana/encoder.dart';
import 'package:solana/solana.dart';

import '../../../utils/cancelable_job.dart';
import '../../currency/models/amount.dart';
import '../../currency/models/currency.dart';
import '../../transactions/models/tx_results.dart';
import '../../transactions/services/tx_sender.dart';
import '../data/ilp_repository.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:espressocash_common/espressocash_common.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:solana/solana.dart';

import '../../../config.dart';
import '../../tokens/token.dart';

part 'link_payment.freezed.dart';
part 'link_payment.g.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'dart:async';

import 'package:dfunc/dfunc.dart';
import 'package:drift/drift.dart';
import 'package:espressocash_common/espressocash_common.dart';

import 'package:fast_immutable_collections/fast_immutable_collections.dart';
import 'package:get_it/get_it.dart';
import 'package:injectable/injectable.dart';
Expand All @@ -15,6 +15,8 @@ import 'package:solana/solana.dart';
import '../../../data/db/db.dart';
import '../../../data/db/mixins.dart';
import '../../authenticated/auth_scope.dart';
import '../../currency/models/amount.dart';
import '../../currency/models/currency.dart';
import '../../tokens/token_list.dart';
import '../../transactions/models/tx_results.dart';
import '../models/outgoing_direct_payment.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:espressocash_common/espressocash_common.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:solana/encoder.dart';
import 'package:solana/solana.dart';

import '../../currency/models/amount.dart';
import '../../transactions/models/tx_results.dart';

part 'outgoing_direct_payment.freezed.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:decimal/decimal.dart';
import 'package:dfunc/dfunc.dart';
import 'package:espressocash_common/espressocash_common.dart';

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:solana/solana.dart';
Expand All @@ -18,6 +18,7 @@ import '../../../ui/theme.dart';
import '../../conversion_rates/widgets/amount_with_equivalent.dart';
import '../../fees/models/fee_type.dart';
import '../../fees/widgets/fee_label.dart';
import '../../tokens/token.dart';

class ODPConfirmationScreen extends StatefulWidget {
const ODPConfirmationScreen({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:async';

import 'package:dfunc/dfunc.dart';
import 'package:espressocash_api/espressocash_api.dart';
import 'package:espressocash_common/espressocash_common.dart';

import 'package:injectable/injectable.dart';
import 'package:solana/encoder.dart';
import 'package:solana/solana.dart';
Expand All @@ -11,6 +11,7 @@ import 'package:uuid/uuid.dart';
import '../../../config.dart';
import '../../accounts/models/ec_wallet.dart';
import '../../authenticated/auth_scope.dart';
import '../../currency/models/amount.dart';
import '../../transactions/models/tx_results.dart';
import '../../transactions/services/resign_tx.dart';
import '../../transactions/services/tx_sender.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:decimal/decimal.dart';
import 'package:espressocash_common/espressocash_common.dart';

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart';
Expand All @@ -9,6 +9,8 @@ import '../../../di.dart';
import '../../../ui/loader.dart';
import '../../accounts/models/account.dart';
import '../../analytics/analytics_manager.dart';
import '../../currency/models/amount.dart';
import '../../currency/models/currency.dart';
import '../services/odp_service.dart';

extension BuildContextExt on BuildContext {
Expand Down
Loading

0 comments on commit 773d756

Please sign in to comment.