Create Taxi Booking - OrderConfirm.dart

import 'package:cached_network_image/cached_network_image.dart';

import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:myfirstproject/ViewModels/vehicleviewmodel.dart';
import 'package:myfirstproject/common/constants.dart';
import 'package:myfirstproject/payment.dart';
import 'package:provider/provider.dart';

class OrderConfirm extends StatefulWidget
{
@override
OrderConfirmState createState() => OrderConfirmState();

}


class OrderConfirmState extends State<OrderConfirm>
{
Set<Polyline> _polylines = {};
@override
Widget build(BuildContext context) {
Widget _buildGoogleMap() {
List<LatLng> polylineCoordinates = []; // Define this list to store coordinates of the polyline
// Add source and destination coordinates to polylineCoordinates list
polylineCoordinates.add(LatLng(21.1702, 72.8311)); // Replace sourceLatitude and sourceLongitude with actual values
polylineCoordinates.add(LatLng(25.4358, 81.8463)); // Replace destinationLatitude and destinationLongitude with actual values

Polyline polyline = Polyline(
polylineId: PolylineId("poly"),
color: Colors.red, // Change the color of the polyline as needed
points: polylineCoordinates,
width: 3, // Change the width of the polyline as needed
);

setState(() {
_polylines.add(polyline); // Add the polyline to _polylines set
});

return Container(
height: 250,
decoration: BoxDecoration(
border: Border.all(color: Color(0XffF0F4F7)),
color: SecondaryColor,
borderRadius: BorderRadius.circular(10.0),
),
child: GoogleMap(
initialCameraPosition: CameraPosition(target: LatLng(21.1702, 72.8311 ), zoom: 12),
polylines: _polylines,
),
);
}

return Scaffold(
body: Container(child:
Column(children: [
Container(
decoration: BoxDecoration(
color: GhostWhite, // Change the background color to black or any other darker color
),
height: 100,
width: double.infinity,
child: Center(
child: Text(
'Driver will arrive in 5 minutes',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: Colors.black, // Change the text color to white or any other contrasting color
),
),
),
),

Padding(
padding: const EdgeInsets.all(20.0),
child: Column(children: [
Container( decoration: BoxDecoration(border: Border.all(color: Color(0XffF0F4F7)), color: SecondaryColor, borderRadius: BorderRadius.circular(10.0)),
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Column(
children: [Material(child: Container(child: TextField(decoration: InputDecoration(hintText: 'Pick up', labelText: 'Mall living world, Exit Gate',filled: true, fillColor: SecondaryColor),))),
Material(child: Container(child: TextField(decoration: InputDecoration(hintText: 'Drop off', labelText: 'Pasar Bush, Meat Spot',filled: true, fillColor: SecondaryColor),))),
],
),
)
,
),
SizedBox(height: 10,),
_buildGoogleMap(),
SizedBox(height: 10,),
Container(decoration: BoxDecoration(border:Border.all(width: 1.0,color: RegentGray ),borderRadius: BorderRadius.circular(10)),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(children: [
IconButton(onPressed: (){}, icon: Icon(FontAwesomeIcons.user), ),
Column(crossAxisAlignment: CrossAxisAlignment.start,mainAxisAlignment: MainAxisAlignment.start, children: [
Text('Ashley Young',style: TextStyle(fontWeight: FontWeight.bold),),
Text('Driver',style: TextStyle(fontSize: 10, color: Colors.grey),),
],),
Expanded( child: Align(alignment: Alignment.centerRight, child: Text('4.0 *')))
],),
),),
SizedBox(height: 10,),
Container(decoration: BoxDecoration(border:Border.all(width: 1.0,color: RegentGray ),borderRadius: BorderRadius.circular(10)),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(children: [
IconButton(onPressed: (){}, icon: Icon(FontAwesomeIcons.car), ),
Column(crossAxisAlignment: CrossAxisAlignment.start,mainAxisAlignment: MainAxisAlignment.start, children: [
Text('Honda Brio',style: TextStyle(fontWeight: FontWeight.bold),),
Text('Standard Car',style: TextStyle(fontSize: 10, color: Colors.grey),),
],),
Expanded(
child: Align(alignment: Alignment.centerRight,
child: Column(
children: [
Text('XY23X5'),
Text('License Plate No')
],
),
),
)

],),
),),
SizedBox(height: 50,),
Container(
child: Row(
children: [
Container(decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Navy),
child: IconButton(onPressed: (){}, icon: Icon(FontAwesomeIcons.phone),color: Colors.white,),
),
SizedBox(width: 40,),
Container(
child: Row(
children: [
Text('Send the Chat to driver'),
SizedBox(width: 40,),
IconButton(onPressed: (){}, icon: Icon(FontAwesomeIcons.solidMessage),color: PrimaryColor,),
],
),


),
],
),
)
],),
)
],)
,),
);
}

}

Comments

Popular posts from this blog

Push Notifications in .NET MAUI: A Comprehensive Guide

Explore the UI libraries available for .NET MAUI at no cost.

Push Notification using Firebase in xamarin form (Android and IOS)