stacked_services
1.6.0, released 2 years ago by filledstacks.com
Provides default implementations of services for the Stacked architecture.
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.
87Compare - go_router
If you prefer Flutter's official declarative routing package.
98Compare
Works with
Packages commonly used together with stacked_services: ones it builds on, ones built on it, and its own family.
- cryptostacked_services depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- getstacked_services depends on itAll-in-one framework for reactive state management, context-less routing, and dependency injection.
- stacked_sharedstacked_services depends on itShared code between the stacked packages.
- stackedstacked_services depends on itA complete frontend architecture framework for building Flutter applications.
- stacked_generatorSame familyGenerates routing and dependency‑injection boilerplate for Stacked apps.
- stacked_hooksSame familyClasses that help use Flutter Hooks with the stacked package architecture.
- stacked_themesSame familyManage multiple themes, dark mode, and theme persistence in Flutter applications.