driverPickup.dart 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. import 'package:flutter/material.dart';
  2. import 'driverFinishOrder.dart';
  3. import 'driverSelectOrder.dart';
  4. class driverPickup extends StatelessWidget {
  5. // Assuming you have a method to fetch order details from the database.
  6. // final Order order = fetchOrderFromDatabase();
  7. @override
  8. Widget build(BuildContext context) {
  9. return Scaffold(
  10. body: Padding(
  11. padding: const EdgeInsets.all(16.0),
  12. child: SingleChildScrollView(
  13. child:
  14. Column(
  15. mainAxisAlignment: MainAxisAlignment.center,
  16. children: <Widget>[
  17. const SizedBox(height: 20),
  18. Image.asset(
  19. 'assets/images/successImage.png',
  20. height: 140,
  21. width: 140,
  22. ),
  23. const SizedBox(height: 5),
  24. const Text(
  25. 'This order successfully created!',
  26. style:
  27. TextStyle(color: Colors.green, fontWeight: FontWeight.bold),
  28. ),
  29. // Your checkmark image will be placed here
  30. const Card(
  31. margin: EdgeInsets.symmetric(vertical: 20.0),
  32. child: Padding(
  33. padding: EdgeInsets.all(16.0),
  34. child: Column(
  35. children: <Widget>[
  36. Row(
  37. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  38. children: <Widget>[
  39. Text('07:40 PM'),
  40. Text('Monday'),
  41. ],
  42. ),
  43. Divider(),
  44. ListTile(
  45. title: Text('Name:'),
  46. subtitle: Text('Mu Shuang'), // Replace with dynamic data
  47. ),
  48. ListTile(
  49. title: Text('Route:'),
  50. subtitle: Text('Within UPM'), // Replace with dynamic data
  51. ),
  52. ListTile(
  53. title: Text('Start:'),
  54. subtitle: Text('FSKTM'), // Replace with dynamic data
  55. ),
  56. ListTile(
  57. title: Text('More than 4:'),
  58. subtitle: Text('Yes'), // Replace with dynamic data
  59. ),
  60. ListTile(
  61. title: Text('Tel:'),
  62. subtitle: Text('1129991444'), // Replace with dynamic data
  63. ),
  64. ListTile(
  65. title: Text('Price:'),
  66. subtitle: Text('RM 5'),
  67. // Replace with dynamic data
  68. ),
  69. ],
  70. ),
  71. ),
  72. ),
  73. ElevatedButton(
  74. style: ElevatedButton.styleFrom(
  75. backgroundColor: const Color.fromRGBO(119, 97, 255, 1.0) , // background
  76. onPrimary: Colors.white, // foreground
  77. ),
  78. onPressed: () {
  79. Navigator.push(
  80. context,
  81. MaterialPageRoute(builder: (context) => driverFinishOrder()),
  82. );
  83. },
  84. child: const Text('Finish Ride'),
  85. ),
  86. const SizedBox(height: 10),
  87. ElevatedButton(
  88. style: ElevatedButton.styleFrom(
  89. backgroundColor: const Color.fromRGBO(255, 120, 116, 1) , // background
  90. onPrimary: Colors.white, // foreground
  91. ),
  92. onPressed: () {
  93. Navigator.push(
  94. context,
  95. MaterialPageRoute(builder: (context) => driverSelectOrder()),
  96. );
  97. },
  98. child: const Text('Cancel'),
  99. ),
  100. ],
  101. ),
  102. )
  103. ),
  104. );
  105. }
  106. }