-
Notifications
You must be signed in to change notification settings - Fork 12
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
base: dev
Are you sure you want to change the base?
feat(EWM-517): NFT #803
Conversation
…fix fields order & validation;
…ipboardPasteButton` and use them across multiple widgets;
e661d36
to
85f926c
Compare
… with not passed parameter to compassBack
…nd handle null NFT names
(name) => switch (name) { | ||
'grid' => NftDisplayMode.grid, | ||
'list' => NftDisplayMode.list, | ||
_ => null, | ||
}, |
There was a problem hiding this comment.
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], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зачем формировать массив в build. Можно в wm положить уже в массиве.
There was a problem hiding this comment.
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>(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно вынести в константу.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
); | ||
} | ||
|
||
Widget _buildGridView( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Давайте максимально избегать построения изх методов.
Это антипаттерн.
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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 не будет рендерится все поддерево, а только эта часть.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Выглядит так что TripleSourceBuilder здесь не сильно нужен.
Рассмотри вариант чтобы сократить. Так как все поддерево будет рендерится реагируя на 3 notifier.
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Либо встраивать в дерево, либо выносить в виджет. Но не функция.
There was a problem hiding this comment.
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: () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это Stateful - можно вынести в метод.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
546e128
to
2f437f6
Compare
Description
copilot:all
Type of Change