Skip to content

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

License

Notifications You must be signed in to change notification settings

ferrarafer/stacked_services

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages