add data json
This commit is contained in:
parent
e9fe2264a1
commit
9bd8b5c374
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"people": [
|
||||||
|
{
|
||||||
|
"image": "url",
|
||||||
|
"name": "name",
|
||||||
|
"senator": "true",
|
||||||
|
"description": "killed -42 people"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -13,11 +13,13 @@ class Senatorialkillers extends StatelessWidget {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
body: Center(
|
body: SingleChildScrollView(
|
||||||
child: Column(
|
child: Center(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: const [Heading(), Quiz()],
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: const [Heading(), Quiz()],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -12,6 +12,34 @@ class Quiz extends StatefulWidget {
|
||||||
class _QuizState extends State<Quiz> {
|
class _QuizState extends State<Quiz> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return const Text("quiz");
|
return Column(
|
||||||
|
children: [
|
||||||
|
Image.network(
|
||||||
|
"https://upload.wikimedia.org/wikipedia/commons/thumb/c/c1/Variegated_golden_frog_%28Mantella_baroni%29_Ranomafana.jpg/640px-Variegated_golden_frog_%28Mantella_baroni%29_Ranomafana.jpg?download"),
|
||||||
|
const AnswerButtons(),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AnswerButtons extends StatelessWidget {
|
||||||
|
const AnswerButtons({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
TextButton.icon(
|
||||||
|
onPressed: null,
|
||||||
|
icon: const Icon(Icons.how_to_vote),
|
||||||
|
label: const Text("Senator"),
|
||||||
|
),
|
||||||
|
TextButton.icon(
|
||||||
|
onPressed: null,
|
||||||
|
icon: const Icon(Icons.gavel),
|
||||||
|
label: const Text("Serial Killer"),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,8 @@ flutter:
|
||||||
uses-material-design: true
|
uses-material-design: true
|
||||||
|
|
||||||
# To add assets to your application, add an assets section, like this:
|
# To add assets to your application, add an assets section, like this:
|
||||||
# assets:
|
assets:
|
||||||
|
- assets/data.json
|
||||||
# - images/a_dot_burr.jpeg
|
# - images/a_dot_burr.jpeg
|
||||||
# - images/a_dot_ham.jpeg
|
# - images/a_dot_ham.jpeg
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue