Karee Inject

Library used to help developers to better manage dependency injection during flutter development.

Usage

Karee Inject provide an amazing collection of annotation like Service for services, Value for reading value from application config file, Autowired to auto initialize classe and Persistable A simple usage example:

Use of @Persistable with data model

import 'package:karee_inject/karee_inject.dart';

@Persistable
class User {

  double id;
  String name;

}

Use of Serviceto define a service, and Autowiredto inject into property;

@Service
class ServiceUser {

  @Autowired
  DatabaseInterface db;

  User getUserById(double id){

    return db
      .find(User.runtimeType)
      .where('id', isEqualTo: id);
      
  }
}

Test

# Generate additional source first
flutter packages pub run build_runner build --delete-conflicting-outputs

# Then run test
flutter test

Libraries

karee.annotations
Karee.annotations [...]