import 'package:car_for_her/config/palette.dart'; import 'package:car_for_her/widgets/client%20widgets/car_details_top_container.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; class CarDetails extends StatefulWidget { const CarDetails({Key key}) : super(key: key); @override _CarDetailsState createState() => _CarDetailsState(); } class _CarDetailsState extends State { bool isOverview=true; @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Color(0xffF0F9FA), body: Column( children: [ CarDetailsTopContainer(), Padding( padding: const EdgeInsets.only(top: 30,bottom: 5), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ GestureDetector( onTap:(){ setState(() { isOverview=true; }); }, child: Text("Overview",style: TextStyle( fontFamily: isOverview? 'MontHeavy':'MontExtraLight', color: isOverview? Colors.black:Colors.grey, fontWeight: isOverview? FontWeight.normal:FontWeight.normal ),), ), SizedBox( width: 50, ), GestureDetector( onTap:(){ setState(() { isOverview=false; }); }, child: Text("Driver information",style: TextStyle( fontFamily: !isOverview? 'MontHeavy':'MontExtraLight', color: !isOverview? Colors.black:Colors.grey, fontWeight: !isOverview? FontWeight.normal:FontWeight.normal ),), ), ], ), ), Divider( thickness: 1, ), Padding( padding: const EdgeInsets.fromLTRB(40,10,40,25), child: isOverview? Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text("Van",style: TextStyle( fontFamily: 'MontHeavy', fontSize: 27 ),), SvgPicture.asset('assets/icons/rating',height: 10,) ], ), SizedBox( height: 10, ), Row( children: [ SvgPicture.asset('assets/icons/location.svg',height: 18,), SizedBox( width: 10, ), Text("Qatar",style: TextStyle( fontFamily: 'MontExtraLight', fontWeight: FontWeight.bold ),) ], ), SizedBox( height: 15, ), Row( children: [ SvgPicture.asset('assets/icons/avatar.svg',height: 18,), SizedBox( width: 5, ), Text("Up to 5 passengers",style: TextStyle( fontFamily: 'MontExtraLight', fontWeight: FontWeight.bold ),), ], ), SizedBox( height: 15, ), Row( children: [ SvgPicture.asset('assets/icons/door.svg',height: 14,), SizedBox( width: 5, ), Text("4 doors",style: TextStyle( fontFamily: 'MontExtraLight', fontWeight: FontWeight.bold ),), ], ), SizedBox( height: 10, ), Text("quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commuptate velit esse dolore eu fugiat nulla parid est laborum" ,textAlign: TextAlign.justify ,style: TextStyle( fontFamily: 'MontExtraLight', fontWeight: FontWeight.bold, height: 1.8, color: Color.fromRGBO(0, 0, 0, 0.6) ),), SizedBox( height: 20, ), ], ) : Column( children: [ CircleAvatar( radius:50, foregroundImage: AssetImage("assets/images/avatar.png"), ), SizedBox( height: 15, ), Text("Name of the driver"), SizedBox( height: 5, ), SvgPicture.asset("assets/icons/rating"), SizedBox( height: 5, ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ SvgPicture.asset('assets/icons/location.svg',height: 15,), SizedBox( width: 5, ), Text("Qatar",style: TextStyle( fontFamily: 'MontExtraLight', fontWeight: FontWeight.bold ),), ], ), SizedBox( height: 15, ), Text("quis nostrud exercitation ullamco nisi ut ex e eu fugiat nulla parid est laborum" ,textAlign: TextAlign.center ,style: TextStyle( fontFamily: 'MontExtraLight', fontWeight: FontWeight.bold, height: 1.8, color: Color.fromRGBO(0, 0, 0, 0.6) ),), SizedBox( height: 25, ), Padding( padding: const EdgeInsets.symmetric(horizontal: 50), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ SvgPicture.asset( "assets/icons/car_details/disabled-sign.svg",), SvgPicture.asset( "assets/icons/car_details/fast-food.svg", ), SvgPicture.asset( "assets/icons/car_details/package.svg", ), SvgPicture.asset( "assets/icons/car_details/paw.svg", ), SvgPicture.asset( "assets/icons/car_details/baby.svg", ), ], ), ), ], ), ), /** ********************Buttons**************************** **/ Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Container( height:30, width: 85, decoration: BoxDecoration(color:Color(0xffF0F9FA),border: Border.all(color:Colors.grey)), child: Center(child: Text('Cancel',style: TextStyle(color: Colors.black,fontFamily: 'MontExtraLight',fontWeight: FontWeight.bold ,fontSize: 10),)), ), SizedBox( width: 20, ), Container( height:30, width: 85, decoration: BoxDecoration(color: Palette.primary,border: Border.all(color:Palette.primary)), child: Center(child: Text('Rent now',style: TextStyle(color: Colors.white,fontFamily: 'MontExtraLight',fontWeight: FontWeight.bold ,fontSize: 10),)), ), ], ), ], ) ); } }