I'm trying to make a page for each letter of the alphabet. I need to take the data from a JSON. So I don't have to define a class for each letter.
Row(
children: <Widget>[
Expanded(
child: Stack(
children: <Widget>[
Container(
margin: EdgeInsets.all(sizeY / 3 - 1),
height: sizeY,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
"assets/square-" + imgColor + "-big.png"),
fit: BoxFit.fitHeight)),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Center(
child: Text(
this.letter + this.letter.toLowerCase(),
style: TextStyle(
color: Colors.white,
fontSize: 40.0,
fontFamily: 'ConcertOne',
fontWeight: FontWeight.normal),
textAlign: TextAlign.center,
),
),
),
),
],
),
),
Expanded(
child: Text(
this.shembulli1,
style: TextStyle(
color: Colors.pink,
fontWeight: FontWeight.bold,
fontSize: 30.0),
textAlign: TextAlign.center,
),
),
Expanded(
child: Container(
width: sizeY / 2,
height: sizeX / 2,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/" + shembulliImg1 + ".png"),
fit: BoxFit.contain)),
))
],
),
Where shembulli1, shembulli2, shembulliImg1, shembulliImg2, letter, and imgColor have to come from JSON which looks something like this:
{
"shembulli1":"Bleta",
"shembulli2":"Biçikleta",
"shembulliImg1":"bee",
"shembulliImg2":"bike",
"letter":"B",
"imgColor":"blue"
},
{
"shembulli1":"Cicërima",
"shembulli2":"Certifikata",
"shembulliImg1":"bird",
"shembulliImg2":"letter",
"letter":"C",
"imgColor":"yellow"
},