Skip to content
pubscout

stacked_services

1.6.0, released 2 years ago by filledstacks.com

Provides default implementations of services for the Stacked architecture.

Quiet but busy
$ flutter pub add stacked_services
Source repository

What it does

It contains essential services like NavigationService, DialogService, SnackbarService, and BottomSheetService to aid in implementing the Stacked architecture. These services reduce boilerplate code and allow handling navigation and UI popups directly from ViewModels without needing a BuildContext.

AI-written summary of version 1.6.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are building an application using the Stacked architecture.
  • You want to handle navigation, dialogs, and snackbars directly from your ViewModels.

Skip it when

  • You are using a different state management architecture like Bloc, Provider, or Riverpod without Stacked.
  • You prefer a purely declarative routing approach.

Strengths

  • Reduces boilerplate code for Stacked architecture users.
  • Allows navigation and UI popups without passing BuildContext.

Weaknesses

  • Tightly coupled with the Stacked architecture ecosystem.
  • Relies heavily on the Get package for its underlying implementations.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
Yes (build_runner)
Direct dependencies
4

Assign StackedService.navigatorKey to your MaterialApp and register the services with get_it or Injectable.

final NavigationService _navigationService = locator<NavigationService>();

_navigationService.navigateTo(Routes.startupViewRoute);

Alternatives

Packages that do the same job and could replace stacked_services.

  • auto_route

    If you need a robust declarative routing and deep-linking solution with code generation.

  • go_router

    If you prefer Flutter's official declarative routing package.

Works with

Packages commonly used together with stacked_services: ones it builds on, ones built on it, and its own family.