Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/cupertino.dart';
- import 'package:flutter/material.dart';
- void main() {
- runApp(Quizlr());
- }
- class Quizlr extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- home: Scaffold(
- backgroundColor: Colors.grey.shade900,
- body: SafeArea(
- child: Padding(
- padding: EdgeInsets.symmetric(horizontal: 10.0),
- child: QuizPage(),
- ),
- ),
- ));
- }
- }
- class QuizPage extends StatefulWidget {
- @override
- _QuizPageState createState() => _QuizPageState();
- }
- class _QuizPageState extends State<QuizPage> {
- List<Icon> scoreKeeper = [
- Icon(Icons.check, color: Colors.green,),
- Icon(Icons.clear, color: Colors.red,),
- Icon(Icons.clear, color: Colors.red,),
- Icon(Icons.check, color: Colors.green,),
- Icon(Icons.check, color: Colors.green,),
- ];
- @override
- Widget build(BuildContext context) {
- return Column(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: <Widget>[
- Expanded(
- flex: 5,
- child: Padding(
- padding: EdgeInsets.all(10.0),
- child: Center(
- child: Text(
- 'This is where the question text will go',
- textAlign: TextAlign.center,
- style: TextStyle(
- fontSize: 24.0,
- color: Colors.white,
- ),
- ),
- ),
- ),
- ),
- Expanded(
- child: Padding(
- padding: EdgeInsets.all(10.0),
- child: FlatButton(
- textColor: Colors.white,
- color: Colors.green,
- child: Text(
- 'True',
- style: TextStyle(
- fontSize: 20.0,
- color: Colors.white,
- ),
- ),
- onPressed: () {},
- ),
- ),
- ),
- Expanded(
- child: Padding(
- padding: EdgeInsets.all(10.0),
- child: FlatButton(
- textColor: Colors.white,
- color: Colors.red,
- child: Text(
- 'False',
- style: TextStyle(
- fontSize: 20.0,
- color: Colors.white,
- ),
- ),
- onPressed: () {},
- ),
- ),
- ),
- Row(
- children: scoreKeeper,
- )
- ],
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement