Skip to content
Advertisement

Flutter/MySQL: How to pass URLs from mysql database to PageView/ImageSlider Widget?

I would like to pass a dynamic number of image url’s from my mysql database to a PageView Widget as a simple ImageSlider.

Problem: Several type errors like “the argument type ‘List(ImageList)’ can’t be assigned to the parameter type String.” OR “type List(dynamic) is not a subtype of type List(String)”etc., if i pass the selection to the Widget.

Question: How can i pass the selection from database to a PageView Widget? Do i have to change my sql-selection?

Below my short code example with a static list (what’s working fine):

JavaScript

What i tried so far:

  1. Select from database as json or as string (GROUP_CONCAT(image)) –> no success

  2. Changing the data types in Future for php-download –> no success

  3. Trying to pass as String or List(String) to the map –> no success

Would be great if someone has an idea. If more code/answers are needed, please comment. Thank you very much.

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement