flutter_crud_esquemas_dynamicos_mobile

A Flutter package for creating dynamic CRUD forms using configurable schemas. Provides a flexible and adaptable framework for different data types and structures, including a wizard for creating dynamic forms.

Features

  • Dynamic CRUD operations for configurable collections
  • Real-time form data management
  • Wizard for creating dynamic forms
  • BLoC pattern state management
  • OAuth2 authentication integration
  • Runtime code evaluation with dart_eval
  • Support for iOS and Android platforms

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  flutter_crud_esquemas_dynamicos_mobile: ^3.0.0

Then run:

flutter pub get

Project Structure

The project is organized as follows:

  • lib/: Contains the main Flutter application code.
    • main.dart: Application entry point.
    • bloc/: Handles business logic and state management.
      • config_columna/: Configures visible columns in tables.
      • dynamic_crud/: Dynamically manages CRUD operations for collections.
      • dynamic_crud_process_bloc/: Processes collection-related information.
      • info_ui_app/: Determines device type and adjusts UI.
      • navegacion/: Manages navigation between views.
      • socket/: Handles real-time communication via sockets.
      • stream_data/: Maintains and updates form data in real-time.
      • wizard/: Manages dynamic form creation through a wizard.
    • provider/: Contains data providers and business logic.
      • eval_provider.dart: Loads and executes eval code for form actions.
      • shortcuts_provider.dart: Centralizes key actions for views.
      • shp_dynamic_crud.dart: Stores column configuration and unread notifications.
    • router/: Contains application route configuration.
      • go_router_model.dart: Model for route configuration with GoRouter.
      • go_router.dart: Route configuration using GoRouter.
    • utils/: Contains utilities and helper functions.
    • view/: Contains application views.
      • authentication/: User authentication views.
      • code_pad/: Views for eval code editing and execution.
      • esquemas/: Views for schema management.
      • formularios_dinamicos/: Views for dynamic form creation and management.

Getting Started

Main Configuration

  • lstVistasSistema: List of type RouteItem containing a String field as key and another as description.
  • rootRoute: Application start route. After login or pressing the home button in the menu, it will navigate to this view.
  • clientId and clientSecret: Used for login and application authentication.
  • origenColeccion: Origin of the collections to be used in the application.
  • coleccionFuncionesBackend: Name of the collection where all functions (sync, async and atomic) used by the system are stored.
  • homePageBuilder: Widget that will always be visible in the system, mainly used to store the menu and other widgets that should not be redrawn every time you navigate between views.

Manual Route Configuration

To display a view designed from the project, first define that route to provide to MyAppDynamic. It receives a map that expects a String key as the route and a value that is a function with two parameters. The first is the context and the second is the GoRouter state, where you can get information passed in navigation between views.

Configure a Dynamic Form for System View

Access the dynamic forms section and create a new view. It is not necessary to select a related collection or load anything to the form, just save it. Complete with a name, description and select that the form type is system, choosing the item we just loaded in the NavegacionFunc.lstVistasSistema list.

Eval Code in Dynamic Fields

Dynamic forms have the ability to execute eval code at runtime (fields that listen to other fields and perform an action as soon as they change). They are visually configured in the configuration panel.

When making a change to a field, the configured eval method will be triggered.

Eval Code Return Syntax

  • Must always return a map; otherwise, the result will be ignored.
  • To overwrite a property configured in the collection schema, load a map with the camposEsquemas key and in its values a map with what you want to modify.

For widget properties, you need to specify the key and the corresponding data type value to modify it. You can see a complete list with all widget properties in formulario_dinamicos/model/environment_form.dart.

Default Values for Fields

There are 2 ways to set default values for dynamic form fields: definition in schema and definition in form.

Definition in Schema

To define a default value, go to collections -> collection schema -> properties and complete the default value field. Note: for date or dateTime type fields, it is not necessary to specify a default value, they are loaded automatically.

Definition in Dynamic Form

When defining a default value in the dynamic form, it will only apply to the form where it was defined, unlike the default value in the schema which applies to all forms that use that schema.

Steps:

  1. Generate an eval code for execution: Go to the eval codes section and generate an eval code according to the visual needs.

  2. Access the form to which you want to assign the eval code: Once in the form, configure the listening field properties and function to execute.

  • Campo de escucha (Listening field): Select which fields you want to listen to so that when their value changes, the configured eval code is triggered.
  • Funcion a ejecutar (Function to execute): Eval code to execute.

Platforms

This package supports:

  • Android
  • iOS

License

Copyright 2025 RobleSistemas

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Libraries

bloc/blocs_listeners
bloc/config_columna/config_columna_bloc
bloc/dynamic_crud/dynamic_crud_bloc
bloc/dynamic_crud_process_bloc/dynamic_crud_process_bloc
bloc/info_ui_app/info_ui_app_bloc
bloc/perfil_admin/perfil_admin_bloc
bloc/selector_archivo/descargar_archivos
bloc/selector_archivo/descargar_archivos_mobile
bloc/selector_archivo/descargar_archivos_web
bloc/selector_archivo/selector_archivo_bloc
bloc/socket/socket_bloc
bloc/socket_web/w_socket_bloc
bloc/stream_data/stream_data_bloc
bloc/ubicacion/ubicacion_bloc
bloc/visualizador/visualizador_bloc
bloc/wizard/wizard_bloc
flutter_crud_esquemas_dynamicos_mobile
A Flutter package for creating dynamic CRUD forms using configurable schemas.
global/environment
global/theme
init_config
main
provider/code_implement/auth_utils
provider/code_implement/esquema_utils
provider/code_implement/http_request
provider/code_implement/validacion
provider/code_implement/validacion_key_desarrollo
provider/eval_provider
provider/shortcuts_provider
provider/shp_dynamic_crud
router/go_router
router/go_router_model
test_fede/test_info_producto
test_fede/test_info_transaccion
utils/color_utils
utils/custom_focus_policy
utils/measure_size
utils/tablas_utils
utils/utils_esquemas
utils/utils_ui
view/authentication/login_mobile
view/authentication/login_page
view/authentication/login_view
view/authentication/login_view_nuevo
view/code_pad/code_utils
view/ficha_view
view/formulario_dinamico/admin_formulario
view/formulario_dinamico/arbol_widgets
view/formulario_dinamico/formulario_dinamico_view
view/formulario_dinamico/grupos/model/grupo_model
view/formulario_dinamico/model/archivo_model
view/formulario_dinamico/model/column_widget_model
view/formulario_dinamico/model/custom_widget_builder
view/formulario_dinamico/model/custom_widget_model
view/formulario_dinamico/model/data_widget_model
view/formulario_dinamico/model/enums
view/formulario_dinamico/model/environment_form
view/formulario_dinamico/model/expancion_panel_widget_model
view/formulario_dinamico/model/icono_widget_model
view/formulario_dinamico/model/label_widget_model
view/formulario_dinamico/model/row_widget_model
view/formulario_dinamico/model/stepper_widget_model
view/formulario_dinamico/model/widget_model
view/formulario_dinamico/model/wrap_widget_model
view/formulario_dinamico/widgets/array_object
view/formulario_dinamico/widgets/build_widget
view/formulario_dinamico/widgets/campo_selector_archivo
view/formulario_dinamico/widgets/campo_ubicacion
view/formulario_dinamico/widgets/check_animation
view/formulario_dinamico/widgets/expancion_widget
view/formulario_dinamico/widgets/mover_wrapper
view/formulario_dinamico/widgets/widget_column
view/formulario_dinamico/widgets/widget_custom
view/formulario_dinamico/widgets/widget_data
view/formulario_dinamico/widgets/widget_expancion_panel
view/formulario_dinamico/widgets/widget_icon
view/formulario_dinamico/widgets/widget_label
view/formulario_dinamico/widgets/widget_row
view/formulario_dinamico/widgets/widget_stepper
view/formulario_dinamico/widgets/widget_wrap
view/home_page
view/inicio/inicio
view/inicio/items_from_modulos/items_from_modulos_view
view/loading_view
view/page_formularios
view/tabla_view
widgets/button_widget
widgets/camara_view
widgets/campo_lista_widget
widgets/campo_listen_stream_value
widgets/clip_widget
widgets/container_punteado
widgets/custom_button
widgets/custom_scroll_behavior
widgets/custom_text_widget
widgets/dropdow_seleccion_simple_widget
widgets/dynamic_list_widget
widgets/estado_auditoria_boton
widgets/field_search_widget/field_search_widget
widgets/indices_widget
widgets/models/esquema_model
widgets/notificaciones_widget_view
widgets/pull_to_load_more
widgets/shimmer_loading
widgets/swich_widget_in_dynamic_form
widgets/tabla/opciones_item_tabla
widgets/tabla/tabla
widgets/tabla/tabla_multi_seleccion
widgets/textfield_busqueda/bloc/textfield_busqueda_bloc
widgets/textfield_busqueda/textfield_busqueda
widgets/textfield_widget_busqueda_in_dynamic_form
widgets/textfield_widget_in_dynamic_form
widgets/visualizador/dialogo_visualizacion
widgets/visualizador/pdf_view
widgets/visualizador/visualizador_imagen
widgets/widget_from_screen
widgets/widget_marca_obligatorio
widgets/widget_personalizado
widgets/widget_text