-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
feat: Make attributes clickable #1654
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1654 +/- ##
==========================================
- Coverage 8.86% 8.25% -0.61%
==========================================
Files 161 169 +8
Lines 6623 7158 +535
==========================================
+ Hits 587 591 +4
- Misses 6036 6567 +531
Continue to review full report at Codecov.
|
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.
@M123-dev Honestly I'm very surprised by several things I've seen.
Especially, you are very bold to change the way providers are dealt with in main.dart
- huge impact if that doesn't work.
And the way you deal with loading page is not something I'm familiar with - I prefer LoadingDialog
.
Besides, it's (once more) about knowledge panels, which is not something I've worked a lot on.
I can only comment. Not approve or even request changes: in both cases that would mean I'm comfortable enough to see how to improve things, and here I'm outside my comfort zone.
packages/smooth_app/lib/pages/product/product_knowledge_panels.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/main.dart
Outdated
@@ -161,12 +164,18 @@ class _SmoothAppState extends State<SmoothApp> { | |||
} | |||
|
|||
return MultiProvider( | |||
providers: <ChangeNotifierProvider<ChangeNotifier>>[ | |||
providers: <SingleChildWidget>[ |
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.
Very surprising. You must very confident to do something like that.
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.
Actually I just noticed this change isn't needed anymore, it's a leftover from an attempt to get it simpler, reverted. Thanks for pointing out
import 'package:smooth_app/cards/product_cards/knowledge_panels/knowledge_panel_full_page.dart'; | ||
import 'package:smooth_app/data_models/data_provider.dart'; | ||
|
||
class KnowledgePanelFullLoadingPage extends StatelessWidget { |
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.
Very surprised that you don't use LoadingDialog
instead.
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.
I thought about that too, but that would have meant that I would have had to distribute the Future through the provider, this seemed to add even more complexity especially when you try to avoid having two calls (when opening the product page and when opening the attributes)
@jasmeet0817 could you chime in on this one ? |
@monsieurtanuki I requested feedback from @jasmeet0817 |
Thanks for flagging, I'll have a look in the morning tomorrow. |
Actually @monsieurtanuki I am not exactly happy with the additional complexity of the PR's aswell. Especially the hacky way with the map provider is somewhat strange and not easy to understand on the first readthrough. So if there are, even fundamental different, implementation suggestions I'm open to hearing them |
@M123-dev The more I read your code the less I want to maintain it. I have absolutely no idea why you use a provider. I'm sure that if you just start again from scratch tomorrow morning, you'll find something much more elegant. In the meanwhile, my suggestion - as far as I understand your goal ("What is your quest?"):
|
For my understanding sake, what's the high level plan for this change ? I remember vaguely the idea was that the server would send attribute id -> knowledge panel id. And on click the knowledge panel with that Id would open up. Is that still the plan |
Here @jasmeet0817 #1029 but the code is now in #1666 not here anymore |
What
Fixes: Make attributes tapable in the Summary card #1029
Created
knowledge_panel_full_page
moved fromknowledge_panel_card
into a own fileCreated
knowledge_panel_full_loading_page
a new page which opens when clicking on a attribute, shows a loading indicator as long as the knowledge panel's aren't loaded yet. Replaces itself automatically.Created
DataProvider
class for sharing custom data via Providermain.dart
created new DataProvider provider for sharing knowledge panel data, my first approach was to create a local provider on the product page, this turned out to not work as the provider isn't in the widget tree anymore when calling navigator.push (when the Provider is created below the MaterialApp)new_product_page
minor refactoring + updated to write and delete data from DataProviderCreated
product_knowledge_panels
moved from product page with accessing knowledge panel data via providersummary_card
make attributes clickable