I'm making a text game with a sf fiction writer. This game is similar to the Japanese visual novel. The story changes through choice.
DB is using sqflite. I am loading text via listview.builder. The list with dialogue is named Notes. I made it with reference to the memo app and did not edit it. But I don't want to load the index sequentially. I thought listview.builder was a for loop. Something is different. I want to change idex but it is difficult for me.
I would like to see 4,5 when it is index 2. index 6 and 7 should not be visible. When index 3, index 4,5 should not be visible. I wish I could jump to index 6 or 7.
Actual index 2 and 3 are buttons. I had to post a question in a hurry, so I made a new one. Can you give me a hint? I also upload a table I made randomly. Even if it is different from the intention of my question, please suggest a good direction. It's ok if it's different from my code. Not using DB, not using sqlite, dividing DB in two, using for loop….
text_game_viewer
dialogue_db.csv
Widget Builder() {
return FutureBuilder(
builder: (context, Snap) {
if ((Snap.data as List).length == 0) {
return Container(
child: Text("add a note"),
);
}
return ListView.builder(
itemCount: (Snap.data as List).length,
itemBuilder: (context, index) {
Memo memo = (Snap.data as List)[index];
getNextItem(index) {
return Column(
children: <Widget>[
Text(
memo.title,
style: TextStyle(fontWeight: FontWeight.bold),
),
Text(memo.text),
Padding(padding: EdgeInsets.only(bottom: 20))
],
);
}
return getNextItem(index);
},
);
},
future: loadMemo(),
);}

