Skip to main content

Overview

The Restaurant Selection screen is the entry point to the reservation system. Here you can browse available restaurants, view their basic information, and choose where you’d like to make a reservation. Source: lib/presentacion/pantalla_inicio/pantalla_inicio_screen.dart

Accessing Restaurant Selection

When you open the application, you’ll automatically land on the restaurant selection screen at the / route.

Features

Browse Restaurants

The main screen displays a scrollable list of all registered restaurants in the system.

Restaurant Cards

Each restaurant is displayed in an interactive card with key information

Quick Navigation

Tap any restaurant card to view details or make a reservation

Restaurant Card Information

Each restaurant card displays:
  • Restaurant Name: The business name
  • Icon: Visual identifier for the restaurant
  • Specialty: Type of cuisine or restaurant category
  • Description: Brief overview of the restaurant

Business Owner Access

At the top of the screen, there’s a “¿Tienes un negocio?” (Do you have a business?) button that provides access to:
1

Register New Business

Opens a registration wizard for new restaurant owners
2

Login to Existing Business

Direct login for existing business owners to access their admin panel

State Management

The screen uses PantallaInicioCubit to manage the restaurant listing state. Source: lib/presentacion/pantalla_inicio/pantalla_inicio_cubit.dart

States

// Initial state when screen loads
class PantallaInicioInicial extends PantallaInicioState {}

// Loading restaurants from Firestore
class PantallaInicioCargando extends PantallaInicioState {}

// Successfully loaded restaurants
class PantallaInicioExitoso extends PantallaInicioState {
  final List<Negocio> negocios;
}

// Error loading restaurants
class PantallaInicioConError extends PantallaInicioState {
  final String mensaje;
}

Loading Restaurants

When the screen initializes, it loads all available restaurants:
final cubit = getIt<PantallaInicioCubit>();
cubit.cargarNegocios(); // Loads all restaurants from Firestore

User Flow

1

Open Application

The app opens to the restaurant selection screen
2

View Restaurant List

Browse through available restaurants displayed as cards
3

Select Restaurant

Tap a restaurant card to proceed
4

Navigate to Details

Automatically redirects to the restaurant details screen

Business Owner Registration

Business owners can register a new restaurant through the registration wizard:
  1. Business Information: Name, contact details, address
  2. Authentication Setup: Email and password configuration
  3. Restaurant Details: Specialty, description, operating hours
  4. Initial Configuration: Default settings and preferences
The registration flow uses the RegistroNegocioStepper widget component. Source: lib/presentacion/widgets_comunes/registro_negocio_stepper.dart
GoRoute(
  path: '/',
  name: 'home',
  builder: (context, state) {
    return BlocProvider(
      create: (context) => getIt<PantallaInicioCubit>(),
      child: const PantallaInicioScreen(),
    );
  },
)

Integration Points

From Restaurant Selection

Users can navigate to:
  • Restaurant Details (/restaurante) - View detailed restaurant information
  • Business Admin Panel (/dueno) - For restaurant owners
  • Registration Flow - For new business owners

Data Source

Restaurants are loaded from the NegocioRepositorio:
final negocios = await negocioRepositorio.obtenerTodosLosNegocios();

UI Components

The screen uses several custom widgets:
  • IconoCircular - Displays restaurant icons in circular frames
  • RegistroNegocioStepper - Multi-step registration wizard
  • Material Design Cards - For restaurant listing

See Also

Restaurant Details

Learn about viewing restaurant information

Making Reservations

How to book a table once you’ve selected a restaurant

Business Registration

Complete guide for restaurant owners

PantallaInicioCubit

State management API reference

Build docs developers (and LLMs) love