senatorialkillers/lib/main.dart

37 lines
1020 B
Dart
Raw Permalink Normal View History

2022-07-31 19:10:14 +00:00
import 'package:flutter/material.dart';
2022-08-01 12:13:50 +00:00
import './quiz.dart';
import './heading.dart';
2022-08-01 13:29:45 +00:00
import './person.dart';
2022-08-01 14:59:57 +00:00
import './about.dart';
2022-07-31 19:10:14 +00:00
2022-08-01 13:29:45 +00:00
void main() async {
2022-08-01 15:24:29 +00:00
// refuses to do anything in browser unless this is called
WidgetsFlutterBinding.ensureInitialized();
2022-08-01 13:29:45 +00:00
List<Person> people = await getPeopleList();
runApp(Senatorialkillers(
people: people,
));
2022-07-31 19:10:14 +00:00
}
2022-08-01 12:13:50 +00:00
class Senatorialkillers extends StatelessWidget {
2022-08-01 13:29:45 +00:00
const Senatorialkillers({required this.people, Key? key}) : super(key: key);
final List<Person> people;
2022-07-31 19:10:14 +00:00
@override
Widget build(BuildContext context) {
return MaterialApp(
2022-08-01 12:13:50 +00:00
home: Scaffold(
2022-08-01 14:59:57 +00:00
floatingActionButton: const AboutButton(),
2022-08-01 12:32:42 +00:00
body: SingleChildScrollView(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
2022-08-01 13:29:45 +00:00
children: [const Heading(), Quiz(fullPeopleList: people)],
2022-08-01 12:32:42 +00:00
),
2022-08-01 12:13:50 +00:00
),
2022-07-31 19:10:14 +00:00
),
),
);
}
}