Skip to content

Commit

Permalink
Merge pull request #107 from mdnazisharman2803/CarBookingDetailsScreen
Browse files Browse the repository at this point in the history
Car booking details screen
  • Loading branch information
Jaideep25-tech authored May 30, 2022
2 parents afc2cf1 + b5679db commit 4bab812
Show file tree
Hide file tree
Showing 4 changed files with 319 additions and 0 deletions.
Binary file added car_booking/assets/images/map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions car_booking/lib/screens/detail/car_detail_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

import 'package:flutter/material.dart';

import '../../model/car.dart';
import 'widget/car_detail_infomation.dart';
import 'widget/my_appbar.dart';

class CarDetailScreen extends StatelessWidget {
final Car car;

CarDetailScreen(this.car);

@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: Stack(
children: [
Image.asset(
'assets/images/map.png',
width: double.infinity,
fit: BoxFit.fill,
),
MyAppbar(),
Positioned(
left: 24,
right: 24,
bottom: 24,
child: Stack(
children: [
CarDetailInfomation(car: car),
Positioned(
right: 16,
child: Image.asset(
car.image,
height: 100,
),
)
],
),
),
],
),
),
);
}
}

232 changes: 232 additions & 0 deletions car_booking/lib/screens/detail/widget/car_detail_infomation.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@

import 'package:flutter/material.dart';

import '../../../constants.dart';
import '../../../model/car.dart';
import '../../../widget/attribute.dart';
import '../../../widget/rating_bar.dart';

class CarDetailInfomation extends StatelessWidget {
const CarDetailInfomation({

required this.car,
}) ;

final Car car;

@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(16),
margin: EdgeInsets.only(top: 50),
decoration: BoxDecoration(
color:Colors.white, borderRadius: BorderRadius.circular(16)),
child: Column(
children: [
CarInfo(car: car),
Divider(
height: 16,
color: Colors.black54,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
'assets/images/av.png',
height: 120,
),
SizedBox(
width: 16,
),
Expanded(
child: Column(
children: [
DriverInfo(),
SizedBox(
height: 12,
),
DiverAppraise(),
SizedBox(
height: 12,
),
DriverCall(),
],
),
)
],
)
],
),
);
}
}

class DriverCall extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
FlatButton(
onPressed: () {},
color: mCardColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(36),
),
child: Text(
'Call',
style: TextStyle(
color: Colors.white,
),
),
),
FlatButton(
onPressed: () {},
color: mCardColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(36),
),
child: Text(
'Book Now',
style: TextStyle(
color: Colors.white,
),
),
)
],
);
}
}

class DiverAppraise extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Row(
children: [
Text(
'5.0',
style: TextStyle(),
),
SizedBox(
width: 6,
),
RatingBar(
onRatingUpdate: (value) {},
size: 14,
selectColor: Colors.yellow, padding: 0.0,
),
],
);
}
}

class DriverInfo extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Jesica Smith',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
Text(
'License NWR 369852',
style: TextStyle(
fontSize: 10,
),
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'369',
style: TextStyle(
fontSize: 16,
color: Colors.black,
fontWeight: FontWeight.w500,
),
),
Text(
'Ride',
style: TextStyle(
fontSize: 10,
),
),
],
)
],
);
}
}

class CarInfo extends StatelessWidget {
const CarInfo({

required this.car,
}) ;

final Car car;

@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'\$${car.price}',
style: TextStyle(
color: Colors.yellow,
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
Text(
'price/hr',
style: TextStyle(
color: Colors.yellow,
),
),
SizedBox(
height: 16,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Attribute(
value: car.brand,
name: 'Brand',
textColor: Colors.black87,
),
Attribute(
value: car.model,
name: 'Model No',
textColor: Colors.black87,
),
Attribute(
value: car.co2,
name: 'CO2',
textColor: Colors.black87,
),
Attribute(
value: car.fuelCons,
name: 'Fule Cons.',
textColor: Colors.black87,
),
],
)
],
);
}
}
39 changes: 39 additions & 0 deletions car_booking/lib/screens/detail/widget/my_appbar.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import 'package:flutter/material.dart';

class MyAppbar extends StatelessWidget {

@override
Widget build(BuildContext context) {
return SafeArea(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
icon: Icon(
Icons.arrow_back_ios,
color: Colors.white,
),
onPressed: () {
Navigator.pop(context);
},
),
Text(
'Car Detail',
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
IconButton(
icon: Icon(
Icons.menu,
color: Colors.white,
),
onPressed: () {},
),
],
),
);
}
}

0 comments on commit 4bab812

Please sign in to comment.