1

I want a dependent dropdown selection for

  1. The Book Name (Independent)
  2. The Chapter (Dependent)
  3. The Verse (Dependent) I Want the Dropdown to be in this format

First, Independent Dropdown

Select using the name

Second, Dependent Dropdown

indexes of the chapters' children

Third, Dependent Dropdown

select using the index of verse texts

This is how the json format looks

[![\[
  {
    "name": "Genesis",
    "chapters": \[
      \[
        "Verse 1 texts",
        "Verse 2 txts",
        "Verse 3 txts",
        "Verse 4 txts",
        "Verse 5 txts"
      \],
      \[
        "Verse 1 texts",
        "Verse 2 txts",
        "Verse 3 txts",
        "Verse 4 txts",
        "Verse 5 txts"
      \]
    \]
  },
  {
    "name": "Exodus",
    "chapters": \[
      \[
        "Verse 1 texts",
        "Verse 2 txts",
        "Verse 3 txts",
        "Verse 4 txts",
        "Verse 5 txts"
      \],
      \[
        "Verse 1 texts",
        "Verse 2 txts",
        "Verse 3 txts",
        "Verse 4 txts",
        "Verse 5 txts"
      \]
    \]
  }
\]][1]][1]
Joel Lee
  • 21
  • 3
  • https://javiercbk.github.io/json_to_dart/ use this web to covert your json code into dart and then use it – benten Mar 18 '22 at 09:08

1 Answers1

0

Here is what you can do, make a list of chapters as a seperate json file and connect the first dropdown to that list then for the second list should show the number of chapters of the first book

json[selectedBook].length

then for the third dropdown

json[selectedBook][selectedChapter].length

then the selected verse can be retrived by

json[selectedBook][selectedChapter][selectedVerse]