Dictionary? dic;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text(“Dictionary Api”),
),
body: SingleChildScrollView(
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 20, left: 20, right: 20),
child: TextField(
onChanged: (value) {
setState(() {
word = value;
});
},
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(20),
),
),
),
),
Center(
child: ElevatedButton(
onPressed: () {
setState(() {});
},
child: const Text(“Search”),
),
),
SizedBox(
height: MediaQuery.of(context).size.height,
child: ListView.builder(
itemCount: dic!.phonetics.length,
itemBuilder: (context, index) {
return ListTile(
title: Text(dic!.phonetics[index].sourceUrl.toString()),
);
},
),
)
],
),
),
);
}
}