Skip to main content

Library Entrypoints

FD Components exposes several public library entrypoints. Most application screens should use the primary barrel, while narrower modules can import a smaller API surface.

Primary entrypoint: fdc.dart

import 'package:flutter_data_components/fdc.dart';

This is the standard application import. It exposes the public Community API for:

  • FdcApp, localization, formatting, focus, and themes,
  • datasets, fields, filters, sorting, searching, paging, and adapters,
  • data-aware editors,
  • grids and grid models,
  • export orchestration,
  • shared dialogs and common UI contracts.

For normal FDC application code, start here.

import 'package:flutter_data_components/fdc.dart';

final customers = FdcDataSet(
fields: const [
FdcIntegerField(name: 'customer_id', isKey: true),
FdcStringField(name: 'name', size: 120),
],
);

App configuration: fdc_app.dart

import 'package:flutter_data_components/fdc_app.dart';

Use this entrypoint when a module only needs application-level FDC configuration:

  • FdcApp,
  • format settings and resolvers,
  • localization delegates and translation bundles,
  • editor/grid theme types,
  • FDC focus configuration.

Typical use cases include an app shell package or a composition root that configures FDC but does not directly define datasets or grids.

Editors: fdc_edit.dart

import 'package:flutter_data_components/fdc_edit.dart';

This entrypoint exposes the editor package surface, including:

  • text, memo, integer, decimal, date, time, date-time, boolean, and combo editors,
  • lookup integration,
  • editor themes and styles,
  • editor event contracts,
  • shared validation and editor support types.

Use it for a feature that only renders FDC editors and does not need the grid or full dataset API surface from the main barrel.

Export: fdc_export.dart

import 'package:flutter_data_components/fdc_export.dart';

This entrypoint exposes export orchestration and extension contracts:

  • FdcExporter,
  • FdcExportFormat,
  • FdcExportOptions,
  • FdcExportScope,
  • FdcExportValueMode,
  • export payload/result models,
  • writer and writer-context contracts,
  • FdcExportRegistry,
  • export style contracts.

The Community package registers built-in CSV, JSON, and XML writers.

Example:

final result = await FdcExporter.exportDataSet(
orders,
format: FdcExportFormat.csv,
options: FdcExportOptions(
scope: FdcExportScope.currentView,
),
suggestedFileName: 'orders.csv',
);

The export barrel is useful in reporting or service layers that generate output without rendering FDC widgets.

See Export Overview for the complete pipeline, row scopes, grid integration, custom formats, and Pro writers.

Extension seam: fdc_ext.dart

import 'package:flutter_data_components/fdc_ext.dart';

fdc_ext.dart is different from the application barrels. It exposes the stable host-facing extension seam used by compatible add-on packages.

It contains selected contracts for areas such as:

  • grid controller features,
  • detail-row integration,
  • layout persistence integration,
  • range-selection integration,
  • menu entries,
  • prepared dataset search,
  • grid host/runtime extension hooks.

Application code should normally import fdc.dart, not fdc_ext.dart.

Use fdc_ext.dart only when implementing an extension package that integrates with those host contracts.

Which import should I use?

ScenarioRecommended import
Standard FDC application screenfdc.dart
App shell configuring locale/theme/focusfdc_app.dart
Editor-only feature modulefdc_edit.dart
Export/reporting-only modulefdc_export.dart
Add-on package integrating with extension hooksfdc_ext.dart

Do not import src/

Do not import package implementation files directly:

// Avoid
import 'package:flutter_data_components/src/...';

src/ is implementation detail. Public entrypoints define the supported API boundary and allow the package internals to evolve without breaking application imports.

Combining entrypoints

You can combine lightweight entrypoints when a module genuinely needs both surfaces:

import 'package:flutter_data_components/fdc_app.dart';
import 'package:flutter_data_components/fdc_edit.dart';

However, once a feature needs broad dataset and grid functionality, prefer the single primary import:

import 'package:flutter_data_components/fdc.dart';