/siberia

Primary LanguageDartMIT LicenseMIT

Useful extensions functions to dart language.

Getting started

https://pub.dev/packages/siberia

Usage

imports

import 'package:siberia/siberia.dart';

String Extentions

  • orEmpty:
final String? value;
print(value.orEmpty);
  • toInt:
final String value = "10";
final int intValue = value.toInt();
  • toIntOrNull:
final String value = "X10";
final int? intNullableValue = value.tryToInt();
  • toDouble:
final String value = "10";
final double doubleValue = value.toDouble();
  • toDoubleOrNull:
final String value = "X10";
final double? doubleNullableValue = value.tryToDouble();

Number extentions

  • orZero:
int? exampleInt;
double? exampleDouble;

print(exampleInt.orZero);
print(exampleDouble.orZero);

Contributors

Made with contributors-img.