orbital 0.1.0 copy "orbital: ^0.1.0" to clipboard
orbital: ^0.1.0 copied to clipboard

Full Orbital package that reexports core, injector and router.

orbital #

Bundle package that reexports orbital_core, orbital_injector and orbital_router, plus a convenience bootstrap for the Orbital DevTools runtime bridge.

When to use this package #

Use orbital when you want the full Orbital stack from a single import:

import 'package:orbital/orbital.dart';

Choose the individual packages when you want tighter dependency boundaries:

  • orbital_core for contracts only
  • orbital_injector for dependency scopes without Flutter routing
  • orbital_router for Flutter routing on top of Orbital scopes, using an explicit scopeFactory
  • orbital_devtools for the Flutter DevTools UI extension that consumes the Orbital debug snapshots

Quick start #

final logger = OrbitalLogger();
enableOrbitalDevtools(logger: logger, appId: 'my-app');

MaterialApp.router(
  routerConfig: OrbitalApp.router(
    logger: logger,
    scopeFactory: const DefaultOrbitalScopeFactory(),
    initialUri: Uri.parse('/'),
    modules: [
      OrbitalModule(
        path: '/',
        routes: [
          OrbitalPageRoute(
            path: '/',
            builder: (context, routeContext) => const HomePage(),
          ),
        ],
      ),
    ],
  ),
);

Key concepts #

  • OrbitalBinding defines dependency creation strategies
  • OrbitalDependencyRef defines readiness dependencies
  • OrbitalContainer resolves bindings inside scope trees
  • OrbitalModule and OrbitalPageRoute define the navigation tree
  • OrbitalMiddleware guards navigation

Async dependencies and dependsOn #

Use dependsOn to guarantee readiness order, not to inject values into the factory signature.

OrbitalBinding.singletonAsync<ApiClient>((resolver) async {
  return ApiClient.connect();
}),
OrbitalBinding.singleton<HomeController>(
  (resolver) => HomeController(
    resolver.get<ApiClient>(),
  ),
  dependsOn: [OrbitalDependencyRef.of<ApiClient>()],
),

This allows a sync controller to depend on async services safely after scope initialization.

More detail #

See doc.md for package relationships, lifecycle flow and guidance on when to use the bundle versus the individual packages.

0
likes
0
points
453
downloads

Publisher

unverified uploader

Weekly Downloads

Full Orbital package that reexports core, injector and router.

License

unknown (license)

Dependencies

flutter, orbital_core, orbital_injector, orbital_router

More

Packages that depend on orbital