aditya803

Untitled

Mar 25th, 2020
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.94 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2. import 'package:voting_app/FirstPage.dart';
  3.  
  4. void main()=> runApp(new MyApp());
  5.  
  6. class MyApp extends StatelessWidget {
  7. @override
  8. Widget build(BuildContext context) {
  9. return MaterialApp(
  10. debugShowCheckedModeBanner: false,
  11. home: new MyHomePage(),
  12. routes: <String, WidgetBuilder> {
  13. '/first': (BuildContext context) => FirstPage(),
  14. } ,
  15. );
  16. }
  17. }
  18.  
  19. class MyHomePage extends StatefulWidget {
  20. @override
  21. _MyHomePageState createState() => new _MyHomePageState();
  22. }
  23.  
  24. class _MyHomePageState extends State<MyHomePage> {
  25. @override
  26. Widget build(BuildContext context) {
  27. return Scaffold(
  28. resizeToAvoidBottomPadding: false,
  29. body: Column(
  30. crossAxisAlignment: CrossAxisAlignment.start,
  31. children: <Widget>[
  32. Container(
  33. child: Stack(
  34. children: <Widget>[
  35. Container(
  36. padding: EdgeInsets.fromLTRB(15.0, 110.0, 0.0, 0.0),
  37. child: Text(
  38. 'Ballot',
  39. style: TextStyle(
  40. fontSize: 80.0, fontWeight: FontWeight.bold
  41. )
  42. ),
  43. ),
  44. Container(
  45. padding: EdgeInsets.fromLTRB(17.0, 182.0, 0.0, 0.0),
  46. child: Text(
  47. 'Every vote counts',
  48. style: TextStyle(
  49. fontSize: 30.0, fontWeight: FontWeight.bold
  50. )
  51. ),
  52. ),
  53. Container(
  54. padding: EdgeInsets.fromLTRB(255.0, 173.0, 0.0, 0.0),
  55. child: Text(
  56. '.',
  57. style: TextStyle(
  58. fontSize: 40.0, fontWeight: FontWeight.bold, color: Colors.red[600]
  59. )
  60. ),
  61. )
  62. ],
  63. ),
  64. ),
  65. Container(
  66. padding: EdgeInsets.only(top: 95.0, left: 20.0, right: 20.0),
  67. child: Column(
  68. children: <Widget>[
  69. TextField(
  70. decoration: InputDecoration(
  71. labelText: 'VOTER ID',
  72. labelStyle: TextStyle(
  73. fontFamily: 'Montserrat',
  74. fontWeight: FontWeight.bold,
  75. color: Colors.grey
  76. )
  77. ),
  78. ),
  79. SizedBox(height: 20.0),
  80. TextField(
  81. decoration: InputDecoration(
  82. labelText: 'DOB',
  83. labelStyle: TextStyle(
  84. fontFamily: 'Montserrat',
  85. fontWeight: FontWeight.bold,
  86. color: Colors.grey
  87. )
  88. ),
  89. ),
  90. SizedBox(height: 150.0),
  91. Container(
  92. height: 50.0,
  93. child: Material(
  94. borderRadius: BorderRadius.circular(20.0),
  95. shadowColor: Colors.red[600],
  96. elevation: 7.0,
  97. color: Colors.red[600],
  98. child: RaisedButton(
  99. onPressed: () => signIn(context),
  100. child: Text(
  101. 'Vote!',
  102. style: TextStyle(
  103. fontWeight: FontWeight.bold,
  104. fontFamily: 'Matserrat',
  105. color: Colors.white,
  106. ),
  107. ),
  108. ),
  109. ),
  110. )
  111. ],
  112. ),
  113. ),
  114. ],
  115. ),
  116. );
  117. }
  118. void signIn(BuildContext context){
  119. Navigator.pushReplacementNamed(context, '/First');
  120. }
  121. }
Add Comment
Please, Sign In to add comment