stacked_services 0.2.1 copy "stacked_services: ^0.2.1" to clipboard
stacked_services: ^0.2.1 copied to clipboard

outdated

A package that contains some default implementations of services required for a cleaner implementation of the Stacked Architecture.

Stacked Services #

Provides some essential services to aid in implementing the Stacked architecture. These services are only here to reduce boiler plate code for the users of the Stacked Architecture that uses the architecture as instructed by FilledStacks on the architecture series.

Services #

The following services are included in the package

  • NavigationService: Makes use of the Get package to expose basic navigation functionalities
  • DialogService: Makes use of the Get package to expose functionality that allows the dev to show dialogs from the ViewModels
  • SnackbarService: Makes use of the Get to expose the snack bar functionality to devs.

The services can be registered with get_it normally as you would usually

final locator = GetIt.instance;

locator.registerLazySingleton(() => NavigationService());

If you're using Injectable as recommended you can register the services using a third party services module. Create a new file in your services folder called thirdparty_services_module.dart.

@registerModule
abstract class ThirdPartyServicesModule {
  @lazySingleton
  NavigationService get navigationService;
  @lazySingleton
  DialogService get dialogService;
  @lazySingleton
  SnackbarService get snackBarService;
}

If you now run

flutter pub run build_runner build

Your services will be available as usual on your locator instance.

260
likes
0
pub points
98%
popularity

Publisher

verified publisherfilledstacks.com

A package that contains some default implementations of services required for a cleaner implementation of the Stacked Architecture.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, get, injectable

More

Packages that depend on stacked_services