hrk_batteries

Last updated:

0 purchases

hrk_batteries Image
hrk_batteries Images
Add to Cart

Description:

hrk batteries

A library to accumulate required dart helper and utility codes
Features #

isDartOrFlutterTest()
isFlutterTest()
isFlutterIntegrationTest()
Build Modes

isReleaseMode()
isProfileMode()
isDebugMode()
getBuildModeString()


Unit

ValueUnit
ValueRange
Distance

DistanceUnit
DistanceRange


Velocity

VelocityUnit




HrkDateTime

today()
todayUtc()
toDate()
daysInMonth()
isLeapYear()
startOfMonth()
endOfMonth()
startOfDay()
endOfDay()
noon()


HrkString

capitalize()
localizeDigits()


NetworkState

Getting started #
dart pub add hrk_batteries
copied to clipboard
Usage #
import 'package:hrk_batteries/hrk_batteries.dart';

void main() {
// Logger log = Logger();
// late Level level;
if (isDartOrFlutterTest()) {
// level = Level.INFO;
} else {
// level = Level.SEVERE;
}
// log.log(level, 'Needs Attention');

final DateTime today = HrkDateTime.today();
final DateTime todayUtc = HrkDateTime.todayUtc();
final DateTime date = DateTime.now().toDate();

int daysInMonth = DateTime(2000, 2).daysInMonth(); // 29
daysInMonth = DateTime(2100, 2).daysInMonth(); // 28

bool leapYear = DateTime(2000, 2).isLeapYear(); // true
leapYear = DateTime(2100, 2).isLeapYear(); // false

final DateTime startOfMonth = DateTime.now().startOfMonth();
final DateTime endOfMonth = DateTime.now().endOfMonth();

final DateTime startOfDay = DateTime.now().startOfDay();
final DateTime endOfDay = DateTime.now().endOfDay();

final DateTime noon = DateTime.now().noon();

// A०१२३४५६७८९Z
final String enToMrLocalizedString = 'A0123456789Z'.localizeDigits(
toZeroDigit: '\u0966', // toZeroDigit: '०',
);
}
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.