driverMain.dart 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. import 'package:flutter/material.dart';
  2. import '../passenger/userMain.dart';
  3. import 'driverLogin.dart';
  4. import 'driverRegister.dart';
  5. class driverMain extends StatefulWidget {
  6. @override
  7. State<driverMain> createState() => _driverMainState();
  8. }
  9. class _driverMainState extends State<driverMain> {
  10. @override
  11. Widget build(BuildContext context) {
  12. return Scaffold(
  13. backgroundColor: Colors.white,
  14. body:
  15. SingleChildScrollView(
  16. child: Column(
  17. children: [
  18. Padding(
  19. padding: EdgeInsets.all(16.0),
  20. child: Column(
  21. mainAxisAlignment: MainAxisAlignment.center,
  22. crossAxisAlignment: CrossAxisAlignment.center,
  23. children: [
  24. SizedBox(height: 20),
  25. Align(
  26. alignment: Alignment.centerLeft,
  27. child: Text(
  28. 'Make daily trips',
  29. style: TextStyle(
  30. fontFamily: 'Poppins',
  31. fontSize: 27,
  32. fontWeight: FontWeight.bold,
  33. color: Colors.black,
  34. ),
  35. ),
  36. ),
  37. SizedBox(height: 0),
  38. Align(
  39. alignment: Alignment.centerLeft,
  40. child: Text(
  41. 'Maximize earnings',
  42. style: TextStyle(
  43. fontFamily: 'Poppins',
  44. fontSize: 27,
  45. color: Colors.black,
  46. ),
  47. ),
  48. ),
  49. SizedBox(height: 70),
  50. Image.asset(
  51. 'assets/images/putrago.png',
  52. height: 70,
  53. ),
  54. //Go to Login page
  55. SizedBox(height: 70),
  56. Container(
  57. width: 334,
  58. height: 65,
  59. decoration: BoxDecoration(
  60. borderRadius: BorderRadius.circular(10),
  61. color: Color.fromRGBO(119, 97, 255, 1.0),
  62. ),
  63. child: TextButton(
  64. onPressed: () {
  65. Navigator.push(
  66. context,
  67. MaterialPageRoute(builder: (context) => driverLogin()),
  68. );
  69. },
  70. child: Text(
  71. 'Login',
  72. style: TextStyle(
  73. fontFamily: 'Poppins',
  74. fontSize: 17,
  75. fontWeight: FontWeight.bold,
  76. color: Colors.white,
  77. ),
  78. ),
  79. ),
  80. ),
  81. //Go to register page
  82. SizedBox(height: 10),
  83. Container(
  84. width: 334,
  85. height: 65,
  86. decoration: BoxDecoration(
  87. borderRadius: BorderRadius.circular(10),
  88. color: Colors.white,
  89. border: Border.all(color: Colors.black, width: 2),
  90. ),
  91. child: TextButton(
  92. onPressed: () {
  93. // Handle register button press
  94. Navigator.push(
  95. context,
  96. MaterialPageRoute(builder: (context) => driverRegister()),
  97. );
  98. },
  99. child: Text(
  100. 'Register',
  101. style: TextStyle(
  102. fontFamily: 'Poppins',
  103. fontSize: 17,
  104. fontWeight: FontWeight.bold,
  105. color: Colors.black,
  106. ),
  107. ),
  108. ),
  109. ),
  110. SizedBox(height: 20),
  111. Text(
  112. 'or',
  113. style: TextStyle(
  114. fontFamily: 'Poppins',
  115. fontSize: 17,
  116. fontWeight: FontWeight.bold,
  117. color: Color.fromRGBO(165, 165, 165, 1),
  118. ),
  119. ),
  120. SizedBox(height: 20),
  121. TextButton(
  122. onPressed: () {
  123. // Handle login as a driver button press
  124. Navigator.push(
  125. context,
  126. MaterialPageRoute(builder: (context) => userMain()),
  127. );
  128. },
  129. child: Text(
  130. 'Login as a User',
  131. style: TextStyle(
  132. fontFamily: 'Poppins',
  133. fontSize: 17,
  134. fontWeight: FontWeight.w500,
  135. decoration: TextDecoration.underline,
  136. color: Color.fromRGBO(119, 97, 255, 1.0),
  137. ),
  138. ),
  139. ),
  140. ],
  141. ),
  142. ),
  143. ],
  144. ),
  145. )
  146. );
  147. }
  148. }