Skip to content

Conversation

@roy-noncelab
Copy link
Collaborator

@roy-noncelab roy-noncelab commented Jan 15, 2026

issue : #525

block_explorer_service.dart의 getExplorerUrl이 화면 진입 마다 viewmodel에 의해 작동되어 비효율적인 상황

변경 사항

lib/providers/preference_provider.dart에서 네트워크 관련 부분 network_preference_provider.dart로 분리
block_explorer_service.dart 파일 삭제 후 network_preference_provider.dart로 로직 통합.
해당 과정에서 사용되는 변수 및 함수가 있는 연관된 viewmodel, screen 파일도 같이 수정.

  • block_explorer_screen의 경우 block_explorer_view_model 파일을 추가하여 리팩토링 진행

특이 사항

preference_provider 추가로 분리하는 리팩토링 필요

@roy-noncelab roy-noncelab added this to the Deploy 0.7.1/3.6.1 milestone Jan 15, 2026
@roy-noncelab roy-noncelab self-assigned this Jan 15, 2026
@roy-noncelab roy-noncelab added the ♻️ refactor 리팩토링 이슈 label Jan 15, 2026
@roy-noncelab roy-noncelab linked an issue Jan 15, 2026 that may be closed by this pull request
2 tasks
@roy-noncelab roy-noncelab changed the title [525] mempool 주소 가져오는 로직 리팩토링 [525] mempool 주소 가져오는 로직 1차 리팩토링 Jan 15, 2026
@roy-noncelab roy-noncelab changed the title [525] mempool 주소 가져오는 로직 1차 리팩토링 [525] mempool 주소 가져오는 로직 리팩토링 Jan 15, 2026
@ella-noncelab ella-noncelab removed this from the Deploy 0.7.1/3.6.1 milestone Jan 16, 2026
}
}

if (serverName == 'CUSTOM') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이왕 리팩토링하는거 const나 enum으로 정의해서 비교하면 안전할 것 같네요.


if (serverName.isEmpty) {
if (NetworkType.currentNetworkType == NetworkType.mainnet) {
setDefaultElectrumServer(DefaultElectrumServer.coconut);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getter 내부에서 async setter 호출하고 있네요. provider 생성 시 초기화하고, getter에서는 초기화 여부만 확인해서 (ensure 메서드 등으로 분리) getter 역할만 하는게 좋겠습니다.

}

Future<void> setCustomExplorerUrl(String url) async {
var formattedUrl = url.trim();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

block_explorer_view_model.dart에도 중복 코드가 있으니 url normalize 유틸로 빼면 좋을 것 같습니다.

@ella-noncelab
Copy link
Collaborator

transaction_Detail_screen, utxo_Detail_screen.dart 파일에 에러 있음.

Copy link
Collaborator

@ella-noncelab ella-noncelab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop 브랜치 머지했습니다.


NetworkPreferenceProvider();

Future<void> ensureInitialized() async {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

사용하는 곳이 없는 함수

@ella-noncelab
Copy link
Collaborator

ella-noncelab commented Feb 3, 2026

😭 아무래도 Electrum 설정 provider와 blockExplorer 설정 provider를 분리해야할 것 같아요.
electrum_server_provider
block_explorer_provider 분리하는게 낫겠습니다.
Electrum, Explorer 비슷하게 생겨서 코드 가독성이 낮더라구요.

@ella-noncelab ella-noncelab merged commit afbe505 into develop Feb 10, 2026
@ella-noncelab ella-noncelab deleted the refactor/525-mempool-get-url branch February 10, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♻️ refactor 리팩토링 이슈

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor] 월렛 mempool url 가져오는 로직

3 participants