import 'package:car_for_her/config/palette.dart'; import 'package:car_for_her/models/Driver/trips.dart'; import 'package:car_for_her/widgets/driver%20widgets/trips_list.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; class DriverTrips extends StatefulWidget { const DriverTrips({Key key}) : super(key: key); @override _DriverTripsState createState() => _DriverTripsState(); } class _DriverTripsState extends State { String tripHistory; @override Widget build(BuildContext context) { return Scaffold( body: SafeArea( child: SingleChildScrollView( child: Container( child: Column( children: [ Padding( padding: const EdgeInsets.fromLTRB(30, 25, 0, 0), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ IconButton( onPressed: (){ Navigator.pop(context); }, icon: SvgPicture.asset("assets/icons/left_arrow.svg"),), SizedBox( width: 20, ), Text("My trips", style: TextStyle( fontFamily: 'MontHeavy', fontWeight: FontWeight.bold, fontSize: 31)), ], ), ), Padding( padding: const EdgeInsets.only(top:16.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ GestureDetector( onTap: (){ setState(() { tripHistory="today"; }); }, child: Text("Today",style: TextStyle(fontFamily: 'MontExtraLight',fontWeight: FontWeight.bold,fontSize: 14,color: Colors.black),)), GestureDetector( onTap: (){ setState(() { tripHistory="last week"; }); }, child: Text("Last week",style: TextStyle(fontFamily: 'MontExtraLight',fontWeight: FontWeight.bold,fontSize: 14,color: Colors.black),)), GestureDetector( onTap: (){ setState(() { tripHistory="last month"; }); }, child: Text("Last Month",style: TextStyle(fontFamily: 'MontExtraLight',fontWeight: FontWeight.bold,fontSize: 14,color: Colors.black),)), ], ), ), Divider( thickness: 1.5, ), /** ********************** Trip Lists ***************************** **/ Padding( padding: const EdgeInsets.fromLTRB(15, 24, 15, 10), child: ListView.builder( physics: NeverScrollableScrollPhysics(), shrinkWrap: true, itemCount: todayTrips.length, itemBuilder: (context,i)=>TripsList(i,tripHistory), ), ) ], ), ), ), ), ); } }