Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3.  
  4. void main() {
  5. runApp(Quizlr());
  6. }
  7.  
  8. class Quizlr extends StatelessWidget {
  9. @override
  10. Widget build(BuildContext context) {
  11. return MaterialApp(
  12. home: Scaffold(
  13. backgroundColor: Colors.grey.shade900,
  14. body: SafeArea(
  15. child: Padding(
  16. padding: EdgeInsets.symmetric(horizontal: 10.0),
  17. child: QuizPage(),
  18. ),
  19. ),
  20. ));
  21. }
  22. }
  23.  
  24. class QuizPage extends StatefulWidget {
  25. @override
  26. _QuizPageState createState() => _QuizPageState();
  27. }
  28.  
  29. class _QuizPageState extends State<QuizPage> {
  30. List<Icon> scoreKeeper = [
  31. Icon(Icons.check, color: Colors.green,),
  32. Icon(Icons.clear, color: Colors.red,),
  33. Icon(Icons.clear, color: Colors.red,),
  34. Icon(Icons.check, color: Colors.green,),
  35. Icon(Icons.check, color: Colors.green,),
  36. ];
  37. @override
  38. Widget build(BuildContext context) {
  39. return Column(
  40. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  41. crossAxisAlignment: CrossAxisAlignment.stretch,
  42. children: <Widget>[
  43. Expanded(
  44. flex: 5,
  45. child: Padding(
  46. padding: EdgeInsets.all(10.0),
  47. child: Center(
  48. child: Text(
  49. 'This is where the question text will go',
  50. textAlign: TextAlign.center,
  51. style: TextStyle(
  52. fontSize: 24.0,
  53. color: Colors.white,
  54. ),
  55. ),
  56. ),
  57. ),
  58. ),
  59. Expanded(
  60. child: Padding(
  61. padding: EdgeInsets.all(10.0),
  62. child: FlatButton(
  63. textColor: Colors.white,
  64. color: Colors.green,
  65. child: Text(
  66. 'True',
  67. style: TextStyle(
  68. fontSize: 20.0,
  69. color: Colors.white,
  70. ),
  71. ),
  72. onPressed: () {},
  73. ),
  74. ),
  75. ),
  76. Expanded(
  77. child: Padding(
  78. padding: EdgeInsets.all(10.0),
  79. child: FlatButton(
  80. textColor: Colors.white,
  81. color: Colors.red,
  82. child: Text(
  83. 'False',
  84. style: TextStyle(
  85. fontSize: 20.0,
  86. color: Colors.white,
  87. ),
  88. ),
  89. onPressed: () {},
  90. ),
  91. ),
  92. ),
  93.  
  94. Row(
  95. children: scoreKeeper,
  96. )
  97. ],
  98. );
  99. }
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement