Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GetIt in action

GetIt in action

Introduction to the Dart service locator GetIt

escamoteur

June 27, 2020
Tweet

Other Decks in Programming

Transcript

  1. Interactions inside an RxVMS App Login View Authentication Service User

    Manager RxComandsF unction calls (async) function calls or Streams Streams Map View Invoice Detail View Invoice Manager Database Service Location Service ** ** Can be (async) function calls or Streams or RxCommands. But should be limited as much as possible to avoid unnecessary coupling.
  2. How to access Managers / Services • Inherited Widgets •

    Provider ◦ both are part of the widget tree and requires a BuildContext • ServiceLocator GetIt ◦ Super fast ◦ No context needed ◦ Easy to use
  3. do

  4. Is that all? • Factories with Parameters • Manual synchronisation

    by using ◦ getIt.signalReady(instance); ◦ getIt.isReady<DbService>(); • Named Instances if you really need to register multiple instances of the same type
  5. Resources • My blog: https://www.burkharts.net/apps/blog/ • You can find me

    on Twitter @ThomasBurkhartsB • And on most chats under ‚escamoteur‘