gp_design
Colección de widgets, temas y utilidades responsivas listas para acelerar la construcción de productos con el sistema de diseño de GP. Incluye componentes de UI, helpers de red con dio y tokens reutilizables de tipografía, espaciado y color.
Características
- 🎨 Tema consistente:
GpTheme,GpColors,GpSpacing,GpTextSizeyGpBorderRadiusgarantizan que todo el UI respete el mismo lenguaje visual. - 🧱 Componentes reutilizables: botones, inputs, listas, diálogos, app bars, loaders, skeletons y más.
- 📐 Layout responsive:
GpResponsive,GpRowyGpColofrecen un grid fluido de 4/8/12 columnas según el dispositivo. - 🔒 Infraestructura HTTP: interceptores para manejo de errores y token Bearer usando
dio. - ⚙️ Extensible: cada widget expone overrides para colores, tamaños y estilos.
Instalación
Agrega la dependencia en tu pubspec.yaml:
dependencies:
gp_design: ^0.1.0
Importa el paquete en tu código:
import 'package:gp_design/gp_design.dart';
Uso rápido
MaterialApp(
theme: GpTheme.light(context),
darkTheme: GpTheme.dark(context),
home: Scaffold(
appBar: const GpAppBar(title: 'GP Design'),
body: Padding(
padding: const EdgeInsets.all(16),
child: GpRow(
gutter: 16,
children: const [
GpCol(span: 4, child: GpButton(text: 'Primario', onPressed: null)),
GpCol(span: 4, child: GpListTile(title: 'Elemento', subtitle: 'Detalle')),
GpCol(span: 4, child: GpAlertDialog(title: 'Éxito', message: 'Todo OK')),
],
),
),
),
);
Más ejemplos se encuentran en /example.
Componentes incluidos
- Widgets:
GpButton,GpIconButton,GpInput,GpCheckbox,GpListTile,GpAlertDialog, loaders, tabs, cards y más (ver exports enlib/gp_design.dart). - Tipografía:
GpTextcentraliza estilos y asegura accesibilidad. - Responsive:
GpRowdivide el ancho disponible en columnas con gutters configurables. - Red HTTP:
ErrorInterceptortransforma los errores deDioenGpExceptioncon mensajes pensados para UI yAuthInterceptoragrega tokens Bearer automáticamente.
Interceptores de ejemplo
final dio = Dio()
..interceptors.addAll([
AuthInterceptor(() async => 'token-123'),
ErrorInterceptor(),
]);
Contribuciones y soporte
- Haz un fork y crea una rama descriptiva.
- Ejecuta
dart format,dart analyzeyflutter test. - Abre un pull request con contexto y screenshots si aplica.
Para reportar bugs o solicitar componentes abre un issue en GitHub. Cualquier aporte es bienvenido.
Libraries
- gp_design
- infraestructure/http/gp_api_response
- infraestructure/http/gp_exceptions
- infraestructure/http/gp_http_client
- infraestructure/http/gp_interceptors
- infraestructure/http/gp_service
- responsive/gp_responsive
- responsive/gp_row
- theme/gp_colors
- theme/gp_radius
- theme/gp_spacing
- theme/gp_text_size
- theme/gp_theme
- widgets/app_bar/gp_app_bar
- widgets/border/gp_border
- widgets/card/gp_card
- widgets/card/gp_new_card
- widgets/date/gp_date
- widgets/date/gp_time_picker
- widgets/drawer/gp_drawer
- widgets/dropdown/gp_dropdown
- widgets/image/adaptive_network_icon
- widgets/inputs/gp_badge
- widgets/inputs/gp_checkbox
- widgets/inputs/gp_choice
- widgets/inputs/gp_counter
- widgets/inputs/gp_input
- widgets/inputs/gp_input_dopdown
- widgets/inputs/gp_phone_input
- widgets/inputs/gp_radio
- widgets/inputs/gp_switch
- widgets/inputs/gp_tooltip
- widgets/list_tile/gp_list_tile
- widgets/loader/gp_bar_loader
- widgets/loader/gp_loader
- widgets/modal/dialogs/gp_alert_dialog
- widgets/modal/dialogs/gp_confirm_dialog
- widgets/modal/gp_modal
- widgets/skeleton/gp_skeleton
- widgets/tab_bar/gp_tab_bar
- widgets/typography/gp_text