Skip to main content

Overview

The Restaurant Details screen (PantallaRestaurante) provides comprehensive information about a selected restaurant, including its story, specialties, and quick access to key features like making reservations. Source: lib/presentacion/pantalla_restaurante/pantalla_restaurante_screen.dart

Accessing Restaurant Details

Navigate to this screen by:
  1. Selecting a restaurant from the home screen
  2. Using the /restaurante route with a negocioId parameter
context.go('/restaurante', extra: negocioId);

Screen Sections

Restaurant Header

Displays essential restaurant information:
  • Name: Restaurant business name
  • Icon: Visual identifier (circular icon)
  • Specialty: Type of cuisine or category
  • Back Button: Returns to restaurant selection

Quick Action Menu

Provides fast access to main features through action cards:

Ver Historia

View the restaurant’s history and story

Disponibilidad

Check table availability and make reservations

Mis Reservas

View and manage your existing reservations

Información

View detailed restaurant information

Restaurant Information Section

Basic Details

The information card displays:
final negocio = state.negocio;

// Displayed information:
- Name: negocio.nombre
- Specialty: negocio.especialidad
- Address: negocio.direccion
- Phone: negocio.telefono
- Email: negocio.email
- Description: negocio.descripcion

Contact Information

  • Phone Number: Tappable link to call the restaurant
  • Email: Tappable link to send an email
  • Address: Full street address for navigation

State Management

Uses PantallaRestauranteCubit to manage restaurant data loading. Source: lib/presentacion/pantalla_restaurante/pantalla_restaurante_cubit.dart

States

// Initial state
class PantallaRestauranteInicial extends PantallaRestauranteState {}

// Loading restaurant data
class PantallaRestauranteCargando extends PantallaRestauranteState {}

// Successfully loaded
class PantallaRestauranteExitoso extends PantallaRestauranteState {
  final Negocio negocio;
}

// Error loading data
class PantallaRestauranteConError extends PantallaRestauranteState {
  final String mensaje;
}

Loading Restaurant Data

When the screen initializes:
final cubit = PantallaRestauranteCubit();
cubit.cargarDatosNegocio(negocioId: negocioId);
This fetches the restaurant details from Firestore via NegocioRepositorio.

User Actions

Tapping the “Disponibilidad” card navigates to the availability screen:
context.go('/disponibilidad', extra: idNegocioActual);

View Restaurant History

Tapping “Ver Historia” navigates to the history screen:
context.go('/historia', extra: idNegocioActual);

View My Reservations

Tapping “Mis Reservas” navigates to reservations:
context.go('/mis-reservas', extra: idNegocioActual);
GoRoute(
  path: '/restaurante',
  name: 'restaurante',
  builder: (context, state) {
    final negocioId = state.extra as String?;
    return PantallaRestauranteScreen(negocioId: negocioId);
  },
)

UI Components

Custom Widgets

  • IconoCircular: Displays restaurant icon in a circular frame
  • Action Cards: Material Design elevated buttons with icons
  • Information Card: Collapsible section with full restaurant details

Layout Structure

AppBar (with back button)
└── ScrollView
    ├── Restaurant Header (Icon + Name + Specialty)
    ├── Action Menu Grid (2x2 cards)
    └── Information Card (expandable)

Data Flow

1

Initialize Screen

Screen receives negocioId parameter
2

Load Data

Cubit fetches restaurant from Firestore
3

Display Information

UI rebuilds with restaurant data
4

Enable Actions

All navigation buttons become active

Error Handling

If the restaurant data fails to load:
if (state is PantallaRestauranteConError) {
  // Shows error message
  ScaffoldMessenger.of(context).showSnackBar(
    SnackBar(content: Text(state.mensaje))
  );
}
Default values are used until data loads:
  • Name: “Restaurante”
  • Specialty: “Gastronomía”

Integration with Other Features

Availability Check

Passes the negocioId to the availability screen for table search within this specific restaurant.

Reservation Management

Filters reservations to show only those for this restaurant.

Restaurant History

Loads and displays the custom history content configured by the restaurant owner.

See Also

Restaurant Selection

How to browse and select restaurants

Restaurant History

View restaurant story and specialties

Checking Availability

Find and book available tables

Negocio Entity

Restaurant data structure reference

Build docs developers (and LLMs) love