maybe_as 0.0.4 copy "maybe_as: ^0.0.4" to clipboard
maybe_as: ^0.0.4 copied to clipboard

outdated

Optional as. Returns null if type if not match the class type.

example/main.dart

import 'package:maybe_as/maybe_as.dart';

void main() {
  final object = "string";
  print(object.maybeAs<String>());
  print(object.maybeAs<int>());
  print("1,2,3".maybeAsOr<String>("").split(","));
  print(1.maybeAsOr<String>("").split(","));
  print(null.maybeAs<int>());
  print(null.maybeAsOr<int>(0));
  print(null.maybeAsOr<String>("string"));
}
5
likes
0
pub points
46%
popularity

Publisher

verified publisherpub.iostech.org

Optional as. Returns null if type if not match the class type.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on maybe_as