SOLID make 1 product list screen and display based on data or make multiple product list screens with duplicate code - flutter

I am having this question and am looking for the best practice. I am building a mobile webshop in flutter and I am currently displaying products on a products_list_screen. Now is my question:
Would you make 1 global product list screen and display products based on the list you receive? Example
product_list_screen (and in the parameters the List with the correct category)
OR
Is it best for SOLID to make a new screen for each product category? example:
Jackets_product_list_screen
Shoes_product_list_screen
Shirts_product_list_screen
I do need a scrollcontroller for each product category since I need to implement lazy loading or infinite scrolling when the user is at the bottom of the page (it should display new products). This means the global product list screen would get very messy I think.
What do you think?

Related

How to achieve this layout in .Net Maui?

I have a .Net Maui app for selling some items.
Basically items are organised this way :
Pages
Categories
Items
I need the pages to work like tabbed pages. And inside a page there are categories summarized on the top of the page. And then items inside. And if I scroll to the bottom, the categories are moving to adapt to the current visible items.
Here is an example :
Here the page is Boissons & Eaux and the categories are Jus frais & Smoothies, Jus et néctars ...
And if I scroll to the bottom, the categories scroll to the right like this :
etc.
I know how to create tabbed pages. And for the categories, I'm thinking about the grouping feature of the collection view. However this doesn't seem to summarize categories separately. It just creates a header for each category as per the documentation here.
Does anyone know how to get a layout similar to this please ?
Thanks. Cheers,

Flutter: How to do responsiveness for "real" mobile/web applications?

I saw many articles and videos on how to do responsive design in flutter.
But they all have in common, that they show a standard web page with menu, pictures, text.
What I call "real" in the title, means a full interactive application, so with displaying tables of data, providing input fields and other input elements, showing charts, ... - so all the interaction of a "real" application, not just a web site.
Simple example: If I have a large data table on a desktop screen, it has to be different on a mobile screen to show data in a way, the user can read it and use it sensibly.
So, how do I make the app responsive for all screen sizes without having to implement something twice or have case distinctions all over the place?
Refractor codes into widgets. (very important to reduce boiler plates)
Create an idea on how the webpage will look like based on 12 grid system
In build method check for screen size and return layout based on the screen size.
Please note
The widgets should be responsive by itself based on the size available. For example a chart widget. It should build a chart within the space provided by its parent.
There may be instances where in desktop some elements are in a row and the same element will be in a column in mobile. So you can also write sections like banner section (define web and phone layout), about us section etc so its easier to manage
Use wrap widget to automatically bring widgets down based on screen size
Use BoxConstrains and max width to control a Containers max width
For tables you can use packages like responsive tables

best way to present multiple listview

I would like to know your idea about the best method to present several personalized horizontal lists, in the spotfy style.
With different preferences and musical styles.
The best way would be to create several listviews? or structure a database and make it somehow present only a few things on the user's homepage?
any suggestion?
i dont think there would be any problem displaying different list view on home showing few items ( 3 or 4 ) of that list and a button above each listView as View All on tapping using that list all items on that category personal screen
you can add multiple ListView as you can possible Try SingleChildScrollView for multiple ListView or Layouts
Refer Official Docs : docs

Should I use multiple blocs in one page/screen to load different states in Flutter?

I have been learning about Bloc Pattern in Flutter for weeks, but it seems it's a bit difficult when I implement in my real project.
For example:
I created a bloc (product_bloc) for loading all products from my server to a Listview. And on the same screen I have a Category Combobox for filter the product in my Listview by category. At this point, I want to load all my categories from server to the Combobox too. Should I create a new bloc (category_bloc) for loading category to Combobox at this point? It means that the state for product and state for category should be different in this case right? What should I do then? For one screen, we can use only one bloc right? Thanks in advance for you help :)
In your example, I think that the category it's only a atribute of the product. You don't apear of been manipulating categories but only selecting one to filter your results. In my opinion, you can use it in the same block.
But it's not a problem to use more than one blocs per pages/screens. I use an Authentication and an 'Entity' bloc in all of my Apps that I builded until today.

Appcelerator: Pagination for Views in IPhone

I want to show remotely fetched records and want to display in same format as Apple shows Icons on Home Screen. I also want pagination ( the dots on bottom) for indication of currently selected page. How could it be achieved?
I believe you're looking for the ScrollableView component. Use the HTTPClient to retrieve your data from the server, create views/imageviews/etc from the data as appropriate, then add the views as children to the ScrollableView.