A most easily usable improvement rate calculator library in Dart!
ImprovementRate
is an open-sourced Dart library.
With ImprovementRate
, you can easily calculate improvement rate on your application.
Maybe you have looked up a formula or implemented similar steps when comparing data and calculating improvement rates. With this library, such research and implementation is no longer necessary!
The following formula is used to calculate the improvement rate.
When after value should be increased:
When after value should be decreased:
With Dart:
dart pub add improvement_rate
With Flutter:
flutter pub add improvement_rate
import 'package:improvement_rate/improvement_rate.dart';
import 'package:improvement_rate/improvement_rate.dart';
void main() {
final calculator = Calculator.instance;
final resultShouldBeDecreased = calculator.evaluate(
before: 100,
after: 37,
);
final resultShouldBeIncreased = calculator.evaluate(
before: 100,
after: 37,
policy: ShouldBe.increased,
);
print(resultShouldBeDecreased);
print(resultShouldBeIncreased);
switch (resultShouldBeDecreased.trend) {
case Trend.better:
return;
case Trend.worse:
return;
}
}
Copyright (c) 2021, Kato Shinya. All rights reserved.
Use of this source code is governed by a
BSD-style license that can be found in the LICENSE file.
ImprovementRate
was designed and implemented by Kato Shinya.