ag_flow library
AG Flow — an opinionated Flutter framework.
See ag_framework.md, routes.md, and ag_endpoint_rules.md in the
repository's requirments/ directory for the binding specification
this library implements.
Classes
- AgApp
- The application root.
- AgArguments
- Resolves typed navigation arguments safely.
-
AgBaseController<
T> - Base class for every AG controller.
-
AgBasePage<
C extends AgBaseController> - Base class for a full-screen AG page.
- AgBaseRepo
- Base class for every AG repository.
- AgBaseService
- Base class for every AG service.
- AgBinding
- Registers a module's dependencies (Service → Repo → Controller) with AgLocator, scoped to the lifetime of the route that runs it.
- AgBuilder
- Rebuilds builder whenever listenable notifies.
- AgCancelToken
-
A handle for cancelling an in-flight
ApiProvider.sendcall —ApiProvider's own dio-free equivalent of dio'sCancelToken, so callers never need to importpackage:diothemselves just to cancel a request in flight. - AgCursorStrategy
- Cursor/token paging: the backend returns an opaque token for the next page, read from nextTokenKey beside the payload.
-
AgDetailController<
T, A extends Object> -
Base class for detail modules: an AgBaseController that also
resolves its typed navigation argument
A. - AgEmpty
- AG's default empty-state display.
- AgEndpoint
- A reusable, immutable API contract: a path template plus the HTTP method(s) it supports.
- AgEnvelope
- Where the actual payload sits inside a response body.
- AgError
- AG's default error display.
- AgFormFile
- A single form file to upload as part of a multipart AgRequest.
- AgGuard
- A single route guard — AG's hook for intercepting a navigation push before the destination page is built.
- AgHttpMethod
- An HTTP method.
- AgInitializable
-
Implemented by types AgLocator should notify immediately after
realizing them — from a
lazyPutfactory, or viaputdirectly. - AgInject
- Marks a controller or service class for static-accessor generation.
-
AgListBuilder<
ItemType, PageKeyType extends Object> - Renders a collection driven by an AgListController: item rendering, scrolling, and load-more.
-
AgListController<
ItemType, PageKeyType extends Object> - Base class for collection/list modules — combines AgBaseController with AgPaginationMixin.
-
AgListPage<
ItemType, PageKeyType> -
One page of items returned by
AgPaginationMixin.fetchPage. - AgLoading
- AG's default loading indicator.
- AgLocator
- A minimal, dependency-free service locator.
- AgLoggingInterceptor
-
Produces centralized
[API] METHOD path Status: code Duration: Xmslog lines for every request that passes throughApiProvider, masking configured sensitive header/body keys so they're never logged raw. - AgLogOptions
-
Configures
AgLoggingInterceptor's output and sensitive-value masking. - Context-less navigation, and the current route's parameters.
-
AgNextPage<
PageKeyType extends Object> - What comes after the page that was just fetched.
- AgNotifier
-
A ChangeNotifier whose notify method calls the otherwise-
@protectednotifyListeners publicly. - AgOffsetStrategy
-
Offset/limit paging:
?offset=0&limit=20. The page key is the offset, advancing by pageSize. -
AgPage<
T> - Composes a page (or a section of one) from an AgBaseController's AgPageState.
-
AgPageEmpty<
T> - The load succeeded but produced no data to show.
-
AgPageError<
T> -
The load failed. previousData preserves whatever was on screen before
the failing load/refresh, if any — a load-more or refresh failure is a
distinct concept and never reaches this state (see
AgPaginationState). -
AgPageInitial<
T> -
The state before the first
AgBaseController.loadInitialcall starts. -
AgPageLoading<
T> - The initial (first-page) load is in flight.
- AgPageNumberStrategy
-
Page-number paging:
?page=1&limit=20— the most common REST shape. -
AgPageState<
T> -
The state of a page (or a section of one) driven by an
AgBaseController. -
AgPageStrategy<
PageKeyType extends Object> - How a backend expresses pagination — the query parameters a page key becomes, and how to tell what comes next.
-
AgPageSuccess<
T> -
Data loaded successfully. isRefreshing is true while an
AgBaseController.refreshis in flight, so previously loaded data can stay on screen instead of being replaced by a loading indicator. -
AgPaginationState<
ItemType, PageKeyType extends Object> -
Pagination/load-more state owned by
AgPaginationMixin. - AgPathResolver
-
Resolves an
AgEndpoint's{token}path template against a set of path parameter values. - AgRequest
- A concrete, per-call request built from a reusable AgEndpoint.
-
AgResponse<
D> -
The result of a successful
ApiProvider.sendcall. - AgRetryInterceptor
-
Retries failed requests according to an AgRetryPolicy. Opt-in — only
added to
ApiProviderwhen a policy is supplied. - AgRetryPolicy
- Configures AgRetryInterceptor's retry behavior.
- AgRoute
- A single navigable route.
- AgRouteBase
-
Common supertype for the entries in
AgApp.routes. - AgShellRoute
- Wraps a group of routes in shared, persistent chrome — a bottom navigation bar, a side rail, a tabbed scaffold.
- AgSinglePageStrategy
- The backend returns the entire collection in one response and does not paginate. Sends no paging query parameters and always reports "no more pages".
- AgStateService
- Base class for app-wide state services that hold reactive state but do not make network calls (no ApiProvider dependency).
- ApiProvider
- The single, shared HTTP execution point for the whole application.
Enums
- AgTransition
- A route's push/pop transition animation.
Mixins
-
AgCrudService<
T, ID extends Object> -
Opt-in CRUD surface for AgBaseService subclasses whose resource maps
cleanly onto add/getAll/getById/update/delete against two related
endpoints: a collection endpoint (no path parameter, e.g.
/products) and an item endpoint (one{id}path parameter, e.g./products/{id}). -
AgPagedService<
T, PageKeyType extends Object> -
Gives a Service the
getPagethatAgListController.fetchPageneeds, implemented once by the framework rather than hand-written per module. -
AgPaginationMixin<
ItemType, PageKeyType extends Object> - Adds pagination/load-more behavior to an AgBaseController whose data is a List.
Extensions
-
AgPageStateX
on AgPageState<
T> - Convenience accessors over AgPageState.
Exceptions / Errors
- AgApiException
-
A transport/API failure surfaced by
ApiProvider. - AgArgumentError
- Thrown when an expected navigation argument was not supplied, or was supplied with the wrong type.
- AgEnvelopeException
- Thrown when a response body doesn't have the shape its AgEnvelope expects — a named, actionable error rather than a bare cast failure somewhere inside a decode callback.
- AgMissingPathParameterException
-
Thrown when an
AgEndpoint's path template has one or more{token}s with no corresponding path parameter value supplied on the request. - AgRepoException
-
Wraps an unexpected error raised while a repository ran its Service
call, via
AgBaseRepo.guard. - AgUnsupportedMethodException
- Thrown when an AgRequest is built with a AgRequest.method its AgEndpoint doesn't declare support for.