Skip to content

feat(EWM-517): NFT #803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 22 commits into
base: dev
Choose a base branch
from
Open

feat(EWM-517): NFT #803

wants to merge 22 commits into from

Conversation

AndreyMolochko
Copy link
Contributor

@AndreyMolochko AndreyMolochko commented Mar 7, 2025

Description

copilot:all

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

Egor Komarov added 2 commits May 20, 2025 11:04
…ipboardPasteButton` and use them across multiple widgets;
@Odrin Odrin changed the title feat: add nft ui feat(EWM-517): NFT May 26, 2025
@Odrin Odrin self-assigned this May 27, 2025
@Odrin Odrin force-pushed the feature/nft branch 3 times, most recently from e661d36 to 85f926c Compare May 29, 2025 16:03
levitckii-daniil and others added 2 commits May 30, 2025 10:13
@Odrin Odrin marked this pull request as ready for review June 3, 2025 08:31
Comment on lines 34 to 38
(name) => switch (name) {
'grid' => NftDisplayMode.grid,
'list' => NftDisplayMode.list,
_ => null,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Мне кажется лучше сделать метод внутри enum - static NftDisplayMode byName(String name)

sizeType: PrimaryTextFieldSizeType.medium,
hintText: LocaleKeys.nftPasteHint.tr(),
textEditingController: wm.addressController,
inputFormatters: [wm.addressFilterFormatter],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Зачем формировать массив в build. Можно в wm положить уже в массиве.

Copy link
Contributor

Choose a reason for hiding this comment

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

fixed


late final _currentAccount = createNotifierFromStream(model.currentAccount);
late final _isLoading = createNotifier(false);
late final _error = createNotifier<String>();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Давайте ко всем нотифаерам в название переменной добавлять State или Notifier. Так будет проще идентифицировать.

А так как в переменной лежит не bool, а notifier с bool, то вместо названия is"что-то" - loadingState/loadingNotifier.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hungarian notation - это устаревшая практика и антипаттерн, который снижает читаемость и дублирует информацию о типе переменной.

crossAxisCount: 2,
mainAxisSpacing: DimensSizeV2.d8,
crossAxisSpacing: DimensSizeV2.d8,
childAspectRatio: 168 / 196,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Можно вынести в константу.

Copy link
Contributor

Choose a reason for hiding this comment

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

done

);
}

Widget _buildGridView(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Давайте максимально избегать построения изх методов.
Это антипаттерн.

Copy link
Contributor

Choose a reason for hiding this comment

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

Это не построение из метода, а передача билдера в PagingListener

) ??
_indicator,
if (nativeUSDPrice != null && amount != null)
AmountWidget.dollars(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Зачем здесь DoubleSourceBuilder?
nativeUSDPrice Нужен только тут.

Можно использовать 2 StateNotifierBuilder. Отличие в том что при изменении nativeUSDPrice не будет рендерится все поддерево, а только эта часть.

Copy link
Contributor

Choose a reason for hiding this comment

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

done

firstSource: fees,
secondSource: feeError,
thirdSource: wm.nativeUSDPrice,
builder: (_, fees, feeError, nativeUSDPrice) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Выглядит так что TripleSourceBuilder здесь не сильно нужен.
Рассмотри вариант чтобы сократить. Так как все поддерево будет рендерится реагируя на 3 notifier.

Copy link
Contributor

Choose a reason for hiding this comment

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

done

),
);
} else {
Widget _buildCommentSuffix() => ValueListenableBuilder(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Либо встраивать в дерево, либо выносить в виджет. Но не функция.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

);
ClipboardPasteButton(
value: addressController,
onClear: () {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Это Stateful - можно вынести в метод.

Copy link
Contributor

Choose a reason for hiding this comment

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

done

@Odrin Odrin force-pushed the feature/nft branch 2 times, most recently from 546e128 to 2f437f6 Compare June 9, 2025 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants