Skip to main content
RapidDev - Software Development Agency
flutterflow-tutorials

How to Integrate a Booking System for Hotels or Rentals in FlutterFlow

Build a date-range booking system with a properties collection (name, images, pricePerNight, amenities) and a reservations collection (propertyId, checkIn, checkOut, totalNights, totalPrice, status). Two DateTimePicker widgets select check-in and check-out dates. An availability check queries existing reservations using the overlap formula: existingCheckIn < requestedCheckOut AND existingCheckOut > requestedCheckIn. A Custom Function calculates the total price from nights times nightly rate plus fees. The confirmation page summarizes the booking with a cancellation policy display.

What you'll learn

  • How to model properties and reservations with date-range booking in Firestore
  • How to check availability using the date overlap formula
  • How to calculate total price from nightly rate, cleaning fee, and taxes
  • How to build a reservation flow with confirmation and cancellation
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner8 min read25-30 minFlutterFlow Free+March 2026RapidDev Engineering Team
TL;DR

Build a date-range booking system with a properties collection (name, images, pricePerNight, amenities) and a reservations collection (propertyId, checkIn, checkOut, totalNights, totalPrice, status). Two DateTimePicker widgets select check-in and check-out dates. An availability check queries existing reservations using the overlap formula: existingCheckIn < requestedCheckOut AND existingCheckOut > requestedCheckIn. A Custom Function calculates the total price from nights times nightly rate plus fees. The confirmation page summarizes the booking with a cancellation policy display.

Building a Hotel or Rental Booking System in FlutterFlow

Date-range booking is the foundation of any hotel, vacation rental, or property management app. This tutorial builds the complete flow: property browsing, date selection, availability verification using the overlap formula, dynamic price calculation, booking confirmation, and cancellation handling. It applies to hotels, Airbnb-style rentals, vacation homes, or any multi-night accommodation system.

Prerequisites

  • A FlutterFlow project with Firebase Authentication enabled
  • Firestore database set up in your Firebase project
  • Basic understanding of FlutterFlow DateTimePicker, Backend Queries, and Custom Functions
  • Familiarity with Firestore date range queries

Step-by-step guide

1

Create the properties and reservations Firestore schema

Create a properties collection with fields: name (String), description (String), images (List of Strings, URLs), pricePerNight (Double), cleaningFee (Double), taxRate (Double, e.g., 0.12 for 12%), amenities (List of Strings), location (String), maxGuests (Integer), bedrooms (Integer), bathrooms (Integer), and hostId (String). Create a reservations collection with fields: propertyId (String), userId (String), checkIn (Timestamp), checkOut (Timestamp), totalNights (Integer), totalPrice (Double), guests (Integer), status (String: 'confirmed', 'cancelled', 'completed'), specialRequests (String), and createdAt (Timestamp).

Expected result: Firestore has properties and reservations collections with all fields needed for date-range booking and price calculation.

2

Build the property listing and detail pages

Create a PropertyList page with a ListView querying the properties collection. Each card shows the first image, name, location, price per night, and a star rating. Add filter controls: a Slider for max price, a DropDown for number of bedrooms, and a TextField for location search. Create a PropertyDetail page receiving a propertyId parameter. Display an image gallery using a PageView with dot indicators, the property name and location, a price per night badge, the amenities as Wrap Chips, description text, and host information. Below the details, add a 'Check Availability' section with booking controls.

Expected result: Users browse properties in a filterable list and tap to see detailed property pages with image galleries, amenities, and pricing.

3

Add date range selection and availability checking

In the Check Availability section, add two DateTimePicker widgets: one for check-in and one for check-out. Set the check-in minimum date to today and the check-out minimum date to check-in + 1 day. When both dates are selected, add a Backend Query that checks for conflicting reservations: query reservations where propertyId matches AND status is not 'cancelled' AND checkIn is less than the requested checkOut AND checkOut is greater than the requested checkIn. This is the date overlap formula. If the query returns any results, show 'Dates unavailable' in red. If empty, show 'Available!' in green with the booking button enabled.

Expected result: Users select check-in and check-out dates. The system queries for overlapping reservations and shows availability status in real time.

4

Calculate total price with nightly rate, cleaning fee, and taxes

Create a Custom Function called calculateBookingPrice that takes checkIn (DateTime), checkOut (DateTime), pricePerNight (Double), cleaningFee (Double), and taxRate (Double). Calculate totalNights as the difference in days between checkOut and checkIn. Calculate subtotal as totalNights * pricePerNight. Calculate tax as (subtotal + cleaningFee) * taxRate. Return a Map with totalNights, subtotal, cleaningFee, tax, and grandTotal. Display the price breakdown on the PropertyDetail page below the availability check: nightly rate x nights, cleaning fee, taxes, and a bold grand total. Update the breakdown dynamically when dates change.

Expected result: A price breakdown shows the nightly rate multiplied by nights, plus cleaning fee and taxes, with a clear grand total.

5

Create the booking confirmation flow

When the user taps 'Book Now' on an available property, navigate to a BookingConfirmation page passing propertyId, checkIn, checkOut, totalPrice, and guests. Display a summary: property name and image, dates, guests, price breakdown, and a cancellation policy (e.g., 'Free cancellation until 48 hours before check-in'). Add a specialRequests TextField for notes. Add a 'Confirm Booking' Button that creates a reservation document with status 'confirmed'. For paid bookings, integrate Stripe Checkout before creating the reservation. After confirmation, navigate to a BookingSuccess page with a summary and a 'View My Bookings' button.

Expected result: Users review booking details, confirm the reservation, and see a success page. The reservation document is created in Firestore.

6

Build the bookings management page with cancellation

Create a MyBookings page with a ListView querying reservations where userId equals the current user, ordered by checkIn descending. Display each booking as a card with the property image, name, dates, status badge (green for confirmed, red for cancelled, grey for completed), and total price. Add a Cancel button on confirmed bookings that are more than 48 hours from check-in. On cancel, update the reservation status to 'cancelled' via a Cloud Function that also handles any refund logic. Completed bookings show after the checkOut date passes, with a 'Leave Review' button.

Expected result: Users see all their bookings with status badges and can cancel upcoming reservations within the cancellation policy window.

Complete working example

FlutterFlow Action Flow
1// Hotel/Rental Booking System — Action Flow Summary
2
3// PROPERTY DETAIL PAGE:
4// Backend Query: properties/{propertyId}
5// Display: PageView images, name, location, pricePerNight,
6// amenities Wrap, description, host info
7
8// CHECK AVAILABILITY SECTION:
9// 1. DateTimePicker: checkIn (min: today)
10// 2. DateTimePicker: checkOut (min: checkIn + 1 day)
11// 3. On date change:
12// a. Backend Query: reservations
13// WHERE propertyId == current property
14// WHERE status != 'cancelled'
15// WHERE checkIn < requestedCheckOut
16// WHERE checkOut > requestedCheckIn
17// b. IF results.length > 0:
18// → Show Text 'Dates unavailable' (red)
19// → Disable Book Now button
20// c. ELSE:
21// → Show Text 'Available!' (green)
22// → Enable Book Now button
23// 4. Custom Function: calculateBookingPrice(
24// checkIn, checkOut, pricePerNight, cleaningFee, taxRate
25// )
26// → Returns: { totalNights, subtotal, cleaningFee, tax, grandTotal }
27// 5. Display price breakdown:
28// $pricePerNight x totalNights = $subtotal
29// Cleaning fee: $cleaningFee
30// Taxes (taxRate%): $tax
31// Total: $grandTotal
32
33// BOOK NOW BUTTON:
34// Navigate to BookingConfirmation page
35// Pass: propertyId, checkIn, checkOut, grandTotal, guests
36
37// BOOKING CONFIRMATION PAGE:
38// Display: property summary, dates, guests, price breakdown
39// TextField: specialRequests (optional)
40// Cancellation policy text
41// Confirm Booking button:
42// 1. Create Document: reservations → {
43// propertyId, userId: currentUser.uid,
44// checkIn, checkOut,
45// totalNights: calculated, totalPrice: grandTotal,
46// guests, status: 'confirmed',
47// specialRequests, createdAt: now
48// }
49// 2. Navigate to BookingSuccess (Replace Route)
50
51// MY BOOKINGS PAGE:
52// Backend Query: reservations WHERE userId == currentUser
53// ORDER BY checkIn DESC
54// Each card: property image, name, dates, status badge, price
55// Cancel button (if confirmed AND checkIn > now + 48h):
56// Update Document: status = 'cancelled'
57
58// DATE OVERLAP FORMULA (critical):
59// Conflict exists when:
60// existing.checkIn < requested.checkOut
61// AND existing.checkOut > requested.checkIn
62// This catches ALL overlap cases:
63// - Existing fully contains requested
64// - Requested fully contains existing
65// - Overlap at start
66// - Overlap at end

Common mistakes

Why it's a problem: Checking date overlap with simple equality instead of the range formula

How to avoid: Use the range overlap formula: existingCheckIn < requestedCheckOut AND existingCheckOut > requestedCheckIn. This catches all four overlap scenarios.

Why it's a problem: Not excluding cancelled reservations from availability checks

How to avoid: Add status != 'cancelled' (or status == 'confirmed') to the availability query filter.

Why it's a problem: Calculating total price on the client without a Custom Function

How to avoid: Centralize the calculation in a single Custom Function that returns a structured breakdown with consistent decimal rounding via toStringAsFixed(2).

Best practices

  • Always use the date overlap formula for availability: existingCheckIn < requestedCheckOut AND existingCheckOut > requestedCheckIn
  • Exclude cancelled reservations from availability queries
  • Show a clear price breakdown with nightly rate, fees, taxes, and grand total
  • Set minimum check-out date dynamically based on check-in selection (check-in + 1 day)
  • Display the cancellation policy prominently before the user confirms the booking
  • Send confirmation emails via Cloud Functions triggered on reservation creation
  • Use a transaction when creating the reservation to re-verify availability atomically and prevent double-bookings

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

I need to build a hotel booking system in FlutterFlow. Show me the Firestore schema for properties and reservations, the date overlap availability check query, and the Custom Function for calculating total price from nightly rate, cleaning fee, and tax rate.

FlutterFlow Prompt

Create a property detail page with an image gallery PageView, amenities list, and a Check Availability section. Add two DateTimePicker widgets for check-in and check-out dates, an availability query using the date overlap formula, and a price breakdown display with nightly rate, fees, and total.

Frequently asked questions

Can I use a date range picker widget instead of two separate DateTimePickers?

Yes. Create a Custom Widget using syncfusion_flutter_datepicker which supports range selection natively. It provides a more intuitive UX where users drag across a calendar to select their stay dates.

How do I handle seasonal pricing with different rates per date?

Create a pricing_periods collection with startDate, endDate, and pricePerNight. In the calculateBookingPrice function, iterate through each night of the stay and look up the applicable rate for that date.

Can I block specific dates when the property is unavailable for maintenance?

Yes. Create blocked_dates documents with propertyId, startDate, and endDate. Include these in your availability check alongside reservations to ensure maintenance windows block bookings.

How do I prevent double-bookings from two users booking simultaneously?

Use a Firestore transaction in a Cloud Function that re-checks availability before creating the reservation. If another booking was created between the user's availability check and confirmation, the transaction detects the conflict and rejects the booking.

Can I add a minimum stay requirement?

Yes. Add a minimumNights field to the property document. In the UI, validate that the selected date range meets or exceeds the minimum. Disable the Book Now button and show a message if the stay is too short.

Can RapidDev help build a complete property management platform?

Yes. RapidDev can implement a full booking system with channel management, dynamic pricing, host dashboards, guest communication, review systems, and integration with external booking platforms.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.