kiwi icon indicating copy to clipboard operation
kiwi copied to clipboard

It is not generating anything

Open kristijorgji opened this issue 1 year ago • 1 comments

I am using

  build_runner: ^2.4.7
  kiwi_generator: ^4.1.0

and do run flutter packages pub run build_runner build

My /lib/di/core/injector.dart is

import 'package:dl_mobile_flutter/app/app_config.dart';
import 'package:kiwi/kiwi.dart';

part 'injector.g.dart';

const keyApiUrl = 'apiUrl';

abstract class Injector {
  void configure();

  void production();

  void development();

  static void inject(AppConfig config) {
    var injector = _$Injector()..configure();

    if (config.isProduction) {
      injector.production();
    } else if (config.isDevelopment) {
      injector.development();
    }
    KiwiContainer().registerInstance(config.baseUrl, name: keyApiUrl);
  }
}

T inject<T>([String? name]) => KiwiContainer().resolve<T>(name);

After running build_runner no injector.g.dart is created

kristijorgji avatar Jan 11 '24 13:01 kristijorgji

Hi, @kristijorgji!

Thank you for contributing to the development of Kiwi. I appreciate the information about the issue you're facing.

I believe it's a known issue, and possibly dependencies in kiwi_generator that have not been updated to the minimum versions.

I ask that you wait for the new release tag to test again to see if your problem still occurs.

Also, if you have any other questions, don't hesitate to send them here. 😄

gbtb16 avatar Jan 17 '24 12:01 gbtb16