home_page.dart 5.6 KB

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