Taxi Booking in Flutter - AreaSpot_Card dart file

 Create a file named as 'areaspot_card.dart' in lib -> cards folder and paste following code:


Create a Taxi Booking Project in flutter

Please, support my blog by clicking on our sponsors ad!



import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:myfirstproject/models/locationmodel.dart';
import 'package:myfirstproject/common/constants.dart';

class AreaSpotCard extends StatelessWidget
{
  late final LocationModel locationModel;
  AreaSpotCard({required this.locationModel});

  @override
  Widget build(BuildContext context) {
  return Card(color: SecondaryColor,elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0)), child: Padding(
    padding: const EdgeInsets.only(top:  20.0,left: 20.0,right: 20.0,bottom: 0.0),
    child: Container(decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20)),
      child: Padding(
        padding: const EdgeInsets.all(20.0),
        child: Column( crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text(locationModel.Name, style: TextStyle(fontWeight: FontWeight.bold, color:RegentGray),),
            Row(mainAxisAlignment: MainAxisAlignment.start,
              children: [
                IconButton( onPressed: (){},  icon: Icon(FontAwesomeIcons.mapMarked), color:PrimaryColor ,),
                Text(locationModel.Distance,style: TextStyle(color: RegentGray),)
              ],
            ),
            Text(locationModel.Address, style: (TextStyle(color: RegentGray)),),
           SizedBox(height: 10),
            Text(locationModel.Spot1, style: (TextStyle(color: Colors.black)),),
            Divider(color: RegentGray,),
            Text(locationModel.Spot2, style: (TextStyle(color:  Colors.black)),),
            Divider(color: RegentGray,),
          ],
        ),
      ),
    ),
  ),);
  }
}
Go to Main project

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)