Di Module

Using a register module (for third party dependencies) with injectable.
This will
@module  
abstract class AppModule {  
 // You can register named preemptive types like follows  
  @Named('dioBaseUrl')  
  String get baseUrl => 'https://api.backend.com';  
  
  // url here will be injected  
  @lazySingleton  
  Dio dio(@Named('dioBaseUrl') String url) => Dio(BaseOptions(baseUrl: url));  
  
  // same thing works for instances that's gotten asynchronous.  
  // all you need to do is wrap your instance with a future and tell injectable how to initialize it
  // if you need to pre resolve the value, 
  // make sure you await for your configure function before running the App.  
  @preResolve
  Future<SharedPreferences> get prefs => SharedPreferences.getInstance();  
}