头图

Use DBeaver software or your own custom database management software to open Strapi's sqlite database file.

image-20211010115152-ko3xkip.png

image-20211010115331-df62rtm.png

You can see that the locale field distinguishes the internationalized data. In addition, there is no cover image field in the vegettables

Analysis of the database shows that the picture is associated with the vegettables upload_file and upload_file_morph

Write in the sql editor

SELECT
    v.id,
    v.name,
    v.desc,
    v.locale,
    uf.hash,
    uf.ext, 
    v.created_at,
    v.updated_at
from
    vegetables v
LEFT OUTER JOIN upload_file_morph ufm on
    v.id = ufm.related_id
LEFT OUTER JOIN upload_file uf on
    ufm.upload_file_id = uf.id;

image-20211010133741-t0bteva.png

Test success! Create a view based on the above code.

image-20211010120946-fuw6aft.png

image-20211010133835-69h0t89.png

Next, analyze the pictures. In the Strapi project, the pictures are uploaded to the [project_root]/strapi/public/uploads folder.

image-20211010121704-khc3x8r.png

Modify pubspec.yaml add the following configuration

flutter: 
  assets: 
    - assets/db/
    - strapi/public/uploads/  
  uses-material-design: true

: Data Modeling
Next: Use Sqlite database


nasawz
47 声望10 粉丝